我很难使用Biopython SeqIO (变成类似于http://www.ncbi.nlm.nih.gov/nuccore/CP003206的东西)创建一个genbank平面文件,我能够通过以下操作创建一个genbank
simple_seq = Seq(row[15],IUPAC.unambiguous_dna)
simple_seq_r = SeqRecord(simple_seq)
simple_seq_r.id=row[0]
simple_seq_r.description= 'hello'
SeqIO.write([seqrecord],'out.gbk', "gb")但是我无法写入以下字段,因为seqrecord没有这些字段:关键字来源
DBLINK生物
特性
位置/限定符
你知道怎么做吗?谢谢
发布于 2014-03-22 14:08:24
SeqRecord类应该具有以下属性中的这些字段:
有关更多信息,您可以阅读SeqRecord类wiki:http://biopython.org/wiki/SeqRecord和SeqFeature参考页面:http://biopython.org/DIST/docs/api/Bio.SeqFeature.SeqFeature-class.html
您可以做的另一件事是保存您提供的这个genbank文件并用SeqIO读取它,然后使用dir()查看您可以使用的实际属性,对于存储为字典的属性,查看键是有用的。类似这样的内容(其中my_file.gbk包含您提供的文件的子序列):
my_record = SeqIO.read('my_file.gbk', 'gb')
print "DBXREFS: ", my_record.dbxrefs
print "ANNOTATIONS: ", my_record.annotations.keys()
print "FEATURES: ", my_record.features将向您提供有关您提供的文件的更多信息:
DBXREFS: ['BioProject:PRJNA42399 BioSample:SAMN02603066']
ANNOTATIONS: ['comment', 'sequence_version', 'source', 'taxonomy', 'keywords', 'references', 'accessions', 'data_file_division', 'date', 'organism', 'gi']
FEATURES: [SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1001), strand=1), type='source'), SeqFeature(FeatureLocation(BeforePosition(0), ExactPosition(471), strand=1), type='gene'), SeqFeature(FeatureLocation(BeforePosition(0), ExactPosition(471), strand=1), type='CDS')]https://stackoverflow.com/questions/19919574
复制相似问题