Ejemplo n.º 1
0
 /**
  * The main method to check the mappabilities of the given read file names.
  *
  * @param btOutputFileName BowTie output file name
  * @param fileTileLength Tile length
  * @param outputFileName Output file name which the result will be saved into
  * @param readFileName Reads file name
  * @param chr1FileLines chromosome file name
  * @throws IOException
  */
 public void checkMappability(
     String btOutputFileName,
     int fileTileLength,
     String outputFileName,
     String readFileName,
     List<String> chr1FileLines)
     throws IOException {
   System.out.println("Creating [" + outputFileName + "]...");
   StopWatch stopWatch = new StopWatch();
   stopWatch.start();
   System.out.println("Reading [" + btOutputFileName + "]");
   List<String> btOutputFileLines = FileUtils.getInstance().readFile(btOutputFileName);
   System.out.println("Done reading [" + btOutputFileName + "]");
   System.out.println("Reading [" + readFileName + "]");
   List<String> readFileLines = FileUtils.getInstance().readFile(readFileName);
   System.out.println("Done reading [" + readFileName + "]");
   Map<String, Mappability> result =
       createMappability(btOutputFileLines, readFileLines, chr1FileLines);
   FileUtils.getInstance().writeFile(result, outputFileName, fileTileLength);
   stopWatch.stop();
   System.out.println(
       "["
           + outputFileName
           + "] is done in ["
           + TimeUnit.MILLISECONDS.convert(stopWatch.getNanoTime(), TimeUnit.NANOSECONDS)
           + "] MILLISECONDS");
 }
Ejemplo n.º 2
0
  @Test
  public void testTimeFor_FiftyThousand() {
    Choir testChoir = new Choir();

    Address choirAddress = new Address();

    choirAddress.setCity("Omaha");

    choirAddress.setState("NE");

    testChoir.setChoirName("Omaha Children's Choir");

    testChoir.setAddress(choirAddress);

    StopWatch timer = new StopWatch();

    String result = null;

    timer.start();

    for (int i = 0; i < 50000; i++) {

      result = TestUtility.post(timeTestBase + "names", testChoir.toJson(false));
    }

    timer.stop();

    assertNotNull(result);

    say("\n\nTime taken = " + timer.getTime());
    say("Time taken (nano) = " + timer.getNanoTime());
  }