biohazard-2.0: 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 :: Int64 -> Bytes -> BamRaw Source #

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

data BamRec Source #

internal representation of a BAM record

Constructors

BamRec 

Fields

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 Source #

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

Ord Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Show Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

Storable Cigar Source # 
Instance details

Defined in Bio.Bam.Rec

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 Source #

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

Ord CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

Show CigOp Source # 
Instance details

Defined in Bio.Bam.Rec

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

Storable Nucleotides Source # 
Instance details

Defined in Bio.Base

Vector Vector_Nucs_half Nucleotides 
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 #

Constructors

Int Int 
Float Float 
Text Bytes 
Bin Bytes 
Char Word8 
IntArr (Vector Int) 
FloatArr (Vector Float) 
Instances
Eq Ext Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

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

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

Ord Ext Source # 
Instance details

Defined in Bio.Bam.Rec

Methods

compare :: Ext -> Ext -> Ordering Source #

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

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

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

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

max :: Ext -> Ext -> Ext Source #

min :: Ext -> Ext -> Ext Source #

Show Ext Source # 
Instance details

Defined in Bio.Bam.Rec

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.