[Bioperl-l] Two 'host' tags?

Brian Osborne bosborne11 at verizon.net
Fri Jul 6 15:51:11 EDT 2012


Looks like each of your individual sequences has 2 features, but you only care about the 'source' feature (   if ($feat_object->primary_tag eq "source") …).

Also, try not to print out the sequence like you're doing, try to build a Sequence object for each input sequence and then write its contents to your fasta file using write_seq(). You will set the id for your Sequence object using display_name().

Brian O.

On Jul 6, 2012, at 1:56 PM, Jeremy Hayward wrote:

> Hi--  Clueless newbie here, for which apologies.
> I've posted a description of my problem, inputs and outputs, at Gist
> 2816510; https://gist.github.com/2816510
> Briefly, I'm trying to take a genbank file (.gb), and create a FASTA
> file with a specific identifier line for each sequence. Specifically,
> I want the "host" tag as the identifier. With the help of the Bioperl
> beginner readme and the HOWTO's (which are great!) I've worked out how
> to loop through my sequences and get the 'host' tag for each one. For
> some reason, I get two identifier lines for each sequence. I guess the
> problem is in the 'for' loop--it's running the stuff below it twice,
> once with the actual 'host' tag data and once with...nothing? Not
> sure.
> I think I can work out how to use s/ and a regex just to delete the
> second identifier line, but that feels like I'm avoiding the problem
> instead of fixing it. Any help appreciated!
> Many thanks,
> --Jeremy Hayward
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list