Skip to content

Instantly share code, notes, and snippets.

@sashaphanes
Created September 28, 2012 15:19
Show Gist options
  • Save sashaphanes/3800477 to your computer and use it in GitHub Desktop.
Save sashaphanes/3800477 to your computer and use it in GitHub Desktop.
Get user to specify sequence file and print out orginal strand sequence and reverse complementary DNA and RNA
#!/usr/bin/perl
use strict;
use warnings;
print "Which file would you like to use?\n";
my $DNAfilename = <>;
open(DNAfile, $DNAfilename);
my $DNA1 = <DNAfile>;
close DNAfile;
my $rev = reverse($DNA1);
my $DNA2 = $DNA1;
$DNA2 =~ tr /atcgATCG/tagcTAGC/;
my $RNA = $rev;
$RNA =~ tr /tT/uU/;
print "Original strand in 5' to 3' direction:\n", "$DNA1\n\n",
"Reverse DNA complement:\n", "$rev\n\n",
"Reverse RNA complement:\n", "$RNA\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment