Search in sources :

Example 1 with TribbleException

use of htsjdk.tribble.TribbleException in project gatk by broadinstitute.

the class ValidateVariants method apply.

@Override
public void apply(final VariantContext vc, final ReadsContext readsContext, final ReferenceContext ref, final FeatureContext featureContext) {
    if (DO_NOT_VALIDATE_FILTERED && vc.isFiltered()) {
        return;
    }
    // get the true reference allele
    final Allele reportedRefAllele = vc.getReference();
    final int refLength = reportedRefAllele.length();
    final Allele observedRefAllele = hasReference() ? Allele.create(Arrays.copyOf(ref.getBases(), refLength)) : null;
    final Set<String> rsIDs = getRSIDs(featureContext);
    for (final ValidationType t : validationTypes) {
        try {
            applyValidationType(vc, reportedRefAllele, observedRefAllele, rsIDs, t);
        } catch (TribbleException e) {
            if (WARN_ON_ERROR) {
                logger.warn("***** " + e.getMessage() + " *****");
            } else {
                throw new UserException.FailsStrictValidation(drivingVariantFile, t, e.getMessage());
            }
        }
    }
}
Also used : TribbleException(htsjdk.tribble.TribbleException) Allele(htsjdk.variant.variantcontext.Allele) UserException(org.broadinstitute.hellbender.exceptions.UserException)

Aggregations

TribbleException (htsjdk.tribble.TribbleException)1 Allele (htsjdk.variant.variantcontext.Allele)1 UserException (org.broadinstitute.hellbender.exceptions.UserException)1