biohazard-2.1: bioinformatics support library

Safe HaskellNone
LanguageHaskell2010

Bio.Bam.Rec

Description

Parsers and Printers for BAM and SAM.

Synopsis

Documentation

data BamRaw Source #

Bam record in its native encoding along with virtual address.

Instances
IsBamRec BamRaw Source # 
Instance details

Defined in Bio.Bam.Writer

bamRaw :: MonadThrow m => Int64 -> Bytes -> m BamRaw Source #

Smart constructor. Makes sure we got a at least a full record.

data BamRec Source #

More convenient representation of a BAM record. Invariant: Either b_qual == Nothing or fmap V.length b_qual == Just (V.length b_seq).

Constructors

BamRec 
Instances
Show BamRec Source # 
Instance details

Defined in Bio.Bam.Rec

IsBamRec BamRec Source # 
Instance details

Defined in Bio.Bam.Writer

data Cigar Source #

Cigar line in BAM coding Bam encodes an operation and a length into a single integer, we keep those integers in an array.

Constructors

!CigOp :* !Int infix 9 
Instances
Eq Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

(==) :: Cigar -> Cigar -> Bool #

(/=) :: Cigar -> Cigar -> Bool #

Ord Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

compare :: Cigar -> Cigar -> Ordering #

(<) :: Cigar -> Cigar -> Bool #

(<=) :: Cigar -> Cigar -> Bool #

(>) :: Cigar -> Cigar -> Bool #

(>=) :: Cigar -> Cigar -> Bool #

max :: Cigar -> Cigar -> Cigar #

min :: Cigar -> Cigar -> Cigar #

Show Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

showsPrec :: Int -> Cigar -> ShowS #

show :: Cigar -> String #

showList :: [Cigar] -> ShowS #

Storable Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

sizeOf :: Cigar -> Int #

alignment :: Cigar -> Int #

peekElemOff :: Ptr Cigar -> Int -> IO Cigar #

pokeElemOff :: Ptr Cigar -> Int -> Cigar -> IO () #

peekByteOff :: Ptr b -> Int -> IO Cigar #

pokeByteOff :: Ptr b -> Int -> Cigar -> IO () #

peek :: Ptr Cigar -> IO Cigar #

poke :: Ptr Cigar -> Cigar -> IO () #

data CigOp Source #

Constructors

Mat 
Ins 
Del 
Nop 
SMa 
HMa 
Pad 
Instances
Bounded CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Enum CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Eq CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

(==) :: CigOp -> CigOp -> Bool #

(/=) :: CigOp -> CigOp -> Bool #

Ord CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

compare :: CigOp -> CigOp -> Ordering #

(<) :: CigOp -> CigOp -> Bool #

(<=) :: CigOp -> CigOp -> Bool #

(>) :: CigOp -> CigOp -> Bool #

(>=) :: CigOp -> CigOp -> Bool #

max :: CigOp -> CigOp -> CigOp #

min :: CigOp -> CigOp -> CigOp #

Show CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

showsPrec :: Int -> CigOp -> ShowS #

show :: CigOp -> String #

showList :: [CigOp] -> ShowS #

Ix CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

alignedLength :: Vector v Cigar => v Cigar -> Int Source #

Extracts the aligned length from a cigar line. This gives the length of an alignment as measured on the reference, which is different from the length on the query or the length of the alignment.

newtype Nucleotides Source #

A nucleotide base in an alignment. Experience says we're dealing with Ns and gaps all the type, so purity be damned, they are included as if they were real bases.

To allow Nucleotidess to be unpacked and incorporated into containers, we choose to represent them the same way as the BAM file format: as a 4 bit wide field. Gaps are encoded as 0 where they make sense, N is 15. The contained Word8 is guaranteed to be 0..15.

Constructors

Ns 

Fields

Instances
Bounded Nucleotides Source # 
Instance details

Defined in Bio.Base

Enum Nucleotides Source # 
Instance details

Defined in Bio.Base

Eq Nucleotides Source # 
Instance details

Defined in Bio.Base

Ord Nucleotides Source # 
Instance details

Defined in Bio.Base

Read Nucleotides Source # 
Instance details

Defined in Bio.Base

Show Nucleotides Source # 
Instance details

Defined in Bio.Base

Ix Nucleotides Source # 
Instance details

Defined in Bio.Base

Semigroup Nucleotides Source # 
Instance details

Defined in Bio.Base

Monoid Nucleotides Source # 
Instance details

Defined in Bio.Base

Storable Nucleotides Source # 
Instance details

Defined in Bio.Base

Vector Vector_Nucs_half Nucleotides Source # 
Instance details

Defined in Bio.Bam.Rec

Show (Vector_Nucs_half Nucleotides) Source # 
Instance details

Defined in Bio.Bam.Rec

type Extensions = [(BamKey, Ext)] Source #

A collection of extension fields. A BamKey is actually two ASCII characters.

data Ext Source #

Instances
Eq Ext Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

(==) :: Ext -> Ext -> Bool #

(/=) :: Ext -> Ext -> Bool #

Ord Ext Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

compare :: Ext -> Ext -> Ordering #

(<) :: Ext -> Ext -> Bool #

(<=) :: Ext -> Ext -> Bool #

(>) :: Ext -> Ext -> Bool #

(>=) :: Ext -> Ext -> Bool #

max :: Ext -> Ext -> Ext #

min :: Ext -> Ext -> Ext #

Show Ext Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

showsPrec :: Int -> Ext -> ShowS #

show :: Ext -> String #

showList :: [Ext] -> ShowS #

deleteE :: BamKey -> Extensions -> Extensions Source #

Deletes all occurences of some extension field.

insertE :: BamKey -> Ext -> Extensions -> Extensions Source #

Blindly inserts an extension field. This can create duplicates (and there is no telling how other tools react to that).

updateE :: BamKey -> Ext -> Extensions -> Extensions Source #

Deletes all occurences of an extension field, then inserts it with a new value. This is safer than insertE, but also more expensive.

adjustE :: (Ext -> Ext) -> BamKey -> Extensions -> Extensions Source #

Adjusts a named extension by applying a function.