TabularMSA.
extend
(sequences, minter=None, index=None)[source]¶Extend this MSA with sequences without recomputing alignment.
State: Experimental as of 0.4.1.
Parameters: | sequences : iterable of GrammaredSequence
minter : callable or metadata key, optional
index : pd.Index consumable, optional
|
---|---|
Raises: | ValueError
ValueError
ValueError
TypeError
TypeError
ValueError
|
See also
Notes
If neither minter nor index are provided and this MSA has default index labels, the new index labels will be auto-incremented.
The MSA is not automatically re-aligned when appending sequences. Therefore, this operation is not necessarily meaningful on its own.
Examples
>>> from skbio import DNA, TabularMSA
>>> msa = TabularMSA([DNA('ACGT')])
>>> msa
TabularMSA[DNA]
---------------------
Stats:
sequence count: 1
position count: 4
---------------------
ACGT
>>> msa.extend([DNA('AG-T'), DNA('-G-T')])
>>> msa
TabularMSA[DNA]
---------------------
Stats:
sequence count: 3
position count: 4
---------------------
ACGT
AG-T
-G-T
Auto-incrementing index labels:
>>> msa.index
Int64Index([0, 1, 2], dtype='int64')
>>> msa.extend([DNA('ACGA'), DNA('AC-T'), DNA('----')])
>>> msa.index
Int64Index([0, 1, 2, 3, 4, 5], dtype='int64')