Ejemplo n.º 1
0
 @AfterClass
 public void close() throws IOException {
   bimfd.close();
   famfd.close();
   pedfd.close();
   mapfd.close();
   tpedfd.close();
 }
Ejemplo n.º 2
0
 @Test
 public void BIM_writer() throws Exception {
   File newBim = new File(testBim.getAbsolutePath().replace(testBim.getName(), "new.bim"));
   BimFileWriter w = new BimFileWriter(newBim);
   try {
     w.writeAll(bimfd.getAllEntries());
     boolean filesAreEqual = DirectoryCompare.compareFileContent(testBim, newBim);
     assertTrue(filesAreEqual);
   } finally {
     w.close();
   }
 }
Ejemplo n.º 3
0
  @Test
  public void BIM_getEntries() throws Exception {
    assertEquals(1, bimfd.getEntries(0, 1).size());
    assertEquals(1, bimfd.getEntries(1, 2).size());
    assertEquals(2, bimfd.getEntries(0, 2).size());
    assertEquals(2, bimfd.getAllEntries().size());

    assertEquals("snp1", bimfd.getEntries(0, 1).get(0).getSNP());
    assertEquals('A', bimfd.getEntries(0, 1).get(0).getBiallele().getAllele1());
    assertEquals(0.0, bimfd.getEntries(1, 2).get(0).getcM());
    assertEquals("1", bimfd.getEntries(1, 2).get(0).getChromosome());

    assertEquals('C', bimfd.getAllEntries().get(0).getBiallele().getAllele2());
    assertEquals('T', bimfd.getAllEntries().get(1).getBiallele().getAllele2());
    assertEquals(1, bimfd.getAllEntries().get(0).getBpPos());
    assertEquals(2, bimfd.getAllEntries().get(1).getBpPos());
    assertEquals("snp2", bimfd.getAllEntries().get(1).getSNP());
  }
Ejemplo n.º 4
0
 @Test
 public void BIM_construct() throws Exception {
   assertEquals(2, bimfd.getNrOfElements());
 }