bio.seq

Source code: bio/seq.seq

class bio.seq.seq

Magic methods:

__new__(s: str)
__new__(p: Ptr[byte], l: int)
__str__()
__len__()
extension str

Magic methods:

__prefix_s__[N](s: str)
class bio.seq.BaseCounts

Representation of base counts of a sequence

Magic methods:

__new__()

Base counts of empty sequence (i.e. all zero)

__add__(other: BaseCounts)

Adds corresponding base counts

__sub__(other: BaseCounts)

Subtracts corresponding base counts

__str__()

Methods:

add(A: bool = False, C: bool = False, G: bool = False, T: bool = False, N: bool = False)

Increments the specified base counts

extension seq

Properties:

bases

BaseCount for this sequence

Magic methods:

__new__(s: str)
__new__()
__eq__(other: seq)
__ne__(other: seq)
__to_py__()
__from_py__(s: pyobj)
__lt__(other: seq)
__le__(other: seq)
__gt__(other: seq)
__ge__(other: seq)
__str__()
__contains__(other: seq)
__contains__[K](kmer: K)
__len__()
__bool__()
__hash__()
__getitem__(idx: int)
__getitem__(s: Slice)
__copy__()
__iter__()
__reversed__()
__int__()
__invert__()

Reverse complemented sequence

__reversed__()

Methods:

split(k: int, step: int = 1)

Iterator over length-k subsequences of the given sequence with the specified step size.

kmers[K](step: int = 1)

Iterator over k-mers (type K) of the given sequence with the specified step size. Note that k-mers spanning ambiguous bases will be skipped.

kmers_canonical[K]()

Iterator over canonical k-mers (type K) of the given sequence. Note that k-mers spanning ambiguous bases will be skipped. A canonical k-mer is defined to be the minimum of a k-mer and its reverse complement.

kmers_canonical_with_pos[K]()

Iterator over (0-based index, canonical k-mer) tuples of the given sequence with the specified step size. Note that k-mers spanning ambiguous bases will be skipped.

kmers_with_pos[K](step: int = 1)

Iterator over (0-based index, k-mer) tuples of the given sequence with the specified step size. Note that k-mers spanning ambiguous bases will be skipped.

N()

Returns whether this sequence contains ambiguous bases. An ambiguous base is defined to be a non-ACGT base.

extension seq

Magic methods:

__match__(pattern: str)