Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilterFunc ¶
FilterFunc is a function that returns true for a SAM record that passes the filter and false otherwise.
func Length ¶
func Length(val int, op ql.Token) FilterFunc
Length returns a FilterFunc that compares the given value to the sam record alignment length.
func Logical ¶
func Logical(f, ff FilterFunc, op ql.Token) FilterFunc
Logical combines two FilterFunc with the operator op and returns a new FilterFunc.
func Pos ¶
func Pos(val int, op ql.Token) FilterFunc
Pos returns a FilterFunc that compares the given value to the sam record alignment position.
func Qname ¶
func Qname(val string, op ql.Token) FilterFunc
Qname returns a FilterFunc that compares the given value to the sam record query name.
func Rname ¶
func Rname(val string, op ql.Token) FilterFunc
Rname returns a FilterFunc that compares the given value to the sam record reference name.
func Where ¶
func Where(query string) (FilterFunc, error)
Where returns a FilterFunc that is constructed from an SQL WHERE statement. The function assumes the WHERE keyword is not part of query.
type Keyword ¶
type Keyword int
Keyword corresponds to reserved words that have a special meaning in samql and samql queries.
const ( // QNAME corresponds to the SAM record query name. QNAME Keyword = iota // FLAG corresponds to the SAM record alignment flag. FLAG // RNAME corresponds to the SAM record reference name. RNAME // POS corresponds to the SAM record position. POS // MAPQ corresponds to the SAM record mapping quality. MAPQ // CIGAR corresponds to the SAM record CIGAR string. CIGAR // RNEXT corresponds to the reference name of the mate read. RNEXT // PNEXT corresponds to the position of the mate read. PNEXT // TLEN corresponds to SAM record template length. TLEN // SEQ corresponds to SAM record segment sequence. SEQ // QUAL corresponds to SAM record quality. QUAL // LENGTH corresponds to the alignment length. LENGTH )
type Reader ¶
type Reader struct { Filters []FilterFunc // contains filtered or unexported fields }
Reader is a filtering-enabled SAM reader. Provided filters are applied to each record and only records that pass the filters are returned.
func NewReader ¶
func NewReader(r readerSAM) *Reader
NewReader returns a new samql Reader that reads from r.