skbio.alignment.Alignment.is_valid

Alignment.is_valid()[source]

Return True if the SequenceCollection is valid

Returns:

bool

True if self is valid, and False otherwise.

See also

skbio.alignment.BiologicalSequence.is_valid

Notes

Validity is defined as having no sequences containing characters outside of their valid character sets.

Examples

>>> from skbio.alignment import SequenceCollection
>>> from skbio.sequence import DNA, RNA
>>> sequences = [DNA('ACCGT', id="seq1"),
...              DNA('AACCGGT', id="seq2")]
>>> s1 = SequenceCollection(sequences)
>>> print(s1.is_valid())
True
>>> sequences = [RNA('ACCGT', id="seq1"),
...              RNA('AACCGGT', id="seq2")]
>>> s1 = SequenceCollection(sequences)
>>> print(s1.is_valid())
False