Question: How to write a Genbank Reference with Biopythons SeqIO?
0
gravatar for Mathis DKZ
6 weeks ago by
Mathis DKZ10
Germany
Mathis DKZ10 wrote:

Hello,

I'm trying to create a Genbank file with the SeqIO Feature of Biopython. I am able to parse references of existing files with:

for seq_record in SeqIO.parse("example.gb","genbank"):
        print(seq_record.annotations['references'][0])

But somehow I'm not able to create a new Reference. I tried:

from Bio.SeqFeature import Reference  

ref = Reference(authors='test',title='Testtest')
#seq_record.annotations['references].append(ref)

I always get the Error : TypeError: __init__() got an unexpected keyword argument 'authors' So it seems that Reference() doesn't recognize the keywords, even if they are featured in the documentation.

I wasn't able to find a Solution until now.

seqio genbank biopython python • 128 views
ADD COMMENTlink modified 6 weeks ago by Asaf5.5k • written 6 weeks ago by Mathis DKZ10
2
gravatar for Asaf
6 weeks ago by
Asaf5.5k
Israel
Asaf5.5k wrote:

The Reference __init__ method doesn't accept arguments, you should set the parameters afterwards: from Bio.SeqFeature import Reference

ref = Reference()
ref.authors='test'
ref.title='Testtest'
ADD COMMENTlink written 6 weeks ago by Asaf5.5k

This works. Thank you!

ADD REPLYlink written 6 weeks ago by Mathis DKZ10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 697 users visited in the last hour