skbio.alignment.TabularMSA.from_dict¶
- classmethod TabularMSA.from_dict(dictionary)[源代码]¶
创建一个
TabularMSA
从Adict
.状态:从0.4.1开始试验。
- 参数:
dictionary (dict) -- 字典将键映射到
GrammaredSequence
序列对象。这个TabularMSA
对象的索引标签将设置为字典中的键。- 返回:
TabularMSA
从中的键和序列构造的对象 dictionary .- 返回类型:
备注
结果中的序列和索引标签的顺序
TabularMSA
对象是任意的。使用TabularMSA.sort
设置不同的顺序。示例
>>> from skbio import DNA, TabularMSA >>> seqs = {'a': DNA('ACGT'), 'b': DNA('A--T')} >>> msa = TabularMSA.from_dict(seqs) >>> msa.shape Shape(sequence=2, position=4) >>> 'a' in msa True >>> 'b' in msa True