public Document convertScoreToStorageNoSource(Score score) { return convertScoreToStorage(score.getScore(), null, score.getDescription()); }
private Document convertScoreToStorage(Score score) { return convertScoreToStorage(score.getScore(), score.getSource(), score.getDescription()); }
public void checkScore(Query query, Predicate<Double> doublePredicate, String source, Function<VariantAnnotation, List<Score>> mapper) { checkScore(query, scores -> scores.stream().anyMatch(score -> score.getSource().equalsIgnoreCase(source) && doublePredicate.test(score.getScore())), mapper); }
private long countScore(String source, QueryResult<Variant> variantQueryResult, Predicate<Double> doublePredicate, Function<VariantAnnotation, List<Score>> mapper) { return countScore(variantQueryResult, scores -> scores.stream().anyMatch(score -> score.getSource().equalsIgnoreCase(source) && doublePredicate.test(score.getScore())), mapper); }
private void checkScore(List<Score> inScores, List<Score> outScores, String source) { Score inScore = getScore(inScores, source); Score outScore = getScore(outScores, source); if (inScore != null && outScore != null) { double inValue = inScore.getScore() == null ? 0 : inScore.getScore(); double outValue = outScore.getScore() == null ? 0 : outScore.getScore(); String inDescription = inScore.getDescription() == null ? "" : inScore.getDescription(); String outDescription = outScore.getDescription() == null ? "" : outScore.getDescription(); System.out.println(source + ": " + inValue + " vs " + outValue + " ; " + inDescription + " vs " + outDescription); } else if (inScore != null || outScore != null) { fail("Mismatchtch " + source + " values"); } } }
public static VariantAnnotationProto.Score createVariantAnnotationScore(Score score) { VariantAnnotationProto.Score.Builder builder = VariantAnnotationProto.Score.newBuilder() .setScore(score.getScore()) .setSource(score.getSource()) .setDescription(score.getDescription()); return builder.build(); } }
((Predicate<List<Score>>) scores -> scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("gerp") && s.getScore() <= 0.5)) .or(scores -> scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("phastCons") && s.getScore() < 0.5)), VariantAnnotation::getConservation); ((Predicate<List<Score>>) scores -> scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("gerp") && s.getScore() <= 0.5)) .and(scores -> scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("phastCons") && s.getScore() < 0.5)), VariantAnnotation::getConservation); scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("gerp") && s.getScore() < 0.5) || scores.stream().noneMatch(s -> s.getSource().equalsIgnoreCase("gerp")), VariantAnnotation::getConservation); scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("phastCons") && s.getScore() >= 0.5) || scores.stream().noneMatch(s -> s.getSource().equalsIgnoreCase("phastCons")), VariantAnnotation::getConservation); scores -> (scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("gerp") && s.getScore() <= 0.5) || scores.stream().noneMatch(s -> s.getSource().equalsIgnoreCase("gerp"))) && scores.stream().anyMatch(s -> s.getSource().equalsIgnoreCase("phastCons") && s.getScore() < 0.5), VariantAnnotation::getConservation);
trans.append(FIELD_SEP); if (sift != null) { trans.append(sift.getScore()).append(FIELD_SEP).append(sift.getDescription()); } else { trans.append(FIELD_SEP); trans.append(polyph.getScore()).append(FIELD_SEP).append(polyph.getDescription()); } else { trans.append(FIELD_SEP); switch (score.getSource()) { case "phastCons": variantSearchModel.setPhastCons(score.getScore()); break; case "phylop": variantSearchModel.setPhylop(score.getScore()); break; case "gerp": variantSearchModel.setGerp(score.getScore()); break; default: case "cadd_raw": case "caddRaw": variantSearchModel.setCaddRaw(score.getScore()); break; case "cadd_scaled": case "caddScaled": variantSearchModel.setCaddScaled(score.getScore());
for (Score score : proteinVariantAnnotation.getSubstitutionScores()) { if (score.getSource().equalsIgnoreCase("sift")) { addNotNull(sift, score.getScore()); addNotNull(siftDesc, score.getDescription()); } else if (score.getSource().equalsIgnoreCase("polyphen")) { addNotNull(polyphen, score.getScore()); addNotNull(polyphenDesc, score.getDescription()); for (Score score : variantAnnotation.getConservation()) { PhoenixHelper.Column column = VariantPhoenixHelper.getConservationScoreColumn(score.getSource()); map.put(column, score.getScore()); for (Score score : variantAnnotation.getFunctionalScore()) { PhoenixHelper.Column column = VariantPhoenixHelper.getFunctionalScoreColumn(score.getSource()); map.put(column, score.getScore());
.anyMatch(s -> s.getSource().equalsIgnoreCase("cadd_scaled") && s.getScore() < 0.5)) .or(List::isEmpty), VariantAnnotation::getFunctionalScore); .anyMatch(s -> s.getSource().equalsIgnoreCase("cadd_scaled") && s.getScore() <= 0.5)) .or(List::isEmpty), VariantAnnotation::getFunctionalScore); .anyMatch(s -> s.getSource().equalsIgnoreCase("cadd_raw") && s.getScore() > 0.5)) .or(List::isEmpty), VariantAnnotation::getFunctionalScore); .anyMatch(s -> s.getSource().equalsIgnoreCase("cadd_raw") && s.getScore() >= 0.5)) .or(List::isEmpty), VariantAnnotation::getFunctionalScore);