Not recommended for production:
use strict; use warnings; my $seq='ACGGGAGGACGGGAAAATTACTACGGCATTAGC'; my $rev=''; my $n = length $seq; while( $n-- ){ $rev .= $_ for map chr($_&2?$_^4:$ +_^21), ord substr $seq, $n, 1 } print "$seq\n$rev\n";
Something reminds me of Black Jack...
Update: ...or:
use strict; use warnings; my $seq='ACGGGAGGACGGGAAAATTACTACGGCATTAGC'; my $rev=''; $rev = "$_$rev" for map chr($_&2?$_^4:$_^21), map ord, split//,$seq; print "$seq\n$rev\n";
In reply to Re: Create the reverse complement DNA sequence without pattern matching and reverse built-in function?
by hdb
in thread Create the reverse complement DNA sequence without pattern matching and reverse built-in function?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |