Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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";


Comment on Re: Analyse an array and join only some elements of it
Download Code

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 wandering the Monastery: (5)
As of 2015-07-06 08:51 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 (70 votes), past polls