[Bioperl-l] genbank to cds

rmaps005 at cib.csic.es rmaps005 at cib.csic.es
Tue Sep 28 11:07:07 EDT 2004


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



More information about the Bioperl-l mailing list