Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: Spltting Genbank File

by citromatik (Curate)
on Jun 01, 2009 at 07:28 UTC ( #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


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://767181]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-02-20 04:42 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (267 votes). Check out past polls.