[Bioperl-l] genbank to cds

Juan Carlos Sánchez Ferrero jcsanchez at cib.csic.es
Wed Sep 29 05:24:08 EDT 2004


Changing -fh => *STDIN to -fh => *ARGV didn't work and got the same error
but the suggestion made by Thomas did work

And just a comment
actually comparing the resulting files of using each
*STDIN
 and \*STDIN
they are the same, even if an error comes out when using *STDIN.....

Thanks to all!!


Con fecha 28/9/2004, "Thomas J Keller" <kellert at ohsu.edu> escribió:

>Hoorah, a question I can help with. (I've gotten so much help from this
>list, I want to be able to contribute).
>
>Try passing a reference to the glob, instead of the glob itself: i.e.
>change
>> -fh => *STDIN
>to
>    -fh => \*STDIN
>
>regards,
>Tom Keller
>
>Tom Keller, Ph.D.
>http://www.ohsu.edu/research/core
>kellert at ohsu.edu
>503-494-2442
>
>On Sep 28, 2004, at 8:07 AM, rmaps005 at cib.csic.es wrote:
>
>> hello,
>> i was using this program to covert genbank file (actually a human
>> chromosome) to cds but even if it does work and generate some cds,
>> always comes out with this error:
>>
>> Argument "*main::STDIN" isn't numeric in numeric eq (==) at
>> /usr/lib/perl5/site_perl/5.8.3/Bio/Root/IO.pm line 483.
>>
>> don't know if it is because runs out of memory or i made a mistake....
>> can somebody help me with this?
>>
>> Thanks
>>
>> $seqin = Bio::SeqIO->new( '-format' => 'GenBank', -fh => *STDIN);
>> while((my $seqobj = $seqin->next_seq()))
>> {
>>     $genomic_id = $seqobj->display_id;
>>     foreach $feat ( $seqobj->top_SeqFeatures() ) {
>>         $length = $seqobj->length;
>>         if ($feat->primary_tag eq "CDS"){
>>             # Check if protein_id tag exists.
>>             if (join(" ",$feat->all_tags()) =~ m/db\_xref/){
>>                 $protein_id =
>> join("",$feat->each_tag_value('db_xref'));
>>             }
>>             else {
>>                 $protein_id = "UNKNOWN";
>>             }
>>             $cds = $feat->location->to_FTstring;
>>             if ($cds =~ m/complement/){
>>                 $strand = "-";
>>             }
>>             else {
>>                 $strand = "+";
>>             }
>>             $cds =~ s/\.\.|,|join\(|\)|complement\(|\(/ /g;
>>             print ("$genomic_id\_$protein_id $length $strand  $cds
>> \n");
>>         }
>>     }
>> }
>>
>>
>> IlohaCIB
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at portal.open-bio.org
>> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>

IlohaCIB



More information about the Bioperl-l mailing list