bio.seq
¶
Source code: bio/seq.seq
-
type
bio.seq.
BaseCounts
¶ Representation of base counts of a sequence
Magic methods:
-
__init__
() 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:
-
__init__
(s: str)
-
__init__
()
-
__eq__
(other: seq)
-
__ne__
(other: seq)
-
__lt__
(other: seq)
-
__le__
(other: seq)
-
__gt__
(other: seq)
-
__ge__
(other: seq)
-
__str__
()
-
__contains__
(other: seq)
-
__len__
()
-
__bool__
()
-
__hash__
()
-
__getitem__
(idx: int)
-
__getitem__
(s: slice)
-
__getitem__
(s: lslice)
-
__getitem__
(s: rslice)
-
__getitem__
(s: eslice)
-
__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.
-