Skip to content

GenBank output mode leaves trailing whitespace that breaks compatiliity with certain tools #54

Description

@JamieHeather

I received an issue by email from Gabriel Ouellet Lavallée, regarding the .gb output modes not being compatible with Unipro Ugene:

The .gb file would not open, giving an error for truncated sequence. It was caused by an empty line inserted after the DNA sequence and before the // marking the end of the sequence. The .gb file opens fine when this line is removed with a text editor.

I found where this NCBI formatting is written in stitchrfunctions.py and modified :

" dna_text +=' '.join([num_pad(pos, pad_len)] + line) + '\n' "
to
" dna_text += '\n' + ' '.join([num_pad(pos, pad_len)] + line) "

This way it only creates a new line if there is still sequence to write, not systematically after a line of sequence. There is no more empty line between DNA sequence and //.

It seems the two tools I use to check .gb files (Snapgene and ApE) both tolerate this extra whitespace, so I'd never have caught this error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions