proc `and`(f: Flag; o: uint16): uint16 {...}{.borrow, inline.}
-
proc `and`(f: Flag; o: Flag): uint16 {...}{.borrow, inline.}
-
proc `or`(f: Flag; o: uint16): uint16 {...}{.borrow.}
-
proc `or`(o: uint16; f: Flag): uint16 {...}{.borrow.}
-
proc `==`(f: Flag; o: Flag): bool {...}{.borrow, inline.}
-
proc `==`(f: Flag; o: uint16): bool {...}{.borrow, inline.}
-
proc `==`(o: uint16; f: Flag): bool {...}{.borrow, inline.}
-
proc has_flag(f: Flag; o: uint16): bool {...}{.inline, raises: [], tags: [].}
-
proc pair(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc proper_pair(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc unmapped(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc mate_unmapped(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc reverse(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc mate_reverse(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc read1(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc read2(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc secondary(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc qcfail(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc dup(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc supplementary(f: Flag): bool {...}{.inline, raises: [], tags: [].}
-
proc `$`(f: Flag): string {...}{.raises: [], tags: [].}
-
proc `$`(o: CigarOp): char {...}{.inline, raises: [], tags: [].}
-
proc len(c: Cigar): int {...}{.inline, raises: [], tags: [].}
-
returns the number of operations in the cigar.
proc `[]`(c: Cigar; i: int): CigarElement {...}{.inline, raises: [], tags: [].}
-
proc op(o: CigarElement): CigarOp {...}{.inline, raises: [], tags: [].}
-
op gives the operation of the cigar.
proc len(o: CigarElement): int {...}{.inline, raises: [], tags: [].}
-
len gives the length of the cigar op.
proc `$`(o: CigarElement): string {...}{.raises: [], tags: [].}
-
shows the string representation of the cigar element.
proc `$`(c: Cigar): string {...}{.raises: [], tags: [].}
-
proc ref_coverage(c: Cigar; ipos: int = 0): seq[Range] {...}{.deprecated, raises: [], tags: [].}
-
Deprecated
proc `$`(h: Header): string {...}{.raises: [], tags: [].}
-
proc stats(idx: ptr hts_idx_t; tid: int): IndexStats {...}{.raises: [], tags: [].}
-
get the stats from the index.
proc copy(h: Header): Header {...}{.raises: [], tags: [].}
-
make a copy of the bam Header and underlying pointer.
proc xam_index(fn: string; fnidx: string = ""; min_shift: int = 14; nthreads: int = 1) {...}{.
raises: [ValueError, OSError], tags: [].}
-
index the file
proc from_string(h: Header; header_string: string) {...}{.raises: [ValueError], tags: [].}
-
create a new header from a string
proc from_string(r: Record; record_string: string) {...}{.raises: [ValueError], tags: [].}
-
update the record with the given SAM record. note that this does not make a copy of record_string and will modify the string in-place.
proc sequence(r: Record; s: var string): string {...}{.discardable, raises: [], tags: [].}
-
fill the given string with the read sequence
proc base_at(r: Record; i: int): char {...}{.inline, raises: [], tags: [].}
-
return just the base at the requsted index 'i' into the query sequence.
proc base_qualities(r: Record; q: var seq[uint8]): seq[uint8] {...}{.raises: [], tags: [].}
-
fill the given seq with the base-qualities.
proc base_quality_at(r: Record; i: int): uint8 {...}{.inline, raises: [], tags: [].}
-
proc targets(h: Header): seq[Target] {...}{.raises: [], tags: [].}
-
The targets (chromosomes) from the header.
proc `$`(t: Target): string {...}{.raises: [ValueError], tags: [].}
-
proc chrom(r: Record): string {...}{.inline, raises: [], tags: [].}
-
chrom returns the chromosome or '' if not mapped.
proc mate_chrom(r: Record): string {...}{.inline, raises: [], tags: [].}
-
mate_chrom returns the chromosome of the mate or '' if not mapped.
proc mate_tid(r: Record): int {...}{.inline, raises: [], tags: [].}
-
mate_tid returns the tid of the mate or -1 if not mapped.
proc tid(r: Record): int {...}{.inline, raises: [], tags: [].}
-
tid returns the tid of the alignment or -1 if not mapped.
proc start(r: Record): int64 {...}{.inline, raises: [], tags: [].}
-
start returns 0-based start position.
proc stop(r: Record): int {...}{.inline, raises: [], tags: [].}
-
stop returns end position of the read.
proc qname(r: Record): string {...}{.inline, raises: [], tags: [].}
-
qname returns the query name.
proc set_qname(r: Record; qname: string) {...}{.raises: [], tags: [].}
-
set a new qname for the record
proc flag(r: Record): Flag {...}{.inline, raises: [], tags: [].}
-
flag returns a Flag object.
proc cigar(r: Record): Cigar {...}{.inline, raises: [], tags: [].}
-
cigar returns a Cigar object.
proc `$`(r: Record): string {...}{.raises: [ValueError], tags: [].}
-
proc mapping_quality(r: Record): uint8 {...}{.inline, raises: [], tags: [].}
-
mapping quality
proc isize(r: Record): int64 {...}{.inline, raises: [], tags: [].}
-
insert size
proc mate_pos(r: Record): int64 {...}{.inline, raises: [], tags: [].}
-
mate position
proc tostring(r: Record): string {...}{.raises: [ValueError], tags: [].}
-
proc copy(r: Record): Record {...}{.noInit, raises: [], tags: [].}
-
copy makes a copy of the record.
proc write_header(bam: var Bam; header: Header) {...}{.raises: [ValueError], tags: [].}
-
write the bam the the bam stream. useful when a bam is opened in write mode. this also sets the header.
proc write(bam: var Bam; rec: Record) {...}{.inline, raises: [ValueError], tags: [].}
-
write the record to the bam which must be writeable.
proc close(bam: Bam) {...}{.raises: [], tags: [].}
-
proc NewRecord(h: Header): Record {...}{.raises: [], tags: [].}
-
create a new bam record and associate it with the header
proc open(bam: var Bam; path: cstring; threads: int = 0; mode: string = "r";
fai: cstring = nil; index: bool = false): bool {...}{.discardable,
raises: [IOError, ValueError], tags: [WriteIOEffect].}
-
open_hts returns a bam object for the given path. If CRAM, then fai must be given. if index is true, then it will attempt to open an index file for regional queries. for writing, mode can be, e.g. 'wb7' to indicate bam format with compression level 7 or 'wc' for cram format with default compression level.
proc load_index(b: Bam; path: string) {...}{.raises: [IOError, ValueError], tags: [].}
-
load the bam/cram index at the given path. This can be remote or local.
proc hts_set_opt(fp: ptr htsFile; opt: FormatOption): cint {...}{.varargs, cdecl,
importc: "hts_set_opt", dynlib: libname.}
-
proc set_fields(b: Bam; fields: varargs[SamField]): int {...}{.raises: [IOError],
tags: [WriteIOEffect].}
-
proc set_option(b: Bam; f: FormatOption; val: int): int {...}{.raises: [IOError],
tags: [WriteIOEffect].}
-
proc delete_tag(r: Record; itag: string): bool {...}{.inline, raises: [], tags: [].}
-
remove the tag from the record return a bool indicating success.
proc set_tag[T: int | float | string | char](r: Record; itag: string; value: T)
-
set the aux tag to value.
proc tag[T: int | float | float32 | float64 | string | char | cstring](r: Record; itag: string): Option[
T]
-
Get the aux tag from the record. Due to nim language limitations, this must be used as, e.g.: tag[int](rec, "NM"). This returns an Option type that is either Some result or none if the tag does not exist or if it is not of the requested type.