if (consequenceType.getEnsemblGeneId() != null) { stringBuilder.append(consequenceType.getEnsemblGeneId());
if (genePanelMap.containsKey(ct.getEnsemblGeneId())) { for (String panelId: genePanelMap.get(ct.getEnsemblGeneId())) { ReportedEvent reportedEvent = newReportedEvent(reportedVariant.getReportedEvents().size(), phenotype, ct, panelId, moi, penetrance, variant);
if (consequenceType.getEnsemblGeneId() != null) { stringBuilder.append(consequenceType.getEnsemblGeneId());
if (consequenceType.getEnsemblGeneId() != null) { stringBuilder.append(consequenceType.getEnsemblGeneId());
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); } } } }
genesInVariant.add(geneName); geneName = consequenceType.getEnsemblGeneId(); if (geneName != null) { genesInVariant.add(geneName);
genes.get(conseqType.getGeneName()).add(conseqType.getEnsemblGeneId()); genes.get(conseqType.getGeneName()).add(conseqType.getEnsemblTranscriptId()); xrefs.add(conseqType.getEnsemblGeneId()); xrefs.add(conseqType.getEnsemblTranscriptId()); geneToSOAccessions.add(conseqType.getEnsemblGeneId() + "_" + soNumber); geneToSOAccessions.add(conseqType.getEnsemblTranscriptId() + "_" + soNumber);
for (ConsequenceType consequenceType : consequenceTypes) { addNotNull(genes, consequenceType.getGeneName()); addNotNull(genes, consequenceType.getEnsemblGeneId()); addNotNull(transcripts, consequenceType.getEnsemblTranscriptId()); addNotNull(biotype, consequenceType.getBiotype()); gnSo.add(buildGeneSO(consequenceType.getGeneName(), so)); if (StringUtils.isNotEmpty(consequenceType.getEnsemblGeneId())) { gnSo.add(buildGeneSO(consequenceType.getEnsemblGeneId(), so));
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((gene=consequenceType.getEnsemblGeneId())==null) { gene = "-";
putNotNull(ct, CT_ENSEMBL_GENE_ID_FIELD, consequenceType.getEnsemblGeneId()); putNotNull(ct, CT_ENSEMBL_TRANSCRIPT_ID_FIELD, consequenceType.getEnsemblTranscriptId()); gnSo.add(buildGeneSO(consequenceType.getGeneName(), so)); if (StringUtils.isNotEmpty(consequenceType.getEnsemblGeneId())) { gnSo.add(buildGeneSO(consequenceType.getEnsemblGeneId(), so)); xrefs.add(convertXrefToStorage(consequenceType.getGeneName(), "HGNC")); if (StringUtils.isNotEmpty(consequenceType.getEnsemblGeneId())) { xrefs.add(convertXrefToStorage(consequenceType.getEnsemblGeneId(), "ensemblGene"));
.setPhenotypes(Collections.singletonList(phenotype)) .setConsequenceTypeIds(Collections.singletonList(ct.getBiotype())) .setGenomicFeature(new GenomicFeature(ct.getEnsemblGeneId(), ct.getEnsemblTranscriptId(), ct.getGeneName(), null, null)) .setPanelId(diseasePanel.getDiseasePanel().getId())
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(); }