This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Change Scaffold Orientation

There is a genome in unoriented and unorder scaffolds. I am interested in a specific area of the genome. Therefore I managed to align the scaffolds to a closely related species and I got an idea about the orientation of the scaffolds.

Do you know any way to change the orientation inside the genbank file of those scaffolds? In order to upload it later to a genome viewer such as Artemis?

Any help please. Thanks a lot.

eg. is there any way to merge the scaffolds and add one CDS next to the other, in the correct way? In biopython?

genbank scaffolding

yes i tried mauve, this is the one which I used to align the scaffolds. But then I need the .gbk file to upload it the genome browser. The mauve does not seem to output a gbk file or simiar. Any idea for that?

2 answers

In Biopython, something like this should work

from Bio import SeqIO
my_record = SeqIO.read("input.gbk", "genbank")
reversed_record = my_record.reverse_complement(id="new_id", ...)
SeqIO.write(reversed_record, "output.gbk", "genbank")

The tricky part is deciding which of the annotations like name etc should be kept or replaced.

this works fine, thanks a lot.

You could try Pagit from the Sanger institute. It contains a program called abacas that does contig ordering using mummer and gives you a fasta file of the ordered scaffolds and a genbank like feature table of how the contigs were ordered.

Thank you for the answer. I will try it out. Do you know if there is any tool that reverses the order of the feature coordinates in a gbk file? Is that doable in biopython?

My guess is it is doable in biopython, how easy it will be to do is another matter. I've never delved into the features/annotations API that much, so I really don't know

Log in to answer this question.