@AfterClass public void close() throws IOException { bimfd.close(); famfd.close(); pedfd.close(); mapfd.close(); tpedfd.close(); }
@Test public void MAP_writer() throws Exception { File newMap = new File(testMap.getAbsolutePath().replace(testMap.getName(), "new.map")); MapFileWriter w = new MapFileWriter(newMap); try { w.writeAll(mapfd.getAllEntries()); boolean filesAreEqual = DirectoryCompare.compareFileContent(testMap, newMap); assertTrue(filesAreEqual); } finally { w.close(); } }
@Test public void MAP_getEntries() throws Exception { assertEquals(1, mapfd.getEntries(0, 1).size()); assertEquals(1, mapfd.getEntries(1, 2).size()); assertEquals(2, mapfd.getEntries(0, 2).size()); assertEquals(2, mapfd.getAllEntries().size()); assertEquals("snp1", mapfd.getEntries(0, 1).get(0).getSNP()); assertEquals(0.0, mapfd.getEntries(1, 2).get(0).getcM()); assertEquals("1", mapfd.getEntries(1, 2).get(0).getChromosome()); assertEquals(1, mapfd.getAllEntries().get(0).getBpPos()); assertEquals(2, mapfd.getAllEntries().get(1).getBpPos()); assertEquals("snp2", mapfd.getAllEntries().get(1).getSNP()); }
@Test public void MAP_construct() throws Exception { assertEquals(2, mapfd.getNrOfElements()); }