skbio.alignment.Alignment.degap

Alignment.degap()[source]

Return a new SequenceCollection with all gap characters removed.

Returns:

SequenceCollection

A new SequenceCollection where skbio.sequence.BiologicalSequence.degap has been called on each sequence.

Examples

>>> from skbio.alignment import SequenceCollection
>>> from skbio.sequence import DNA
>>> sequences = [DNA('A--CCGT.', id="seq1"),
...              DNA('.AACCG-GT.', id="seq2")]
>>> s1 = SequenceCollection(sequences)
>>> s2 = s1.degap()
>>> s2
<SequenceCollection: n=2; mean +/- std length=6.00 +/- 1.00>