skbio.core.sequence.BiologicalSequence.degap

BiologicalSequence.degap()[source]

Returns a new BiologicalSequence with gaps characters removed.

Returns:

BiologicalSequence

A new BiologicalSequence with all characters from self.gap_alphabet filtered from the sequence.

Notes

The type, id, and description of the result will be the same as self.

Examples

>>> from skbio.core.sequence import BiologicalSequence
>>> s = BiologicalSequence('GGUC-C--ACGTT-C.')
>>> t = s.degap()
>>> t
<BiologicalSequence: GGUCCACGTT... (length: 11)>
>>> print t
GGUCCACGTTC