<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Perl script to reverse complement a DNA sequence !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence</guid>
	<pubDate>Mon, 01 Oct 2018 08:44:56 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence</link>
	<title><![CDATA[Perl script to reverse complement a DNA sequence !]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl -w

$DNA = &#039;ACGGGAGGACGGGAAAATTACTACGGCATTAGC&#039;;

print &quot;Here is the starting DNA:\n\n&quot;;

print &quot;$DNA\n\n&quot;;

$revcom = reverse $DNA;

$revcom =~ s/A/T/g;
$revcom =~ s/T/A/g;
$revcom =~ s/G/C/g;
$revcom =~ s/C/G/g;

print &quot;Here is the reverse complement DNA: WRONG:\n\n&quot;;

print &quot;$revcom\n&quot;;
print &quot;\nThat was a bad algorithm, and the reverse complement was wrong!\n&quot;;
print &quot;Try again ... \n\n&quot;;

# Make a new copy of the DNA (see why we saved the original?)
$revcom = reverse $DNA;

# See the text for a discussion of tr///
$revcom =~ tr/ACGTacgt/TGCAtgca/;

print &quot;Here is the reverse complement DNA:\n\n&quot;;

print &quot;$revcom\n&quot;;

print &quot;\nThis time it worked!\n\n&quot;;

exit;</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>

</channel>
</rss>