Recherche de tag: revcomp


reverse complement a sequence [Perl]

17.07.2018     jbrunier      revcomp perl 

  a simple reverse complement function
my %C = (  'N' => 'N', 'A' => 'T', 'T' => 'A', 'U' => 'A', 'C' => 'G', 'G' => 'C',
                   'M' => 'K', 'K' => 'M', 'R' => 'Y', 'Y' => 'R', 'W' => 'W', 'S' => 'S',
                   'V' => 'B', 'B' => 'V', 'H' => 'D', 'D' => 'H', 'X' => 'X',
                   'n' => 'n', 'a' => 't', 't' => 'a', 'u' => 'a', 'c' => 'g', 'g' => 'c',
                  'm' => 'k', 'k' => 'm', 'r' => 'y', 'y' => 'r', 'w' => 'w', 's' => 's',
                  'v' => 'b', 'b' => 'v', 'h' => 'd', 'd' => 'h', 'x' => 'x', '-' => '-' );


=head2 RevCompl

 Title   : RevCompl
 Usage   : RevCompl($sequence)
 Function: Reverse complement a sequence
 Example : 
 Returns : the reverse complement sequence
 Args    : $sequence	the sequence to reverse complement
 Notes   : 
 
=cut
sub RevCompl {
    join( '', map { $C{$_} } reverse( split( '', shift @_ ) ) );
}
0/5 - [0 rating]