skbio.sequence.NucleotideMixin#

class skbio.sequence.NucleotideMixin[source]#

Mixin for adding funtionality for working with sequences of nucleotides.

This is an abstract base class (ABC) that cannot be instantiated.

See also

DNA
RNA

Attributes

complement_map

Return mapping of nucleotide characters to their complements.

Methods

complement([reverse])

Return the complement of the nucleotide sequence.

gc_content()

Calculate the relative frequency of G's and C's in the sequence.

gc_frequency([relative])

Calculate frequency of G's and C's in the sequence.

is_reverse_complement(other)

Determine if a sequence is the reverse complement of this sequence.

reverse_complement()

Return the reverse complement of the nucleotide sequence.

Special methods (inherited)

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__getstate__(/)

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__(/)

Return hash(self).

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__str__(/)

Return str(self).

Details

complement_map[source]#

Return mapping of nucleotide characters to their complements.

Returns:
dict

Mapping of each character to its complement.

Notes

Complements cannot be defined for a generic nucleotide sequence because the complement of A is ambiguous. Thanks, nature…