This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ask For A Script To Carry Out Reverse Complement Of Dna Sequence

ask for a script to carry out reverse complement of DNA sequence ! thanks!

dna sequence

Please do a proper search within the forum site

This is a great example of a lazy question with no evidence of an attempt to solve the problem yourself. If down-votes were still implemented at this site, it would get them.

In the absence of downvotes, any reason why we shouldn't just delete this question?

Good point. No.

testing the new post closing feature

same here, testing the comment-before-closing feature

So: this question would be/has been closed because in my opinion (1) the problem is common with a trivial, easily-found solution and (2) the user has made no attempt to find the solution themselves and is simply asking someone else to do their work for them.

These comments then serve as a record as to why the question was closed.

Simple hey :)

copy the following code to rcdna.pl
then use:
perl rcdna.pl ATCG
the script will return: TAGC

#!/usr/bin/perl

use strict;
my $dna=shift @ARGV;
my $rcdna= & reverse_complement_IUPAC($dna);
print "$rcdna\n";

sub reverse_complement_IUPAC {
        my $dna = shift;

        # reverse the DNA sequence
        my $revcomp = reverse($dna);

        # complement the reversed DNA sequence
        $revcomp =~ tr/ABCDGHMNRSTUVWXYabcdghmnrstuvwxy/TVGHCDKNYSAABWXRtvghcdknysaabwxr/;
        return $revcomp;
}

0 answers

No answers yet.

Log in to answer this question.