Exercise 4.5

From Earlham CS Department
Jump to navigation Jump to search

Return to Week 1

Exercise 4.5 in Beginning Perl for Bioinformatics

#!/usr/bin/perl -w
use strict;

#Erika Phelps
#Sept. 21, 2009
#Exercise 4-5

#Sometimes information flows from RNA -> DNA. Write a program to reverse
#transcribe RNA to DNA.

#The RNA

my $RNA = 'AGUCAGUCCUGACUGA';

print "\nHere is the starting RNA:\n\n$RNA.\n\n";

#Reverse transcribe into DNA

my $DNA = $RNA;

    $DNA =~ s/U/T/g;

#Print the DNA to the screen

print "Here is the result of reverse transcribing RNA to DNA:\n\n";

print "$DNA.\n\n";

exit;