TabularMSA.
append
(sequence, minter=None, index=None)[source]¶Append a sequence to the MSA without recomputing alignment.
State: Experimental as of 0.4.1.
Parameters: | sequence : GrammaredSequence
minter : callable or metadata key, optional
index : object, optional
|
---|---|
Raises: | 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 label will be auto-incremented.
The MSA is not automatically re-aligned when a sequence is appended. 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.append(DNA('AG-T'))
>>> msa
TabularMSA[DNA]
---------------------
Stats:
sequence count: 2
position count: 4
---------------------
ACGT
AG-T
Auto-incrementing index labels:
>>> msa.index
Int64Index([0, 1], dtype='int64')
>>> msa.append(DNA('ACGA'))
>>> msa.index
Int64Index([0, 1, 2], dtype='int64')