blastxml 0.2 → 0.3
raw patch · 3 files changed
+9/−18 lines, 3 filesdep +biocorePVP ok
version bump matches the API change (PVP)
Dependencies added: biocore
API changes (from Hackage documentation)
- Bio.BlastXML: BlastHit :: !SeqId -> !Int -> [BlastMatch] -> BlastHit
- Bio.BlastXML: BlastMatch :: !Double -> !Double -> (Int, Int) -> !Int -> !Int -> !Int -> !Int -> !ByteString -> !ByteString -> !Aux -> BlastMatch
- Bio.BlastXML: BlastRecord :: !SeqId -> !Int -> [BlastHit] -> BlastRecord
- Bio.BlastXML: BlastResult :: !ByteString -> !ByteString -> !ByteString -> !ByteString -> !ByteString -> !Integer -> !Integer -> [BlastRecord] -> BlastResult
- Bio.BlastXML: Frame :: !Strand -> !Int -> Aux
- Bio.BlastXML: Minus :: Strand
- Bio.BlastXML: Plus :: Strand
- Bio.BlastXML: Strands :: !Strand -> !Strand -> Aux
- Bio.BlastXML: aux :: BlastMatch -> !Aux
- Bio.BlastXML: bits :: BlastMatch -> !Double
- Bio.BlastXML: blastdate :: BlastResult -> !ByteString
- Bio.BlastXML: blastprogram :: BlastResult -> !ByteString
- Bio.BlastXML: blastreferences :: BlastResult -> !ByteString
- Bio.BlastXML: blastversion :: BlastResult -> !ByteString
- Bio.BlastXML: data Aux
- Bio.BlastXML: data BlastHit
- Bio.BlastXML: data BlastMatch
- Bio.BlastXML: data BlastRecord
- Bio.BlastXML: data BlastResult
- Bio.BlastXML: data Strand
- Bio.BlastXML: database :: BlastResult -> !ByteString
- Bio.BlastXML: dbchars :: BlastResult -> !Integer
- Bio.BlastXML: dbsequences :: BlastResult -> !Integer
- Bio.BlastXML: e_val :: BlastMatch -> !Double
- Bio.BlastXML: h_from :: BlastMatch -> !Int
- Bio.BlastXML: h_to :: BlastMatch -> !Int
- Bio.BlastXML: hits :: BlastRecord -> [BlastHit]
- Bio.BlastXML: hseq :: BlastMatch -> !ByteString
- Bio.BlastXML: identity :: BlastMatch -> (Int, Int)
- Bio.BlastXML: matches :: BlastHit -> [BlastMatch]
- Bio.BlastXML: q_from :: BlastMatch -> !Int
- Bio.BlastXML: q_to :: BlastMatch -> !Int
- Bio.BlastXML: qlength :: BlastRecord -> !Int
- Bio.BlastXML: qseq :: BlastMatch -> !ByteString
- Bio.BlastXML: query :: BlastRecord -> !SeqId
- Bio.BlastXML: results :: BlastResult -> [BlastRecord]
- Bio.BlastXML: slength :: BlastHit -> !Int
- Bio.BlastXML: subject :: BlastHit -> !SeqId
- Bio.BlastXML: type SeqId = ByteString
+ Bio.BlastData: BlastHit :: !SeqLabel -> !Int -> [BlastMatch] -> BlastHit
+ Bio.BlastData: BlastMatch :: !Double -> !Double -> (Int, Int) -> !Int -> !Int -> !Int -> !Int -> !ByteString -> !ByteString -> !Aux -> BlastMatch
+ Bio.BlastData: BlastRecord :: !SeqLabel -> !Int -> [BlastHit] -> BlastRecord
+ Bio.BlastData: BlastResult :: !ByteString -> !ByteString -> !ByteString -> !ByteString -> !ByteString -> !Integer -> !Integer -> [BlastRecord] -> BlastResult
+ Bio.BlastData: Frame :: !Strand -> !Int -> Aux
+ Bio.BlastData: Strands :: !Strand -> !Strand -> Aux
+ Bio.BlastData: aux :: BlastMatch -> !Aux
+ Bio.BlastData: bits :: BlastMatch -> !Double
+ Bio.BlastData: blastdate :: BlastResult -> !ByteString
+ Bio.BlastData: blastprogram :: BlastResult -> !ByteString
+ Bio.BlastData: blastreferences :: BlastResult -> !ByteString
+ Bio.BlastData: blastversion :: BlastResult -> !ByteString
+ Bio.BlastData: data Aux
+ Bio.BlastData: data BlastHit
+ Bio.BlastData: data BlastMatch
+ Bio.BlastData: data BlastRecord
+ Bio.BlastData: data BlastResult
+ Bio.BlastData: database :: BlastResult -> !ByteString
+ Bio.BlastData: dbchars :: BlastResult -> !Integer
+ Bio.BlastData: dbsequences :: BlastResult -> !Integer
+ Bio.BlastData: e_val :: BlastMatch -> !Double
+ Bio.BlastData: h_from :: BlastMatch -> !Int
+ Bio.BlastData: h_to :: BlastMatch -> !Int
+ Bio.BlastData: hits :: BlastRecord -> [BlastHit]
+ Bio.BlastData: hseq :: BlastMatch -> !ByteString
+ Bio.BlastData: identity :: BlastMatch -> (Int, Int)
+ Bio.BlastData: instance Eq Aux
+ Bio.BlastData: instance Show Aux
+ Bio.BlastData: instance Show BlastHit
+ Bio.BlastData: instance Show BlastMatch
+ Bio.BlastData: instance Show BlastRecord
+ Bio.BlastData: instance Show BlastResult
+ Bio.BlastData: matches :: BlastHit -> [BlastMatch]
+ Bio.BlastData: q_from :: BlastMatch -> !Int
+ Bio.BlastData: q_to :: BlastMatch -> !Int
+ Bio.BlastData: qlength :: BlastRecord -> !Int
+ Bio.BlastData: qseq :: BlastMatch -> !ByteString
+ Bio.BlastData: query :: BlastRecord -> !SeqLabel
+ Bio.BlastData: results :: BlastResult -> [BlastRecord]
+ Bio.BlastData: slength :: BlastHit -> !Int
+ Bio.BlastData: subject :: BlastHit -> !SeqLabel
Files
- blastxml.cabal +3/−4
- src/Bio/BlastData.hs +3/−10
- src/Bio/BlastXML.hs +3/−4
blastxml.cabal view
@@ -1,5 +1,5 @@ Name: blastxml-Version: 0.2+Version: 0.3 Synopsis: Library for reading Blast XML output Description: This library contains a data structure and functions for reading output from the BLAST sequence alignment program.@@ -18,8 +18,7 @@ Tag: 0.2 Library- Exposed-modules: Bio.BlastXML- Other-modules: Bio.BlastData- Build-depends: base >= 3 && < 5, bytestring, parallel, tagsoup+ Exposed-modules: Bio.BlastXML Bio.BlastData+ Build-depends: base >= 3 && < 5, biocore >= 0.3.0, bytestring, parallel, tagsoup Hs-Source-Dirs: src Ghc-Options: -Wall
src/Bio/BlastData.hs view
@@ -17,16 +17,9 @@ module Bio.BlastData where import Data.ByteString.Lazy.Char8 (ByteString)+import Bio.Core -- ---------------------------------------------------------------- | The sequence id, i.e. the first word of the header field.-type SeqId = ByteString---- | The 'Strand' indicates the direction of the match, i.e. the plain sequence or--- its reverse complement.-data Strand = Plus | Minus deriving (Read,Show,Eq)- -- | The Aux field in the BLAST output includes match information that depends -- on the BLAST flavor (blastn, blastx, or blastp). This data structure captures -- those variations.@@ -44,12 +37,12 @@ deriving Show -- | Each query sequence generates a 'BlastRecord'-data BlastRecord = BlastRecord { query :: !SeqId, qlength :: !Int+data BlastRecord = BlastRecord { query :: !SeqLabel, qlength :: !Int , hits :: [BlastHit] } deriving Show -- | Each match between a query and a target sequence (or subject) -- is a 'BlastHit'.-data BlastHit = BlastHit { subject :: !SeqId, slength :: !Int +data BlastHit = BlastHit { subject :: !SeqLabel, slength :: !Int , matches :: [BlastMatch] } deriving Show -- | A 'BlastHit' may contain multiple separate matches (typcially when -- an indel causes a frameshift that blastx is unable to bridge).
src/Bio/BlastXML.hs view
@@ -16,6 +16,7 @@ , module Bio.BlastData) where import Bio.BlastData+import Bio.Core import qualified Data.ByteString.Lazy.Char8 as B import Text.HTML.TagSoup@@ -70,7 +71,7 @@ iter2rec :: [[STag]] -> BlastRecord iter2rec (i:hs) = BlastRecord - { query = get "Iteration_query-def"+ { query = SeqLabel $ get "Iteration_query-def" , qlength = readI $ get "Iteration_query-len" , hits = map hit2hit hs }@@ -80,7 +81,7 @@ hit2hit :: [STag] -> BlastHit hit2hit hs = BlastHit - { subject = get "Hit_def"+ { subject = SeqLabel $ get "Hit_def" , slength = readI $ get "Hit_len" , matches = map hsp2match $ partitions (isTagOpenName "Hsp") hs }@@ -124,5 +125,3 @@ -- ignore frame also for tblastx hits (it can be reconstructed from location) strand' :: Int -> Strand strand' s = if s > 0 then Plus else Minus--