private boolean isCoding(ConsequenceType consequenceType) { for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { if (VariantAnnotationUtils.CODING_SO_NAMES.contains(sequenceOntologyTerm.getName())) { return true; } } return false; }
private boolean isCoding(ConsequenceType consequenceType) { for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { if (VariantAnnotationUtils.CODING_SO_NAMES.contains(sequenceOntologyTerm.getName())) { return true; } } return false; }
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 String getMostSevereConsequenceType(List<ConsequenceType> consequenceTypeList) { int max = -1; String mostSevereConsequencetype = null; for (ConsequenceType consequenceType : consequenceTypeList) { for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { try { int rank = VariantAnnotationUtils.SO_SEVERITY.get(sequenceOntologyTerm.getName()); if (rank > max) { max = rank; mostSevereConsequencetype = sequenceOntologyTerm.getName(); } } catch (Exception e) { int a = 1; } } } return mostSevereConsequencetype; }
private String getMostSevereConsequenceType(List<ConsequenceType> consequenceTypeList) { int max = -1; String mostSevereConsequencetype = null; for (ConsequenceType consequenceType : consequenceTypeList) { for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { try { int rank = VariantAnnotationUtils.SO_SEVERITY.get(sequenceOntologyTerm.getName()); if (rank > max) { max = rank; mostSevereConsequencetype = sequenceOntologyTerm.getName(); } } catch (Exception e) { int a = 1; } } } return mostSevereConsequencetype; }
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); } } } } }
stringBuilder.append(consequenceType.getSequenceOntologyTerms().stream() .map(SequenceOntologyTerm::getName) .collect(Collectors.joining(",")));
break; case "consequenceType": stringBuilder.append(consequenceType.getSequenceOntologyTerms().stream() .map(SequenceOntologyTerm::getName).collect(Collectors.joining(","))); break;
break; case "consequenceType": stringBuilder.append(consequenceType.getSequenceOntologyTerms().stream() .map(SequenceOntologyTerm::getName).collect(Collectors.joining(","))); break;
for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { if (isRegulatory(sequenceOntologyTerm.getName())) { increment(summaryStats, TOTAL_REGULATORY_ANNOTATIONS, 1); increment(summaryStats, TOTAL_ANNOTATIONS, consequenceType.getSequenceOntologyTerms().size());
featureType = "-"; String consequences = consequenceType.getSequenceOntologyTerms().get(0).getName(); for(int i=1; i<consequenceType.getSequenceOntologyTerms().size(); i++) { consequences += ","+consequenceType.getSequenceOntologyTerms().get(i).getName();
sequenceOntologyTerm.setAccession("SO:" + String.format("%07d", soAcc)); sequenceOntologyTerm.setName(ConsequenceTypeMappings.accessionToTerm.get(soAcc)); if (consequenceTypeMap.get(fields[0]).getSequenceOntologyTerms() == null) { consequenceTypeMap.get(fields[0]).setSequenceOntologyTerms(new ArrayList<>()); consequenceTypeMap.get(fields[0]).getSequenceOntologyTerms().add(sequenceOntologyTerm);
for (SequenceOntologyTerm sequenceOntologyTerm : conseqType.getSequenceOntologyTerms()) { int soNumber = Integer.parseInt(sequenceOntologyTerm.getAccession().substring(3)); soAccessions.add(soNumber);
for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) { String accession = sequenceOntologyTerm.getAccession(); int so = parseConsequenceType(accession);
for (SequenceOntologyTerm so: consequenceType.getSequenceOntologyTerms()) {
codon = referenceCodon + "/" + alternateCodon; soTerms = updatePhasedSoTerms(consequenceType1.getSequenceOntologyTerms(), String.valueOf(referenceCodon), String.valueOf(alternateCodon), variant1.getChromosome().equals("MT")); soTerms = updatePhasedSoTerms(consequenceType1.getSequenceOntologyTerms(), String.valueOf(referenceCodonArray).toUpperCase(), String.valueOf(alternateCodonArray).toUpperCase(), variant1.getChromosome().equals("MT"));
codon = referenceCodon + "/" + alternateCodon; soTerms = updatePhasedSoTerms(consequenceType1.getSequenceOntologyTerms(), String.valueOf(referenceCodon), String.valueOf(alternateCodon), variant1.getChromosome().equals("MT")); soTerms = updatePhasedSoTerms(consequenceType1.getSequenceOntologyTerms(), String.valueOf(referenceCodonArray).toUpperCase(), String.valueOf(alternateCodonArray).toUpperCase(), variant1.getChromosome().equals("MT"));
if (consequenceType.getSequenceOntologyTerms() != null) { List<Integer> soAccession = new LinkedList<>(); for (SequenceOntologyTerm entry : consequenceType.getSequenceOntologyTerms()) { soAccession.add(ConsequenceTypeMappings.termToAccession.get(entry.getName()));
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(); }