Created
September 28, 2012 15:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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