AlleleProtoAdaptor { public static PathogenicityData toPathogenicityData(AlleleProperties alleleProperties) { if (alleleProperties.equals(AlleleProperties.getDefaultInstance())) { return PathogenicityData.empty(); } List<PathogenicityScore> pathogenicityScores = parsePathogenicityData(alleleProperties.getPropertiesMap()); ClinVarData clinVarData = parseClinVarData(alleleProperties.getClinVar()); return PathogenicityData.of(clinVarData, pathogenicityScores); } private  AlleleProtoAdaptor(); static AlleleKey toAlleleKey(Variant variant); static FrequencyData toFrequencyData(AlleleProperties alleleProperties); static PathogenicityData toPathogenicityData(AlleleProperties alleleProperties);  }
@Test public void testToPathDataSift() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("SIFT", 0.2f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(SIFT, 0.2f)))); }
@Test public void testToPathDataPolyphen() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("POLYPHEN", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(POLYPHEN, 0.7f)))); }
@Test public void testToPathDataMutationTaster() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("MUT_TASTER", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(MUTATION_TASTER, 0.7f)))); }
@Test public void testToPathDataRevel() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("REVEL", 0.2f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(REVEL, 0.2f)))); }
@Test public void testToPathDataMcap() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("MCAP", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(M_CAP, 0.7f)))); }
@Test public void testToPathDataMpc() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("MPC", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(MPC, 0.7f)))); }
@Test public void testToPathDataMvp() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("MVP", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(MVP, 0.7f)))); }
@Test public void testToPathDataPrimateAi() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("PRIMATE_AI", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(PRIMATE_AI, 0.7f)))); }
@Test public void testToPathDataRemm() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("REMM", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(REMM, 0.7f)))); }
@Test public void testToPathDataCadd() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().putProperties("CADD", 0.7f).build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.of(PathogenicityScore.of(CADD, 0.7f)))); }
@Test public void parseClinVarDataDefaultInstanceReturnsEmpty() { AlleleProperties alleleProperties = AlleleProperties.newBuilder().build(); assertThat(AlleleProtoAdaptor.toPathogenicityData(alleleProperties), equalTo(PathogenicityData.empty())); }