StockholmAlignment 1.1.0 → 1.1.1
raw patch · 3 files changed
+14/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- StockholmAlignment.cabal +4/−4
- changelog +2/−0
- src/Bio/StockholmDraw.hs +8/−6
StockholmAlignment.cabal view
@@ -1,11 +1,11 @@ name: StockholmAlignment-version: 1.1.0+version: 1.1.1 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@informatik.uni-freiburg.de+maintainer: egg@tbi.univie.ac.at -- copyright: category: Bioinformatics build-type: Simple@@ -21,8 +21,8 @@ source-repository this type: git- location: https://github.com/eggzilla/StockholmAlignment/tree/1.1.0- tag: 1.1.0+ location: https://github.com/eggzilla/StockholmAlignment/tree/1.1.1+ tag: 1.1.1 library -- Modules exported by the library.
changelog view
@@ -1,4 +1,6 @@ -*-change-log-*-+1.1.1 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 7. May 2017+ * Fixed use of vector index instead of column number for col index and label placing 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
src/Bio/StockholmDraw.hs view
@@ -38,9 +38,8 @@ 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 columnComparisonLabels+ --comparison labels are sparse, because some columns are not directly assigned to a node, but modeled via indel+ fullComparisonColLabels = fillComparisonColLabels (maxEntryLength +1) columnComparisonLabels alignmentBlocks = vcat' with { _sep = 6.0 } (map (drawStockholmRowBlock maxIdLength vectorEntries maxEntryLength fullComparisonColLabels) blocks) extractGapfreeStructure :: String -> String -> String@@ -137,18 +136,21 @@ spacer = replicate spacerLength ' ' --indexLetters = map show indices --indexPositions = maximum (map length indices)- maxEntryIndex = maximum indices+ maxEntryIndex = 1 + maximum indices maxEntryText = show maxEntryIndex totalBoxYlength = fromIntegral (length maxEntryText) * 2.5 indexLine = hcat (map setAlignmentLetter spacer) ||| hcat (map (drawStockholmIndexLineCol comparisonColLabels totalBoxYlength) indices) drawStockholmIndexLineCol :: V.Vector (Int, V.Vector (Colour Double)) -> Double -> Int -> QDiagram Cairo V2 Double Any drawStockholmIndexLineCol comparisonColLabels totalBoxYlength entryIndex = vcat (map setAlignmentLetter entryText) <> colourBoxes # translate (r2 (0, negate ((singleBoxYLength/2)-1.25)))- where comparisonColLabel = comparisonColLabels V.! entryIndex+ where columnNumber = fst comparisonColLabel+ -- comparisonColLabel with index zero holds label for first col+ comparisonColLabel = comparisonColLabels V.! (entryIndex + 1)+ --comparisonColLabel = if (entryIndex + 1) > ((V.length comparisonColLabels) -1) then (entryIndex + 1,V.singleton white) else comparisonColLabels V.! (entryIndex + 1) colColours = snd comparisonColLabel boxNumber = fromIntegral $ V.length colColours singleBoxYLength = totalBoxYlength / boxNumber- entryText = show entryIndex+ entryText = show columnNumber colourBoxes = vcat (V.toList (V.map (colorBox singleBoxYLength) colColours)) colorBox :: Double -> Colour Double -> QDiagram Cairo V2 Double Any