Return a case-sensitive string representation of the sequence.

State: Stable as of 0.4.0.


lowercase (str or boolean vector) – If lowercase is a boolean vector, it is used to set sequence characters to lowercase in the output string. True values in the boolean vector correspond to lowercase characters. If lowercase is a str, it is treated like a key into the positional metadata, pointing to a column which must be a boolean vector. That boolean vector is then used as described previously.


String representation of sequence with specified characters set to lowercase.

Return type



>>> from skbio import Sequence
>>> s = Sequence('ACGT')
>>> s.lowercase([True, True, False, False])
>>> s = Sequence('ACGT',
...              positional_metadata={
...                 'exons': [True, False, False, True]})
>>> s.lowercase('exons')

Constructor automatically populates a column in positional metadata when the lowercase keyword argument is provided with a column name:

>>> s = Sequence('ACgt', lowercase='introns')
>>> s.lowercase('introns')
>>> s = Sequence('ACGT', lowercase='introns')
>>> s.lowercase('introns')