skbio.core.sequence.DNASequence.count

DNASequence.count(subsequence)[source]

Returns the number of occurences of subsequence.

Parameters:

subsequence : str

The subsequence to count occurences of.

Returns:

int

The number of occurrences of substring in the BiologicalSequence.

Examples

>>> from skbio.core.sequence import BiologicalSequence
>>> s = BiologicalSequence('GGUC')
>>> s.count('G')
2