StockholmAlignment 1.0.4 → 1.1.0
raw patch · 3 files changed
+28/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Bio.StockholmDraw: extractGapfreeIndexedStructure :: String -> String -> [(Int, Char)]
- Bio.StockholmDraw: drawStockholmLines :: Int -> Double -> Vector Int -> Vector (Int, Vector (Colour Double)) -> StockholmAlignment -> QDiagram Cairo V2 Double Any
+ Bio.StockholmDraw: drawStockholmLines :: Int -> Double -> Vector (Int, Vector (Colour Double)) -> StockholmAlignment -> QDiagram Cairo V2 Double Any
Files
- StockholmAlignment.cabal +5/−5
- changelog +3/−0
- src/Bio/StockholmDraw.hs +20/−9
StockholmAlignment.cabal view
@@ -1,11 +1,11 @@ name: StockholmAlignment-version: 1.0.4+version: 1.1.0 synopsis: Libary for Stockholm aligmnent format description: Libary containing parsing and visualisation functions and datastructures for Stockholm aligmnent format license: GPL-3 license-file: LICENSE author: Florian Eggenhofer-maintainer: egg@tbi.univie.ac.at+maintainer: egg@informatik.uni-freiburg.de -- copyright: category: Bioinformatics build-type: Simple@@ -21,8 +21,8 @@ source-repository this type: git- location: https://github.com/eggzilla/StockholmAlignment/tree/1.0.4- tag: 1.0.4+ location: https://github.com/eggzilla/StockholmAlignment/tree/1.1.0+ tag: 1.1.0 library -- Modules exported by the library.@@ -32,7 +32,7 @@ Bio.StockholmFont -- compiler-options:- ghc-options: -Wall -O2 -fno-warn-unused-do-bind+ ghc-options: -Wall -fno-warn-unused-do-bind -- Other library packages from which modules are imported. build-depends: base >=4.5 && <5, parsec>=3.1.9, diagrams-lib>=1.3, text, vector, ParsecTools, diagrams-cairo>=1.3, filepath, colour, directory, either-unwrap, SVGFonts >= 1.4
changelog view
@@ -1,4 +1,7 @@ -*-change-log-*-+1.1.0 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 7. May 2017+ * Specific column labels are now passed as color vectors independent of model indices+ * Added consensus secondary structure to alignment visualisation 1.0.4 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 27. April 2017 * Added visualisation of consensus secondary structure if present 1.0.3 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 24. April 2017
src/Bio/StockholmDraw.hs view
@@ -10,6 +10,7 @@ drawStockholm, convertWUSStoDotBracket, extractGapfreeStructure,+ extractGapfreeIndexedStructure, isGap ) where @@ -23,8 +24,8 @@ import Graphics.SVGFonts import Bio.StockholmFont -drawStockholmLines :: Int -> Double -> V.Vector Int -> V.Vector (Int, V.Vector (Colour Double)) -> S.StockholmAlignment -> QDiagram Cairo V2 Double Any-drawStockholmLines entriesNumberCutoff maxWidth nodeAlignmentColIndices comparisonNodeLabels aln = alignmentBlocks+drawStockholmLines :: Int -> Double -> V.Vector (Int, V.Vector (Colour Double)) -> S.StockholmAlignment -> QDiagram Cairo V2 Double Any+drawStockholmLines entriesNumberCutoff maxWidth columnComparisonLabels aln = alignmentBlocks where seqEntries = V.fromList (take entriesNumberCutoff (S.sequenceEntries aln)) --consensusStructureEntry = if null (S.columnAnnotations aln) then mempty else drawConsensusStructureEntry maxIdLength (S.columnAnnotations aln) maybeConsensusStructureEntry = find ((T.pack "SS_cons"==) . S.tag) (S.columnAnnotations aln)@@ -37,9 +38,9 @@ letterWidth = 2.0 :: Double availableLettersPerRow = maxWidth / letterWidth blocks = makeLetterIntervals entryNumber availableLettersPerRow maxEntryLength- colIndicescomparisonNodeLabels = V.zipWith (\a b -> (a,b)) nodeAlignmentColIndices comparisonNodeLabels- sparseComparisonColLabels = V.map nodeToColIndices colIndicescomparisonNodeLabels- fullComparisonColLabels = fillComparisonColLabels maxEntryLength sparseComparisonColLabels+ --colIndicescomparisonNodeLabels = V.zipWith (\a b -> (a,b)) nodeAlignmentColIndices comparisonNodeLabels+ --sparseComparisonColLabels = V.map nodeToColIndices colIndicescomparisonNodeLabels+ fullComparisonColLabels = fillComparisonColLabels maxEntryLength columnComparisonLabels alignmentBlocks = vcat' with { _sep = 6.0 } (map (drawStockholmRowBlock maxIdLength vectorEntries maxEntryLength fullComparisonColLabels) blocks) extractGapfreeStructure :: String -> String -> String@@ -55,6 +56,20 @@ gapfreeCompleteStructure = V.filter (\(i,_) -> notElem i sequencegaps) (V.indexed completeBPStructure) entryStructure = map snd (V.toList gapfreeCompleteStructure) ++extractGapfreeIndexedStructure :: String -> String -> [(Int,Char)]+extractGapfreeIndexedStructure alignedSequence regularStructure1 = indexedEntryStructure+ where regularsequence1 = map convertToRegularGap alignedSequence+ bpindicestest1 = basePairIndices regularStructure1 [] 0+ sequencegaps = elemIndices '-' regularsequence1+ -- convert incomplete basepairs to .+ incompleteBasepairs = filter (\(i,j) -> elem i sequencegaps || elem j sequencegaps) bpindicestest1+ incompleteIndicesCharacterPairs = concatMap (\(a,b) -> [(a,'.'),(b,'.')]) incompleteBasepairs+ completeBPStructure = V.update (V.fromList regularStructure1) (V.fromList incompleteIndicesCharacterPairs)+ -- remove gap character postitions from structure string+ gapfreeCompleteStructure = V.filter (\(i,_) -> notElem i sequencegaps) (V.indexed completeBPStructure)+ indexedEntryStructure = (V.toList gapfreeCompleteStructure) + basePairIndices :: String -> [Int] -> Int -> [(Int,Int)] basePairIndices (x:xs) ys counter | x == '(' = basePairIndices xs (counter:ys) (counter+1)@@ -98,10 +113,6 @@ | c == ':' = '.' | c == ',' = '.' | otherwise = c---nodeToColIndices :: (Int,(Int,V.Vector (Colour Double))) -> (Int,V.Vector (Colour Double))-nodeToColIndices (colIndex,(_,colors)) = (colIndex,colors) fillComparisonColLabels :: Int -> V.Vector (Int, V.Vector (Colour Double)) -> V.Vector (Int, V.Vector (Colour Double)) fillComparisonColLabels maxEntryLength sparseComparisonColLabels = fullComparisonColLabels