-
Creat an Eclipse Java project in your student folder named
HW1_DNA
and create
a class named Main
.
Add a function to our DNA program we developed in class that computes the
molecular weight of a strand of DNA. The molecular weight of Adenine is
135.128 grams/mol, Cytosine is 111.103 grams/mol, Guanine
is 151.128 grams/mol, and Thymine is 125.107 grams/mol.
/**
* Compute the molecular weight of a strand of DNA.
* @param dna: A string of ACGT in any case and no other characters.
* @return The molcular weight of the strand.
*/
public static double weight(String dna) {
...
}
-
Write a function that returns the character code of the nucleotide
that occurs most frequently. Use the function template below:
/**
* Compute which nucleotide occurs most frequently in a DNA strand.
* @param dna: A string of ACGT in any case and no other characters.
* @return The character code of the nucleotide that occurs the most..
*/
public static char max(String dna) {
...
}
-
Write a function that reverses a DNA strand.
/**
* Reverse a DNA strand.
* @param dna: A string of ACGT in any case and no other characters.
* @return The reverse of the dna parameter.
*/
public static String reverse(String dna) {
...
}
-
Its often important to compute the reverse complement
of a strand of DNA.
Write a function to do this (hint, its trivial given that we already
have functions for reverse and complement).
/**
* Compute the reverse complement of a DNA strand.
* @param dna: A string of ACGT in any case and no other characters.
* @return The reverse complement of dna.
*/
public static String reverseComplement(String dna) {
...
}
- Have your program print the molecular weight of the
H1N1 DNA strand in the
H1N1.fasta
file as well
as print the nucleotide that occurs most frequently.
-
Make sure your program is on the
T:
drive by the start of class Tuesday
September 8 in a folder named HW1_DNA
. Also turn in a printout. Make
sure there are no bad line breaks in the printout and that methods are commented.