private ConsequenceType findCodingOverlappingConsequenceType(ConsequenceType consequenceType, List<ConsequenceType> consequenceTypeList) { for (ConsequenceType consequenceType1 : consequenceTypeList) { if (isCoding(consequenceType1) && consequenceType.getEnsemblTranscriptId().equals(consequenceType1.getEnsemblTranscriptId()) && consequenceType.getProteinVariantAnnotation().getPosition() .equals(consequenceType1.getProteinVariantAnnotation().getPosition())) { return consequenceType1; } } return null; }
private Set<SequenceOntologyTermComparisonObject> getSequenceOntologySet(List<ConsequenceType> consequenceTypeList) { if (consequenceTypeList != null) { Set<SequenceOntologyTermComparisonObject> set = new HashSet<>(consequenceTypeList.size()); for (ConsequenceType consequenceType : consequenceTypeList) { for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { // // Expected many differences depending on the regulatory source databases used by the annotators. // // Better skip regulatory_region_variant annotations // if (!(sequenceOntologyTerm.getName().equals(VariantAnnotationUtils.REGULATORY_REGION_VARIANT) // || sequenceOntologyTerm.getName().equals(VariantAnnotationUtils.TF_BINDING_SITE_VARIANT))) { set.add(new SequenceOntologyTermComparisonObject(consequenceType.getEnsemblTranscriptId(), sequenceOntologyTerm)); // } } } return set; } else { return null; } }
private ConsequenceType findCodingOverlappingConsequenceType(ConsequenceType consequenceType, List<ConsequenceType> consequenceTypeList) { for (ConsequenceType consequenceType1 : consequenceTypeList) { if (isCoding(consequenceType1) && consequenceType.getEnsemblTranscriptId().equals(consequenceType1.getEnsemblTranscriptId()) && consequenceType.getProteinVariantAnnotation().getPosition() .equals(consequenceType1.getProteinVariantAnnotation().getPosition())) { return consequenceType1; } } return null; }
if (consequenceType.getEnsemblTranscriptId() != null) { stringBuilder.append(consequenceType.getEnsemblTranscriptId());
private Map<String, ConsequenceType> getConsequenceTypeMap (Variant variant){ Map<String, ConsequenceType> map = new HashMap<>(); if (variant.getAnnotation() != null && ListUtils.isNotEmpty(variant.getAnnotation().getConsequenceTypes())) { for (ConsequenceType consequenceType: variant.getAnnotation().getConsequenceTypes()) { if (StringUtils.isNotEmpty(consequenceType.getEnsemblTranscriptId())) { map.put(consequenceType.getEnsemblTranscriptId(), consequenceType); } } } return map; }
if (consequenceType.getEnsemblTranscriptId() != null) { stringBuilder.append(consequenceType.getEnsemblTranscriptId());
if (consequenceType.getEnsemblTranscriptId() != null) { stringBuilder.append(consequenceType.getEnsemblTranscriptId());
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 ProteinVariantAnnotation getProteinAnnotation(ConsequenceType consequenceType) { if (consequenceType.getProteinVariantAnnotation() != null) { QueryResult<ProteinVariantAnnotation> proteinVariantAnnotation = proteinDBAdaptor.getVariantAnnotation( consequenceType.getEnsemblTranscriptId(), consequenceType.getProteinVariantAnnotation().getPosition(), consequenceType.getProteinVariantAnnotation().getReference(), consequenceType.getProteinVariantAnnotation().getAlternate(), new QueryOptions()); if (proteinVariantAnnotation.getNumResults() > 0) { return proteinVariantAnnotation.getResult().get(0); } } return null; }
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); } } } }
private ProteinVariantAnnotation getProteinAnnotation(ConsequenceType consequenceType) { if (consequenceType.getProteinVariantAnnotation() != null) { QueryResult<ProteinVariantAnnotation> proteinVariantAnnotation = proteinDBAdaptor.getVariantAnnotation( consequenceType.getEnsemblTranscriptId(), consequenceType.getProteinVariantAnnotation().getPosition(), consequenceType.getProteinVariantAnnotation().getReference(), consequenceType.getProteinVariantAnnotation().getAlternate(), new QueryOptions()); if (proteinVariantAnnotation.getNumResults() > 0) { return proteinVariantAnnotation.getResult().get(0); } } return null; }
genes.get(conseqType.getGeneName()).add(conseqType.getEnsemblTranscriptId()); if (StringUtils.isNotEmpty(conseqType.getEnsemblTranscriptId())) { trans.append("TRANS").append(FIELD_SEP).append(conseqType.getEnsemblTranscriptId()); xrefs.add(conseqType.getEnsemblTranscriptId()); geneToSOAccessions.add(conseqType.getGeneName() + "_" + soNumber); geneToSOAccessions.add(conseqType.getEnsemblGeneId() + "_" + soNumber); geneToSOAccessions.add(conseqType.getEnsemblTranscriptId() + "_" + soNumber);
addNotNull(genes, consequenceType.getGeneName()); addNotNull(genes, consequenceType.getEnsemblGeneId()); addNotNull(transcripts, consequenceType.getEnsemblTranscriptId()); addNotNull(biotype, consequenceType.getBiotype()); addAllNotNull(flags, consequenceType.getTranscriptAnnotationFlags()); gnSo.add(buildGeneSO(consequenceType.getEnsemblGeneId(), so)); if (StringUtils.isNotEmpty(consequenceType.getEnsemblTranscriptId())) { gnSo.add(buildGeneSO(consequenceType.getEnsemblTranscriptId(), so));
&& !transcriptAnnotationUpdated(variant0, consequenceType1.getEnsemblTranscriptId())) { variant1 = (Variant) variantArray[1]; ConsequenceType consequenceType2 flagTranscriptAnnotationUpdated(variant2, consequenceType1.getEnsemblTranscriptId()); flagTranscriptAnnotationUpdated(variant0, consequenceType1.getEnsemblTranscriptId()); flagTranscriptAnnotationUpdated(variant1, consequenceType1.getEnsemblTranscriptId());
&& !transcriptAnnotationUpdated(variant0, consequenceType1.getEnsemblTranscriptId())) { variant1 = (Variant) variantArray[1]; ConsequenceType consequenceType2 flagTranscriptAnnotationUpdated(variant2, consequenceType1.getEnsemblTranscriptId()); flagTranscriptAnnotationUpdated(variant0, consequenceType1.getEnsemblTranscriptId()); flagTranscriptAnnotationUpdated(variant1, consequenceType1.getEnsemblTranscriptId());
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((feature=consequenceType.getEnsemblTranscriptId())==null) { feature = "-";
putNotNull(ct, CT_ENSEMBL_TRANSCRIPT_ID_FIELD, consequenceType.getEnsemblTranscriptId()); gnSo.add(buildGeneSO(consequenceType.getEnsemblGeneId(), so)); if (StringUtils.isNotEmpty(consequenceType.getEnsemblTranscriptId())) { gnSo.add(buildGeneSO(consequenceType.getEnsemblTranscriptId(), so)); xrefs.add(convertXrefToStorage(consequenceType.getEnsemblGeneId(), "ensemblGene")); if (StringUtils.isNotEmpty(consequenceType.getEnsemblTranscriptId())) { xrefs.add(convertXrefToStorage(consequenceType.getEnsemblTranscriptId(), "ensemblTranscript"));
.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(); }