skbio.sequence.NucleotideMixin#

class skbio.sequence.NucleotideMixin[source]#

Mixin for adding functionality 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

Return the complement of the nucleotide sequence.

gc_content

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

gc_frequency

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

is_reverse_complement

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__

Return self==value.

__ge__

Return self>=value.

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

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…