Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: fasta file

by PrincePerl (Novice)
on Sep 29, 2011 at 20:29 UTC ( #928662=note: print w/ replies, xml ) Need Help??


in reply to Re: fasta file
in thread fasta file

Hello BrowerUk, I really appreicate the feedback, I was doing the wrong thing all along by not looking through the code. i finally figured it out. This was my revised code. Thanks again.

#!/usr/bin/perl -w use strict; my $filename; my $accession_id; my %accession; my $gene_Name; print "Please enter in the filename: "; chomp($filename = <STDIN>); print "Please enter in the accession_ID: "; chomp($accession_id = <STDIN>); open(FILENAME, $filename) or die "cannot open file: $! "; while($_ = <FILENAME>) { if ($_ =~ />gi/) { $gene_Name = $_; } else { } $accession{$gene_Name} .= $_; } foreach $gene_Name (keys %accession) { if ($gene_Name =~ /$accession_id/i) { print "$accession{$gene_Name}\n"; } }


Comment on Re^2: fasta file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928662]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-09-01 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls