用于制作和跟踪dna组件的突变拷贝的python库
co的Python项目详细描述
一氧化碳
co是一个用于更改带注释的dna序列的python库。它跟踪部件和升降机 当一个组件通过应用一系列的变异而“变异”时,超过了特征注释。使用co您可以 为克隆生物建立新的一致性序列,并跟踪一个谱系内特征的变化。
有关详细信息,请查看Documentation。
你好,CO!
>>> from co import Component >>> from co.mutation import * >>> hello = Component('Hello X!') >>> hello.seq Seq('Hello X!', Alphabet()) >>> hello_world = hello.mutate([Mutation(6, 1, 'world')]) >>> hello_world.seq Seq('Hello world!', Alphabet())
使用功能注释
组件是根据Biopython的SeqRecord建模的,它们既有序列,又有特性:
>>>fromBio.SeqFeatureimport*>>>slogan=Component('CoPy is for DNA components',features=[...SeqFeature(FeatureLocation(0,4),type='name'),...SeqFeature(FeatureLocation(12,15),id='DNA')])>>>>>># features are bound to components -- and you can always access their DNA sequence...>>>slogan.features.add(FeatureLocation(16,26)).seqSeq('components',Alphabet())>>>[f.seqforfinslogan.features][Seq('CoPy',Alphabet()),Seq('DNA',Alphabet()),Seq('components',Alphabet())]>>>>>># New Components are made through series of mutations...# You not only get the new sequence but a mutated component: Features are translated to the...# new sequence as well....>>>new_slogan=slogan.mutate([DEL(2,2),DEL(12,4)])>>>new_slogan.seqSeq('Co is for components',Alphabet())>>>new_slogan.featuresComponentFeatureSet([Feature(FeatureLocation(ExactPosition(0),ExactPosition(2)),type='name'),Feature(FeatureLocation(ExactPosition(10),ExactPosition(20)))])>>>[f.seqforfinnew_slogan.features][Seq('Co',Alphabet()),Seq('components',Alphabet())]>>>list(new_slogan.features.find(type='name'))# features can be filtered by type, id, strand, position, and qualifiers[Feature(FeatureLocation(ExactPosition(0),ExactPosition(2)),type='name')]>>>>>># Using Component.fdiff you can get a summary of what features where affected by mutation. (Unchanged features...# that have a new coordinate -- e.g. the 'components' feature in this example -- are not included)....>>>slogan.fdiff(new_slogan)Diff(added=(Feature(FeatureLocation(ExactPosition(12),ExactPosition(15)),id='DNA'),Feature(FeatureLocation(ExactPosition(0),ExactPosition(4)),type='name')),removed=(Feature(FeatureLocation(ExactPosition(0),ExactPosition(2)),type='name'),))