This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Remove All Hypothetical Protein From Genbank File

Hi everyone after annotation one of sample genome i want to remove all hypothetical protein from genbank file. Can anyone give me any idea how to do simplest way ? Thank you advance.

genbank perl

It would help to see which part of the file (field) contains the annotation and an example.

Do you need to keep the GenBank format? Maybe you can simply convert the GBK to Fasta and filter the sequences by description in the fasta comment line.

2 answers

You don't need BioPerl / BioPython for this. If you know how many lines your annotation takes up (assuming its fixed) - then you can do something like this from the command line in Linux

sed 's/(\s{5}ANNOTATION_NAME\s+.+?\n)(.+?\n){NUMBEROFLINESTOREMOVE}//g' GENBANKFILE.gbk > NEWGENBANKFILE.gbk

Least - that's what worked for me when I ran into this issue.

Log in to answer this question.