Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: fasta file

by pvaldes (Chaplain)
on Sep 27, 2011 at 08:59 UTC ( #928050=note: print w/ replies, xml ) Need Help??


in reply to fasta file

You could also wrote this

if(/^>/) {

instead this:

if($_ =~ />/) {

That's a little more precise for your case probably

personally I prefer this more compact form also, but this is a matter of style only

if(/^>/) {$seq = $_} else {$accession{$seq} .= $_}
if you want in any case to write the same like this, I suggest that you consider indent your code
if($_ =~ />/) { $seq = $_; } else { $accession{$seq} .= $_; }

AND last but not least, don't try to reinvent the wheel, I strongly suggest you to take a look to the bioperl modules, specially the modules related with managing fasta files


Comment on Re: fasta file
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2015-07-28 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls