Example #1
0
  public Map<String, Object> annotate(
      RefMetaDataTracker tracker,
      AnnotatorCompatible walker,
      ReferenceContext ref,
      Map<String, AlignmentContext> stratifiedContexts,
      VariantContext vc) {
    if (mendelianViolation == null) {
      if (checkAndSetSamples(((Walker) walker).getSampleDB())) {
        mendelianViolation =
            new MendelianViolation(((VariantAnnotator) walker).minGenotypeQualityP);
      } else {
        throw new UserException(
            "Mendelian violation annotation can only be used from the Variant Annotator, and must be provided a valid PED file (-ped) from the command line containing only 1 trio.");
      }
    }

    Map<String, Object> toRet = new HashMap<String, Object>(1);
    boolean hasAppropriateGenotypes =
        vc.hasGenotype(motherId)
            && vc.getGenotype(motherId).hasLikelihoods()
            && vc.hasGenotype(fatherId)
            && vc.getGenotype(fatherId).hasLikelihoods()
            && vc.hasGenotype(childId)
            && vc.getGenotype(childId).hasLikelihoods();
    if (hasAppropriateGenotypes)
      toRet.put(
          "MVLR", mendelianViolation.violationLikelihoodRatio(vc, motherId, fatherId, childId));

    return toRet;
  }