in reply to Re: Create the reverse complement DNA sequence without pattern matching and reverse built-in function?
in thread Create the reverse complement DNA sequence without pattern matching and reverse built-in function?
Another similar approach, for illustration purposes:
perl -Mstrict -Mwarnings -le 'my $seq=q{ACGGGAGGACGGGAAAATTACTACGGCATTAGC}; my $complement; my %rc = ( A => q{T}, T => q{A}, C => q{G}, G => q{C}, ); my @letters = split //, $seq; while ( @letters ) { my $l = uc pop @letters; $complement .= $rc{$l}; } print $seq; print $complement;'
Hope that helps.
|
|---|