Skip to content
Snippets Groups Projects
Commit 799274db authored by Graham McVicker's avatar Graham McVicker
Browse files

moved reverse_comp function into its own utility module

parent 3c2b7d36
No related branches found
No related tags found
No related merge requests found
# EnsEMBL module for Bio::EnsEMBL::Utils::Sequence
#
#
=head1 NAME
Bio::EnsEMBL::Utils::Sequence - Utility functions for sequences
=head1 SYNOPSIS
use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
my $seq = 'ACTTTAAAGGCTATCCCAATATG';
print "my sequence = $seq\n";
reverse_comp(\$seq);
print "my reverse comp = $seq\n";
=head1 METHODS
=cut
use strict;
use warnings;
package Bio::EnsEMBL::Utils::Sequence;
use Exporter;
use vars qw(@ISA @EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT_OK = qw(&reverse_comp);
=head2 reverse_comp
Arg [1] : reference to a string $seqref
Example : use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
$seq = 'ACCTGAA';
reverse_comp(\$seq);
print $seq;
Description: Does an in place reverse compliment of a passed in string
reference. The string is passed by reference
rather than by value for memory efficiency.
Returntype : none
Exceptions : none
Caller : SequenceAdaptor, SliceAdaptor
=cut
sub reverse_comp {
my $seqref = shift;
$$seqref = reverse( $$seqref );
$$seqref =~
tr/acgtrymkswhbvdnxACGTRYMKSWHBVDNX/tgcayrkmswdvbhnxTGCAYRKMSWDVBHNX/;
return;
}
1;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment