Exemple #1
0
  public void validateReferenceBases(Allele reference, Byte paddedRefBase) {
    if (reference == null) return;

    // don't validate if we're a complex event
    if (!isComplexIndel() && !reference.isNull() && !reference.basesMatch(getReference())) {
      throw new TribbleException.InternalCodecException(
          String.format(
              "the REF allele is incorrect for the record at position %s:%d, fasta says %s vs. VCF says %s",
              getChr(), getStart(), reference.getBaseString(), getReference().getBaseString()));
    }

    // we also need to validate the padding base for simple indels
    if (hasReferenceBaseForIndel() && !getReferenceBaseForIndel().equals(paddedRefBase)) {
      throw new TribbleException.InternalCodecException(
          String.format(
              "the padded REF base is incorrect for the record at position %s:%d, fasta says %s vs. VCF says %s",
              getChr(),
              getStart(),
              (char) paddedRefBase.byteValue(),
              (char) getReferenceBaseForIndel().byteValue()));
    }
  }