Biotech > FAQ > BioPerl FAQ (Frequently Asked Questions)

How do I get the reverse-complement of a sequenc...

To see other biotech frequently asked questions, please visit http://biotech.fyicenter.com/faq/

(Continued from previous question...)

How do I get the reverse-complement of a sequence using the subseq method?

One way is to pass the location to subseq in the form of a Bio::LocationI object. This object holds strand information as well as coordinates.

use Bio::Location::Simple;
my $location = Bio::Location::Simple->new(-start  => $start,
                                          -end   => $end,
                                          -strand => "-1");
# assume we already have a sequence object
my $rev_comp_substr = $seq_obj->subseq($location);

(Continued on next question...)

Other Frequently Asked Questions