BioPython load/save from SnapGene
1
0
Entering edit mode
13 days ago
tada • 0

I saved some single stranded sequences created in SnapGene in embl format. They load in bioPython but they don't save. The error is:

  File "c:\a\diy\pythonProjects\DNAPrinting\.venv\lib\site-packages\Bio\SeqIO\InsdcIO.py", line 1271, in _write_the_first_lines
    raise ValueError("missing molecule_type in annotations")
ValueError: missing molecule_type in annotations

It seems that the current code does not support the file generated from SnapGene that uses ss-DNA as molecule type. That is: ID ; SV ; linear; ss-DNA; STD; SYN; 48 BP

Any way to add ss-DNA in addition to plain DNA to the save feature to support SnapGene format.

biopython • 397 views
ADD COMMENT
0
Entering edit mode
13 days ago
Mensur Dlakic ★ 28k

Any way to add ss-DNA in addition to plain DNA to the save feature to support SnapGene format.

You could open the file c:\a\diy\pythonProjects\DNAPrinting\.venv\lib\site-packages\Bio\SeqIO\InsdcIO.py and manually add a piece of code that will recognize ss-DNA. I do not recommend that unless you know what you are doing.

If you open the EMBL file in a text editor, you can manually change ss-DNA to DNA and that will probably do the trick. Alternatively, you can do it with perl or sed if they are installed on your computer.

perl -pi -e 's/ss-DNA\;/DNA\;/g' embl.file

or

sed -i 's/ss-DNA\;/DNA\;/g' embl.file
ADD COMMENT
0
Entering edit mode

Strand handling is very poor and the strand information usually gets lost during save load operations. I'm not talking only about the record but the associated features because each feature also has a strand attribute. Normally the features are only on one strand but bidirectional features and non directional features are saved the same way as 5 to 3 features. So only the 3 to five features are can be saved and reloaded correctly as far as I'm concerned in both .embl and .gb formats.The Snapgene gb can save the strand info and has some other things like colors and extra strand info but I don't think bioPython supports it for load or save.

ADD REPLY

Login before adding your answer.

Traffic: 2267 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6