[Bioperl-l] clone ID to Accession ID genbank

Iris Buiton irisbuiton at gmail.com
Thu Feb 4 11:06:25 EST 2010

Hi members of Bioperl,

I am trying to run some code that given a clone ID (for instance,
CH255-149A8) get the accesion ID (AC238489.2).

The problem is that using this ID, it works perfectly, but using this
other ID (CH251-558O8) I do not get anything (not $seq object is
obtained). Checking to Genbank, this clone exist, there is seqeunce,
and the accession ID should be AC147515.1

This is the code:

 my $name_file="CH251-558O8";

  my $query = Bio::DB::Query::GenBank->new
        (-query   => $name_file,
         -reldate => '30',
     -db      => 'nucleotide');
    #eval 'my $seqio = $gb->get_Stream_by_query($query)';
    print $query->count,"\n";

    my $gb = Bio::DB::GenBank->new();

    my $seqio = $gb->get_Stream_by_query($query);

    print "Running $name_file.....\n";

    while( my $seq =  $seqio->next_seq ) {
      if ($seq->accession_number)
      print "$name_file = ", $seq->accession_number," = ", $seq-
>length,"\n" ;
      print "$name_file = #N/A \n" ;

Any ideas what am I doing wrong?



More information about the Bioperl-l mailing list