Exercise 4.5: Difference between revisions

From Earlham CS Department
Jump to navigation Jump to search
Erika (talk | contribs)
New page: Return to Week 1 <b>Exercise 4.5 in <i>Beginning Perl for Bioinformatics</i></b> <br><br> <nowiki>#!/usr/bin/perl -w use strict;</nowiki> <nowiki> #Erika Phelps #Sept. 21, 2009 #Exerc...
 
Erika (talk | contribs)
No edit summary
 
Line 3: Line 3:
<b>Exercise 4.5 in <i>Beginning Perl for Bioinformatics</i></b>
<b>Exercise 4.5 in <i>Beginning Perl for Bioinformatics</i></b>
<br><br>
<br><br>
<nowiki>#!/usr/bin/perl -w
<pre>#!/usr/bin/perl -w
use strict;</nowiki>
use strict;
<nowiki>
 
#Erika Phelps
#Erika Phelps
#Sept. 21, 2009
#Sept. 21, 2009
#Exercise 4-5</nowiki>
#Exercise 4-5


#Sometimes information flows from RNA -> DNA. Write a program to reverse
#Sometimes information flows from RNA -> DNA. Write a program to reverse
Line 32: Line 32:


exit;
exit;
</pre>

Latest revision as of 18:03, 23 September 2009

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;