Beispiel #1
0
  void checkVarTypeField(String file, String varTypeExpected) {
    SnpSiftCmdVarType varType = new SnpSiftCmdVarType(null);

    VcfFileIterator vcf = new VcfFileIterator(file);
    for (VcfEntry ve : vcf) {
      // Annotate
      varType.annotate(ve);

      // Check that all variants are the ones expected
      String varTypeAnnotated = ve.getInfo(SnpSiftCmdVarType.VARTYPE);
      Assert.assertEquals(varTypeExpected, varTypeAnnotated);
    }
  }
Beispiel #2
0
  /**
   * Check that all variants in a file belong to a given type
   *
   * @param file
   * @param varTypeExpected
   */
  void checkAllVarType(String file, String varTypeExpected) {
    SnpSiftCmdVarType varType = new SnpSiftCmdVarType(null);

    VcfFileIterator vcf = new VcfFileIterator(file);
    for (VcfEntry ve : vcf) {
      // Annotate
      varType.annotate(ve);

      // Check that all variants are the ones expected
      if (verbose)
        System.out.println(
            ve //
                + "\n\tvarTypeExpected: "
                + varTypeExpected //
                + "\n\tINFO flag      : "
                + ve.getInfoFlag(varTypeExpected) //
            );
      if (!ve.getInfoFlag(varTypeExpected))
        System.err.println("Eror in file '" + file + "':\n" + ve);
      Assert.assertEquals(true, ve.getInfoFlag(varTypeExpected));
    }
  }