BioHMM 1.1.7 → 1.1.8
raw patch · 4 files changed
+30/−16 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Bio.HMMCompareResult: linkscore1 :: HMMCompareResult -> Double
- Bio.HMMCompareResult: linkscore2 :: HMMCompareResult -> Double
- Bio.HMMCompareResult: linksequence :: HMMCompareResult -> String
- Bio.HMMCompareResult: model1Name :: HMMCompareResult -> String
- Bio.HMMCompareResult: model1matchednodes :: HMMCompareResult -> [Int]
- Bio.HMMCompareResult: model2Name :: HMMCompareResult -> String
- Bio.HMMCompareResult: model2matchednodes :: HMMCompareResult -> [Int]
+ Bio.HMMCompareResult: HMMCompareResult :: String -> String -> Double -> Double -> String -> [Int] -> [Int] -> HMMCompareResult
+ Bio.HMMCompareResult: [linkscore1] :: HMMCompareResult -> Double
+ Bio.HMMCompareResult: [linkscore2] :: HMMCompareResult -> Double
+ Bio.HMMCompareResult: [linksequence] :: HMMCompareResult -> String
+ Bio.HMMCompareResult: [model1Name] :: HMMCompareResult -> String
+ Bio.HMMCompareResult: [model1matchednodes] :: HMMCompareResult -> [Int]
+ Bio.HMMCompareResult: [model2Name] :: HMMCompareResult -> String
+ Bio.HMMCompareResult: [model2matchednodes] :: HMMCompareResult -> [Int]
Files
- BioHMM.cabal +3/−3
- changelog +4/−1
- src/Bio/HMMCompareResult.hs +9/−10
- src/Bio/HMMDraw.hs +14/−2
BioHMM.cabal view
@@ -1,5 +1,5 @@ name: BioHMM-version: 1.1.7+version: 1.1.8 synopsis: Libary for Hidden Markov Models in HMMER3 format. description: Libary containing parsing and visualisation functions and datastructures for Hidden Markov Models in HMMER3 format. license: GPL-3@@ -20,8 +20,8 @@ source-repository this type: git- location: https://github.com/eggzilla/BioHMM/tree/1.1.7- tag: 1.1.7+ location: https://github.com/eggzilla/BioHMM/tree/1.1.8+ tag: 1.1.8 library -- Modules exported by the library.
changelog view
@@ -1,4 +1,7 @@ -*-change-log-*-+1.1.8 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 8. June 2017+ * Minimal and simple visualisation now also support line mode+ * Added show instance for HMMCompareResult 1.1.7 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 7. June 2017 * Improved placment of legend 1.1.6 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 23. May 2017@@ -8,7 +11,7 @@ 1.1.4 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 22. May 2017 * Color scheme is now more robust for grayscale-printing 1.1.3 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 9. May 2017- * Now using same simplified label color scheme as CMDraw + * Now using same simplified label color scheme as CMDraw 1.1.2 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 7. May 2017 * Labels for columns are now passed to alignment visualisation instead of nodes * Improved mapping node to column labels
src/Bio/HMMCompareResult.hs view
@@ -2,23 +2,16 @@ module Bio.HMMCompareResult (- HMMCompareResult,+ HMMCompareResult(..), parseHMMCompareResult, readHMMCompareResult,- model1Name,- model2Name,- linkscore1,- linkscore2,- linksequence,- model1matchednodes,- model2matchednodes, getHMMCompareResults, getModelsNames, getModelNames ) where import Text.ParserCombinators.Parsec---import Control.Monad+import Data.List -- | Datastructure for result strings of comparisons between covariance models by HMMCompare data HMMCompareResult = HMMCompareResult@@ -29,7 +22,13 @@ linksequence :: String, model1matchednodes :: [Int], model2matchednodes :: [Int]- } deriving (Show)+ } deriving ()++instance Show HMMCompareResult where+ show (HMMCompareResult _model1Name _model2Name _linkscore1 _linkscore2 _linksequence _model1matchednodes _model2matchednodes) = _model1Name ++ " " ++ _model2Name ++ " " ++ show _linkscore1 ++ " " ++ show _linkscore2 ++ " " ++ _linksequence ++ " " ++ formatMatchedNodes _model1matchednodes ++ " " ++ formatMatchedNodes _model2matchednodes ++ "\n"++formatMatchedNodes :: [Int] -> String+formatMatchedNodes nodes = "[" ++ intercalate "," (map show nodes) ++ "]" -- | parse HMMCompareResult model from input string parseHMMCompareResult :: String -> Either ParseError [HMMCompareResult]
src/Bio/HMMDraw.hs view
@@ -72,8 +72,10 @@ nodeWidth = 6.0 :: Double nodeNumberPerRow = floor (maxWidth / nodeWidth - 2) nodesIntervals = makeNodeIntervals nodeNumberPerRow nodeNumber- minimalNodes = hcat (V.toList (V.map (drawHMMNodeMinimal comparisonNodeLabels)currentNodes)) # scale scalef- simpleNodes = hcat (V.toList (V.map (drawHMMNodeSimple alphabetSymbols emissiontype boxlength comparisonNodeLabels) currentNodes)) # scale scalef+ --minimalNodes = hcat (V.toList (V.map (drawHMMNodeMinimal comparisonNodeLabels)currentNodes)) # scale scalef+ --simpleNodes = hcat (V.toList (V.map (drawHMMNodeSimple alphabetSymbols emissiontype boxlength comparisonNodeLabels) currentNodes)) # scale scalef+ minimalNodes = vcat' with { _sep = 3 } (V.toList (V.map (drawMinimalNodeRow currentNodes comparisonNodeLabels) nodesIntervals))+ simpleNodes = vcat' with { _sep = 3 } (V.toList (V.map (drawSimpleNodeRow alphabetSymbols emissiontype boxlength currentNodes comparisonNodeLabels) nodesIntervals)) verboseNodes = vcat' with { _sep = 3 } (V.toList (V.map (drawDetailedNodeRow alphabetSymbols emissiontype boxlength transitionCutoff nodeNumber currentNodes comparisonNodeLabels) nodesIntervals)) minimalNodesHeader = alignTL (vcat' with { _sep = 5 } [modelHeader,minimalNodes]) simpleNodesHeader = alignTL (vcat' with { _sep = 5 } [modelHeader,simpleNodes])@@ -138,6 +140,16 @@ rowLength = nodeNumberPerRow safeLength = if rowStart + rowLength >= nodeNumber then nodeNumber - rowStart else rowLength +drawMinimalNodeRow :: V.Vector HM.HMMER3Node -> V.Vector (Int,V.Vector (Colour Double)) -> (Int, Int) -> QDiagram Cairo V2 Double Any+drawMinimalNodeRow allNodes comparisonNodeLabels (currentIndex,nodeSliceLength) = simpleNodes+ where currentNodes = V.slice currentIndex nodeSliceLength allNodes+ simpleNodes = hcat (V.toList (V.map (drawHMMNodeMinimal comparisonNodeLabels) currentNodes))+ +drawSimpleNodeRow :: String -> String -> Double -> V.Vector HM.HMMER3Node -> V.Vector (Int,V.Vector (Colour Double)) -> (Int, Int) -> QDiagram Cairo V2 Double Any+drawSimpleNodeRow alphabetSymbols emissiontype boxLength allNodes comparisonNodeLabels (currentIndex,nodeSliceLength) = simpleNodes+ where currentNodes = V.slice currentIndex nodeSliceLength allNodes+ simpleNodes = hcat (V.toList (V.map (drawHMMNodeSimple alphabetSymbols emissiontype boxLength comparisonNodeLabels) currentNodes))+ drawDetailedNodeRow :: String -> String -> Double -> Double -> Int -> V.Vector HM.HMMER3Node -> V.Vector (Int,V.Vector (Colour Double)) -> (Int, Int) -> QDiagram Cairo V2 Double Any drawDetailedNodeRow alphabetSymbols emissiontype boxLength transitionCutoff lastIndex allNodes comparisonNodeLabels (currentIndex,nodeSliceLength) = detailedRow where currentNodes = V.slice currentIndex nodeSliceLength allNodes