simple_seq_r.description ="this is a test!"
simple_seq_r.description
'this is a test!'
simple_seq_r.seq
Seq('GATCGATC', Alphabet())
#SeqRecord 有一个annotation属性,会以字典的形式记录注释信息
simple_seq_r.annotations["evidence"]="None. I just make it up"print(simple_seq_r.annotations)print("===========")print(simple_seq_r.annotations["evidence"])
{'evidence': 'None. I just make it up'}
===========
None. I just make it up
SeqRecord object from Fasta files
#SeqRecord object from Fasta filesfrom Bio import SeqIO
record = SeqIO.read("NC_005816.fna","fasta")
record.id
SeqRecord object from GenBank files
#SeqRecord object from GenBank files
record = SeqIO.read("NC_005816.gb","genbank")
record
record.seq