[Bioperl-l] genbank to cds
Jason Stajich
jason.stajich at duke.edu
Wed Sep 29 15:36:47 EDT 2004
On Sep 29, 2004, at 5:24 AM, Juan Carlos Sánchez Ferrero wrote:
> Changing -fh => *STDIN to -fh => *ARGV didn't work and got the same
> error
> but the suggestion made by Thomas did work
>
Of course not, you didn't escape the glob.
Pass in \*ARGV or \*STDIN NOT *ARGV or *STDIN.
The whole point of this is to make this WARNING go away which is just
some code checking to see that you aren't trying to close the
STDIN,STDOUT, or STDERR handles.
>>> Argument "*main::STDIN" isn't numeric in numeric eq (==) at
>>> /usr/lib/perl5/site_perl/5.8.3/Bio/Root/IO.pm line 483.
> 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.....
>
yep - perl is pretty permissive and does the right thing anyways.
> 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
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/
More information about the Bioperl-l
mailing list