예제 #1
0
 /**
  * Trims and splits complex calls.
  *
  * @param params params to check options
  * @param original call to be trimmed and split (may be returned as the answer)
  * @param denovoCorrector method for correcting de novo flags
  * @return a list of calls. There can be more than one if the call can be split into separate
  *     calls that line up.
  */
 public static List<Variant> trimSplit(
     VariantParams params, Variant original, DenovoChecker denovoCorrector) {
   if (params.callLevel() == VariantOutputLevel.ALL) {
     return Collections.singletonList(original);
   } else if (params.ionTorrent()) {
     return Collections.singletonList(trim(original));
   }
   return split(trim(original), denovoCorrector);
 }
 public void testBad() {
   Diagnostic.setLogStream();
   final SAMRecord rec = new SAMRecord(new SAMFileHeader());
   rec.setReadString("TATTAGGATTGAGACTGGTAAAATGGNCCACCAAG");
   rec.setBaseQualityString("/725361840-525251.68,0,.52!222254/2");
   final VariantParams params = VariantParams.builder().create();
   try {
     new AlignmentEnvironmentCG(
         new VariantAlignmentRecord(rec),
         params,
         MachineErrorParams.builder().machine(MachineType.COMPLETE_GENOMICS).create(),
         null);
     fail();
   } catch (final NoTalkbackSlimException e) {
     assertTrue(e.getMessage(), e.getMessage().startsWith("Invalid CG alignment."));
   }
 }
  public void test() {
    final SAMRecord rec = new SAMRecord(new SAMFileHeader());
    rec.setReadString("TATTAGGATTGAGACTGGTAAAATGGNCCACCAAG");
    rec.setBaseQualityString("/725361840-525251.68,0,.52!222254/2");
    rec.setReadPairedFlag(true);
    final VariantParams params = VariantParams.builder().create();
    final AbstractMachineErrorParams me =
        MachineErrorParams.builder().machine(MachineType.COMPLETE_GENOMICS).create();
    final AlignmentEnvironment se =
        new AlignmentEnvironmentCG(new VariantAlignmentRecord(rec), params, me, null);

    assertFalse(!se.isInverted());
    final String exp =
        ""
            + "AlignmentEnvironment read=GAACCACCNGGTAAAATGGTCAGAGTTAGGATTAT "
            + "quality=["
            + "0.0200, 0.0398, 0.0126, 0.0100, 0.0200, 0.0200, 0.0200, 0.0200, 1.0000, 0.0200, "
            + "0.0100, 0.0501, 0.0794, 0.0316, 0.0794, 0.0050, 0.0079, 0.0501, 0.0251, 0.0100, "
            + "0.0200, 0.0100, 0.0200, 0.0100, 0.0631, 0.0316, 0.0126, 0.0050, 0.0251, 0.0079, "
            + "0.0158, 0.0100, 0.0200, 0.0063, 0.0398"
            + "] start=-1";
    assertEquals(exp, se.toString());
  }
  public void testDefaultQuality() {
    final SAMRecord rec = new SAMRecord(new SAMFileHeader());
    rec.setReadString("TATTAGGATTGAGACTGGTAAAATGGNCCACCAAG");
    rec.setReadPairedFlag(true);
    final VariantParams params = VariantParams.builder().defaultQuality(10).create();
    final AlignmentEnvironment se =
        new AlignmentEnvironmentCG(
            new VariantAlignmentRecord(rec),
            params,
            MachineErrorParams.builder().machine(MachineType.COMPLETE_GENOMICS).create(),
            null);

    assertFalse(!se.isInverted());
    final String exp =
        ""
            + "AlignmentEnvironment read=GAACCACCNGGTAAAATGGTCAGAGTTAGGATTAT "
            + "quality=["
            + "0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, "
            + "0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, "
            + "0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, "
            + "0.1000, 0.1000, 0.1000, 0.1000, 0.1000"
            + "] start=-1";
    assertEquals(exp, se.toString());
  }