Question
peptide_mRNA.text ACAAGATGCCATTGTCCCCCGGCCTCCTGCTGCTGCTGCTCTCCGGGGCCACGGCCACCGCTGCCCTGCC CCTGGAGGGTGGCCCCACCGGCCGAGACAGCGAGCATATGCAGGAAGCGGCAGGAATAAGGAAAAGCAGC CTCCTGACTTTCCTCGCTTGGTGGTTTGAGTGGACCTCCCAGGCCAGTGCCGGGCCCCTCATAGGAGAGG AAGCTCGGGAGGTGGCCAGGCGGCAGGAAGGCGCACCCCCCCAGCAATCCGCGCGCCGGGACAGAATGCC CTGCAGGAACTTCTTCTGGAAGACCTTCTCCTCCTGCAAATAAAACCTCACCCATGAATGCTCACGCAAG TTTAATTACAGACCTGAA plainExampleSmall.text GGCAGA PlainSequcenceTest.java import static org.junit.Assert.assertEquals; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import java.io.FileNotFoundException; import java.util.Map; import java.util.HashMap;
peptide_mRNA.text
ACAAGATGCCATTGTCCCCCGGCCTCCTGCTGCTGCTGCTCTCCGGGGCCACGGCCACCGCTGCCCTGCC CCTGGAGGGTGGCCCCACCGGCCGAGACAGCGAGCATATGCAGGAAGCGGCAGGAATAAGGAAAAGCAGC CTCCTGACTTTCCTCGCTTGGTGGTTTGAGTGGACCTCCCAGGCCAGTGCCGGGCCCCTCATAGGAGAGG AAGCTCGGGAGGTGGCCAGGCGGCAGGAAGGCGCACCCCCCCAGCAATCCGCGCGCCGGGACAGAATGCC CTGCAGGAACTTCTTCTGGAAGACCTTCTCCTCCTGCAAATAAAACCTCACCCATGAATGCTCACGCAAG TTTAATTACAGACCTGAA
plainExampleSmall.text
GGCAGA
PlainSequcenceTest.java
import static org.junit.Assert.assertEquals; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import java.io.FileNotFoundException; import java.util.Map; import java.util.HashMap;
public class PlainSequencesTest {
@Test public void testReadSequences() { Sequences tester = new PlainSequences(); String fileName = "peptide_mRNA.text"; try { tester.readSequences(fileName); } catch (FileNotFoundException e) { } assertEquals("after reading file the number of sequences should be 1", 1, tester.getSequences().size()); assertEquals("after reading file the description of sequences at index 0 should be peptide_mRNA.text", "peptide_mRNA.text", tester.getDescriptions().get(0)); } @Test(expected = FileNotFoundException.class) public void testFileNotFoundExceptionIsThrown() throws FileNotFoundException { Sequences tester = new PlainSequences(); String fileName = "noFileHere.txt"; tester.readSequences(fileName); } @Test public void testIsValidSequences() { Sequences tester = new PlainSequences(); String fileName = "peptide_mRNA.text"; try { tester.readSequences(fileName); } catch (FileNotFoundException e) { } assertEquals("the first sequence read should be valid", true, tester.isValidSequence(0)); }
@Test public void formatInGroups() { Sequences tester = new PlainSequences(); String fileName = "peptide_mRNA.text"; String expected = "ACAAGATGCC ATTGTCCCCC GGCCTCCTGC TGCTGCTGCT CTCCGGGGCC ACGGCCACCG " + "CTGCCCTGCC CCTGGAGGGT GGCCCCACCG GCCGAGACAG CGAGCATATG CAGGAAGCGG " + "CAGGAATAAG GAAAAGCAGC CTCCTGACTT TCCTCGCTTG GTGGTTTGAG TGGACCTCCC " + "AGGCCAGTGC CGGGCCCCTC ATAGGAGAGG AAGCTCGGGA GGTGGCCAGG CGGCAGGAAG " + "GCGCACCCCC CCAGCAATCC GCGCGCCGGG ACAGAATGCC CTGCAGGAAC TTCTTCTGGA " + "AGACCTTCTC CTCCTGCAAA TAAAACCTCA CCCATGAATG CTCACGCAAG TTTAATTACA " + "GACCTGAA"; try { tester.readSequences(fileName); } catch (FileNotFoundException e) { } String actual = tester.formatInGroups(0, 10, 6); assertEquals("the string for sequence 0 in goups of 10 bases with 6 groups per line", expected, actual); } @Test public void generateFrequencies() { Sequences tester = new PlainSequences(); String fileNameLarge = "peptide_mRNA.text"; String fileNameSmall = "plainExampleSmall.text"; Map
}
Sequences.java
import java.util.List; import java.util.Map; import java.io.FileNotFoundException;
interface Sequences { public List
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started