Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Spltting Genbank File

by citromatik (Curate)
on Jun 01, 2009 at 07:28 UTC ( [id://767181]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Spltting Genbank File
in thread Spltting Genbank File

You have several errors and mis-conceptions here:

  • my ($accession) = $chunk =~ /locus\s*([a-z]{8}); You haven't closed the regexp (the final slash is missing): /locus\s*([a-z]{8})/;
  • /biotype: ([a-z]{1});. Same as before
  • open my $ofh, '>' $outfile or die "cannot open $outfile: $!\n";. When you use the 3-argument open, you should provide 3 arguments separated with commas (the comma after '>' is missing)
  • my $outfile = "$accession_$biotype";. You are trying to use the variables $accession and $biotype before declaring them. Bare in mind that both variables are updated after reading each record, so you should update $outfile (and open the file for writing) after reading each record (inside the while loop) as I told you in the code I posted. Also, bear in mind what toolic told you about using ${accession}_$biotype

citromatik

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 17:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found