bio.bam

Source code: bio/bam.seq

bio.bam.BAM_FPAIRED
bio.bam.BAM_FPROPER_PAIR
bio.bam.BAM_FUNMAP
bio.bam.BAM_FMUNMAP
bio.bam.BAM_FREVERSE
bio.bam.BAM_FMREVERSE
bio.bam.BAM_FREAD1
bio.bam.BAM_FREAD2
bio.bam.BAM_FSECONDARY
bio.bam.BAM_FQCFAIL
bio.bam.BAM_FDUP
bio.bam.BAM_FSUPPLEMENTARY
bio.bam.AUX_TYPE_INT8
bio.bam.AUX_TYPE_UINT8
bio.bam.AUX_TYPE_INT16
bio.bam.AUX_TYPE_UINT16
bio.bam.AUX_TYPE_INT32
bio.bam.AUX_TYPE_UINT32
bio.bam.AUX_TYPE_FLOAT
bio.bam.AUX_TYPE_DOUBLE
bio.bam.AUX_TYPE_CHAR
bio.bam.AUX_TYPE_STRING
bio.bam.AUX_TYPE_ARRAY
bio.bam.AUX_TYPE_INT
class bio.bam.SAMAux

Properties:

tag_type

String representing the type of this tag.

  • “int”: use i property for int value

  • “float”: use f property for float value

  • “char”: use A property for byte value

  • “string”: use Z property for string value

  • “Array[int]”: use B_len for array length and either B2i(index) to access elements

  • “Array[float]”: use B_len for array length and either B2f(index) to access elements

i

Int value of this tag

f

Float value of this tag

A

Byte value of this tag

Z

String value of this tag

B_len

Array length of this tag

Magic methods:

__bool__()
__str__()
__len__()

Methods:

B2i(idx: int)

`idx`th element of integer array comprising this tag

B2f(idx: int)

`idx`th element of float array comprising this tag

class bio.bam.SAMRecord

Properties:

name

Read name of this record

query_name

Alias of name

read
seq

Record sequence

qual

Record quality string

cigar

Record CIGAR

tid

Record contig ID

flag

Record flag

pos

Record position (0-based)

locus

Record Locus consisting of tid and pos

mate_tid

Contig ID in mate’s record

mate_pos

Position in mate’s record (0-based)

mate_locus

Record Locus of mate’s record consisting of mate_tid and mate_pos

mapq

Record’s mapping quality

insert_size

Record’s insert size

paired

Whether this record is paired

proper_pair

Whether this record and its pair form a proper pair

unmapped

Whether this record is unmapped

mate_unmapped

Whether mate’s record is unmapped

reversed

Whether this record is reverse complemented on the reference

mate_reversed

Whether this record’s mate is reverse complemented on the reference

read1

Whether this is the first read in the pair

read2

Whether this is the second read in the pair

secondary

Whether this is a seconday alignment

qc_fail

Whether this record failed quality control checks

duplicate

Whether this record is marked as a duplicate

supplementary

Whether this record is supplementary

endpos

The rightmost base position of an alignment on the reference genome

Magic methods:

__init__(htslib_record: _bam1_t)

Methods:

aux(tag: str)

Returns the auxiliary tag with the specified key.

class bio.bam.BAMReader

Magic methods:

__init__(path: str, region: str, copy: bool, num_threads: int)
__blocks__(size: int)
__seqs__()
__iter__()
__enter__()
__exit__()

Methods:

seek(region: str)
close()
contigs()
contig(rid: int)
class bio.bam.SAMReader

Magic methods:

__init__(path: str, copy: bool, num_threads: int)
__seqs__()
__iter__()
__blocks__(size: int)
__enter__()
__exit__()

Methods:

close()
contigs()
contig(rid: int)
bio.bam.CRAMReader
bio.bam.SAM(path: str, copy: bool = True, num_threads: int = 0)
bio.bam.BAM(path: str, region: str = '.', copy: bool = True, num_threads: int = 0)
bio.bam.CRAM(path: str, region: str = '.', copy: bool = True, num_threads: int = 0)