Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-11-28 16:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls