[Bioperl-l] Extracting gi no from refseq record

Jason Stajich jason at cgt.mc.duke.edu
Thu Apr 3 16:07:59 EST 2003


For FASTA it is easy from the blast db downloads.

while( my $seq = $seqio->next_seq ) {
 my $id = $seq->display_id;
 if( $id =~ /gi\|(\d+)\|/ ) {
   my $gi = $1;
   print "gi is $gi for $id\n";
 }
}

On Thu, 3 Apr 2003, Siddhartha Basu wrote:

> Hi,
> Is there is any method call to get that line somehow.
> Or is it possible to get that via the fasta version of that file.
>
> Any suggestions.
>
> siddhartha
>
> Jason Stajich wrote:
> > It should have been in $seq->primary_id() - but we only pick up GI from
> > the field here, I assume the file in question has this line?
> >
> > I notice we don't try and parse NID lines from Genbank.
> >
> > VERSION     AI129902.1  GI:3598416
>

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


More information about the Bioperl-l mailing list