[Bioperl-l] problem with SeqIO.pm

Jason Stajich jason@cgt.mc.duke.edu
Mon, 28 Jan 2002 13:51:08 -0500 (EST)


For fasta sequences the data is split into 2 different fields -
display_id and description.
So call the methd
$seq->desc()
and you'll get the rest of what you are expecting.


On Mon, 28 Jan 2002, Simon Chan wrote:

> Hey All,
>
> Let's say I want to parse a FASTA file and I want to fish out all the headers.
> So, if my file looks like this:
>
> > exon_name (Simon's Data - Hand's off!)
> NNNNNNNNNNNNNNNNNNNNNNNN
> NNNNNNNNNNNNNNNNNNNNNNNN
> etc.
>
> The following code only returns to me "exon_name" and not the part in
> brackets.  So, it seems that not the whole header is being returned.
>
> my $input= Bio::SeqIO->newFh(-file => "$input " , -format => "$format");
>
> while (my $info = <$input>){
>
>
>     push (@header, $info->display_id());
>     push (@bases ,$info->seq());
>
> }
>
>
> I read over the doc for this module and did not fine anything helpful.
> The problem can be avoided if you just read in the input via a good
> old fashion <FILEHANDLE>, but I was taught that an efficient
> programmer is also a lazy programmer!  ;-)
>
> Thanks for your time, All.
>
> ##############################
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu