Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Analyse an array and join only some elements of it

by jwkrahn (Monsignor)
on Jun 15, 2012 at 14:30 UTC ( #976438=note: print w/replies, xml ) Need Help??


in reply to Analyse an array and join only some elements of it

It sounds like you need something like this:

my ( $fasta, $valid, $invalid ); while ( <STDIN> ) { tr/ATCGatcg//cd; next unless /[ATCGatcg]/; if ( length % 3 ) { $invalid++; next; } $valid++; $fasta .= $_; } print LOGFILE "Found ", $valid + $invalid, " blocks, joined $valid of +them and left out $invalid.\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-09-30 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (562 votes). Check out past polls.