private void updateVariantSetStats(VariantAnnotation annotation) { if (annotation != null) { for (ConsequenceType consequenceType : annotation.getConsequenceTypes()) { String biotype = consequenceType.getBiotype(); if (StringUtils.isNotEmpty(biotype)) { stats.addVariantBiotypeCounts(biotype, 1); } if (consequenceType.getSequenceOntologyTerms() != null) { for (SequenceOntologyTerm term : consequenceType.getSequenceOntologyTerms()) { stats.addConsequenceTypeCounts(term.getAccession(), 1); } } } } }
if (consequenceType.getBiotype() != null) { stringBuilder.append(consequenceType.getBiotype());
if (consequenceType.getBiotype() != null) { stringBuilder.append(consequenceType.getBiotype());
if (consequenceType.getBiotype() != null) { stringBuilder.append(consequenceType.getBiotype());
private void generateReportedVariants(List<Variant> variantList, Phenotype phenotype, Panel diseasePanel, ClinicalProperty.ModeOfInheritance moi, Map<String, ReportedVariant> reportedVariantMap) { for (Variant variant : variantList) { if (!reportedVariantMap.containsKey(variant.getId())) { reportedVariantMap.put(variant.getId(), new ReportedVariant(variant.getImpl(), 0, new ArrayList<>(), Collections.emptyList(), Collections.emptyMap())); } ReportedVariant reportedVariant = reportedVariantMap.get(variant.getId()); // Sanity check if (variant.getAnnotation() != null && ListUtils.isNotEmpty(variant.getAnnotation().getConsequenceTypes())) { for (ConsequenceType ct: variant.getAnnotation().getConsequenceTypes()) { // Create the reported event ReportedEvent reportedEvent = new ReportedEvent() .setId("JT-PF-" + reportedVariant.getReportedEvents().size()) .setPhenotypes(Collections.singletonList(phenotype)) .setConsequenceTypeIds(Collections.singletonList(ct.getBiotype())) .setGenomicFeature(new GenomicFeature(ct.getEnsemblGeneId(), ct.getEnsemblTranscriptId(), ct.getGeneName(), null, null)) .setModeOfInheritance(moi) .setPanelId(diseasePanel.getDiseasePanel().getId()); // TODO: add additional reported event fields // Add reported event to the reported variant reportedVariant.getReportedEvents().add(reportedEvent); } } } }
private void generateReportedVariants(VariantQueryResult<Variant> variantQueryResult, Phenotype phenotype, Panel diseasePanel, ClinicalProperty.ModeOfInheritance moi, Penetrance penetrance, Map<String, ReportedVariant> reportedVariantMap) { for (Variant variant: variantQueryResult.getResult()) { if (!reportedVariantMap.containsKey(variant.getId())) { reportedVariantMap.put(variant.getId(), new ReportedVariant(variant.getImpl(), 0, new ArrayList<>(), Collections.emptyList(), Collections.emptyMap())); } ReportedVariant reportedVariant = reportedVariantMap.get(variant.getId()); // Sanity check if (variant.getAnnotation() != null && ListUtils.isNotEmpty(variant.getAnnotation().getConsequenceTypes())) { for (ConsequenceType ct: variant.getAnnotation().getConsequenceTypes()) { // Create the reported event ReportedEvent reportedEvent = new ReportedEvent() .setId("JT-PF-" + reportedVariant.getReportedEvents().size()) .setPhenotypes(Collections.singletonList(phenotype)) .setConsequenceTypeIds(Collections.singletonList(ct.getBiotype())) .setGenomicFeature(new GenomicFeature(ct.getEnsemblGeneId(), ct.getEnsemblTranscriptId(), ct.getGeneName(), null, null)) .setModeOfInheritance(moi) .setPanelId(diseasePanel.getDiseasePanel().getId()) .setPenetrance(penetrance); // TODO: add additional reported event fields // Add reported event to the reported variant reportedVariant.getReportedEvents().add(reportedEvent); } } } }
xrefs.add(conseqType.getEnsemblTranscriptId()); if (StringUtils.isNotEmpty(conseqType.getBiotype())) { biotypes.add(conseqType.getBiotype()); trans.append(FIELD_SEP).append(conseqType.getBiotype());
addNotNull(genes, consequenceType.getEnsemblGeneId()); addNotNull(transcripts, consequenceType.getEnsemblTranscriptId()); addNotNull(biotype, consequenceType.getBiotype()); addAllNotNull(flags, consequenceType.getTranscriptAnnotationFlags());
if (PROTEIN_LENGTH_CHANGING.contains(so.getName()) && "protein_coding".equals(consequenceType.getBiotype())) { acmg.add("PM4");
private ReportedEvent newReportedEvent(int id, Phenotype phenotype, ConsequenceType ct, String panelId, ModeOfInheritance moi, Penetrance penetrance, Variant variant) { ReportedEvent reportedEvent = new ReportedEvent() .setId("OPENCB-" + id); if (phenotype != null) { reportedEvent.setPhenotypes(Collections.singletonList(phenotype)); } if (ct != null) { reportedEvent.setConsequenceTypeIds(Collections.singletonList(ct.getBiotype())) .setGenomicFeature(new GenomicFeature(ct.getEnsemblGeneId(), ct.getEnsemblTranscriptId(), ct.getGeneName(), null, null)); } if (panelId != null) { reportedEvent.setPanelId(panelId); } if (moi != null) { reportedEvent.setModeOfInheritance(moi); } if (penetrance != null) { reportedEvent.setPenetrance(penetrance); } List<String> acmg = VariantClassification.calculateAcmgClassification(variant, reportedEvent); VariantClassification variantClassification = new VariantClassification().setAcmg(acmg); reportedEvent.setClassification(variantClassification); return reportedEvent; } }
if((featureType=consequenceType.getBiotype())==null) { featureType = "-";
.setId("JT-PF-" + reportedVariant.getReportedEvents().size()) .setPhenotypes(Collections.singletonList(phenotype)) .setConsequenceTypeIds(Collections.singletonList(ct.getBiotype())) .setGenomicFeature(new GenomicFeature(ct.getEnsemblGeneId(), ct.getEnsemblTranscriptId(), ct.getGeneName(), null, null))
putNotNull(ct, CT_BIOTYPE_FIELD, consequenceType.getBiotype()); if (consequenceType.getExonOverlap() != null && !consequenceType.getExonOverlap().isEmpty()) { List<Document> exonOverlapDocuments = new ArrayList<>(consequenceType.getExonOverlap().size());
System.out.println(inCT.getBiotype() + " vs " + outCT.getBiotype()); assert(inCT.getBiotype().equals(outCT.getBiotype()));
public static VariantAnnotationProto.ConsequenceType createConsequenceType(ConsequenceType type) { VariantAnnotationProto.ConsequenceType.Builder builder= VariantAnnotationProto.ConsequenceType.newBuilder() .setGeneName(type.getGeneName()) .setEnsemblGeneId(type.getEnsemblGeneId()) .setEnsemblTranscriptId(type.getEnsemblTranscriptId()) .setStrand(type.getStrand()) .setBiotype(type.getBiotype()) .setCDnaPosition(type.getCdnaPosition()) .setCdsPosition(type.getCdsPosition()) .setCodon(type.getCodon()) .setProteinVariantAnnotation(createProteinVariantAnnotation(type.getProteinVariantAnnotation())); List<SequenceOntologyTerm> sequenceOntologyTerms = type.getSequenceOntologyTerms(); if (sequenceOntologyTerms != null) { for (SequenceOntologyTerm so : sequenceOntologyTerms) { VariantAnnotationProto.SequenceOntologyTerm.Builder soBuilder = VariantAnnotationProto.SequenceOntologyTerm.newBuilder() .setAccession(so.getAccession()) .setName(so.getName()); builder.addSequenceOntologyTerms(soBuilder.build()); } } return builder.build(); }