Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump curation version to v0.26.0 (SCRUM-3367) #1130

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public JsonResultResponse<AlleleDiseaseAnnotationDocument> getDiseasePerAllele(S
pagination.addFilterOptions(filterOptions);
pagination.addFilterOption("object.name", diseaseTerm);
pagination.addFilterOption("evidenceCodes.abbreviation", evidenceCode);
pagination.addFilterOption("diseaseRelationNegation.keyword", associationType);
pagination.addFilterOption("generatedRelationString.keyword", associationType);
pagination.addFilterOption("diseaseQualifiers.keyword", diseaseQualifier);
pagination.addFilterOption("pubmedPubModIDs", filterReference);
pagination.addFilterOption("primaryAnnotations.dataProvider.abbreviation", filterSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public JsonResultResponse<GeneDiseaseAnnotationDocument> getDiseaseAnnotationsRi
pagination.addFilterOptions(filterOptions);
pagination.addFilterOption("object.name", diseaseTerm);
pagination.addFilterOption("evidenceCodes.abbreviation", evidenceCode);
pagination.addFilterOption("diseaseRelationNegation.keyword", associationType);
pagination.addFilterOption("generatedRelationString.keyword", associationType);
pagination.addFilterOption("diseaseQualifiers.keyword", diseaseQualifier);
pagination.addFilterOption("pubmedPubModIDs", filterReference);
pagination.addFilterOption("subject.geneSymbol.displayText", filterGene);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ JsonResultResponse<AlleleDiseaseAnnotationDocument> getDiseasePerAllele(
@QueryParam("filter.geneticEntity") String geneticEntity,
@Parameter(in = ParameterIn.QUERY, name = "filter.geneticEntityType", description = "geneticEntityType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.geneticEntityType") String geneticEntityType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseRelation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@Parameter(in = ParameterIn.QUERY, name = "filter.relation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.associationType") String associationType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseQualifier", description = "diseaseQualifier", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.diseaseQualifier") String diseaseQualifier,
Expand Down Expand Up @@ -240,7 +240,7 @@ Response getDiseasePerAlleleDownload(
@QueryParam("filter.geneticEntity") String geneticEntity,
@Parameter(in = ParameterIn.QUERY, name = "filter.geneticEntityType", description = "geneticEntityType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.geneticEntityType") String geneticEntityType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseRelation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@Parameter(in = ParameterIn.QUERY, name = "filter.relation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.associationType") String associationType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseQualifier", description = "diseaseQualifier", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.diseaseQualifier") String diseaseQualifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ JsonResultResponse<GeneDiseaseAnnotationDocument> getDiseaseAnnotationsRibbonDet
@QueryParam("filter.geneticEntity") String geneticEntity,
@Parameter(in = ParameterIn.QUERY, name = "filter.geneticEntityType", description = "geneticEntityType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.geneticEntityType") String geneticEntityType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseRelation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@Parameter(in = ParameterIn.QUERY, name = "filter.relation.name", description = "associationType", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.associationType") String associationType,
@Parameter(in = ParameterIn.QUERY, name = "filter.diseaseQualifier", description = "diseaseQualifier", schema = @Schema(type = SchemaType.STRING))
@QueryParam("filter.diseaseQualifier") String diseaseQualifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private Map<String, Object> getSupplementalData(String focusTaxonId, boolean deb
if (StringUtils.isNotEmpty(focusTaxonId)) {
aggregationFields.put("subject.taxon.name.keyword", "species");
}
aggregationFields.put("diseaseRelationNegation.keyword", "associationType");
aggregationFields.put("generatedRelationString.keyword", "associationType");
aggregationFields.put("diseaseQualifiers.keyword", "diseaseQualifiers");
Map<String, List<String>> distinctFieldValueMap = getAggregations(unfilteredQuery, aggregationFields, focusTaxonId, debug);
Map<String, Object> supplementalData = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static void extracted(GeneDiseaseAnnotationDocument annotation, org.alli
if (primaryAnnotation.getGeneticSex() != null) {
row.setGeneticSex(primaryAnnotation.getGeneticSex().getName());
}
row.setGeneticEntityAssociation(primaryAnnotation.getDiseaseRelation().getName());
row.setGeneticEntityAssociation(primaryAnnotation.getRelation().getName());
if (CollectionUtils.isNotEmpty(primaryAnnotation.getRelatedNotes())) {
row.setNote(primaryAnnotation.getRelatedNotes().stream().map(note -> {
if (note.getNoteType().getName().equals("disease_note")) {
Expand Down Expand Up @@ -292,7 +292,7 @@ private DiseaseDownloadRow getDiseaseDownloadRow(DiseaseAnnotation annotation, P

private DiseaseDownloadRow getBaseDiseaseDownloadRow(GeneDiseaseAnnotationDocument annotation, org.alliancegenome.curation_api.model.entities.Gene homologousGene, org.alliancegenome.curation_api.model.entities.DiseaseAnnotation primaryAnnotation) {
DiseaseDownloadRow row = new DiseaseDownloadRow();
row.setAssociation(annotation.getDiseaseRelationNegation());
row.setAssociation(annotation.getGeneratedRelationString());
row.setDiseaseID(annotation.getObject().getCurie());
row.setDiseaseName(annotation.getObject().getName());
row.setSource(primaryAnnotation.getDataProviderString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ private List<GeneDiseaseAnnotationDocument> createGeneDiseaseAnnotationDocuments

for (DiseaseAnnotation da : entry.getValue().getRight()) {

VocabularyTerm diseaseRelation = vocabService.getVocabularyTerm("is_implicated_in");
VocabularyTerm relation = vocabService.getVocabularyTerm("is_implicated_in");
if (da instanceof GeneDiseaseAnnotation) {
diseaseRelation = da.getDiseaseRelation();
relation = da.getRelation();
}

String key = diseaseRelation.getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
String key = relation.getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
if (da.getWith() != null && da.getWith().size() > 0) {
List<String> withIds = da.getWith().stream().map(Gene::getCurie).collect(Collectors.toList());
Collections.sort(withIds);
Expand All @@ -123,9 +123,9 @@ private List<GeneDiseaseAnnotationDocument> createGeneDiseaseAnnotationDocuments
gdad.setSubject(entry.getValue().getLeft());
HashMap<String, Integer> order = SpeciesType.getSpeciesOrderByTaxonID(entry.getValue().getLeft().getTaxon().getCurie());
gdad.setSpeciesOrder(order);
gdad.setDiseaseRelation(diseaseRelation);
String diseaseRelationNegation = getDiseaseRelationNegation(gdad.getDiseaseRelation().getName(), da.getNegated());
gdad.setDiseaseRelationNegation(diseaseRelationNegation);
gdad.setRelation(relation);
String generatedRelationString = getGeneratedRelationString(gdad.getRelation().getName(), da.getNegated());
gdad.setGeneratedRelationString(generatedRelationString);
gdad.setObject(da.getObject());
gdad.setParentSlimIDs(closureMap.get(da.getObject().getCurie()));
lookup.put(key, gdad);
Expand Down Expand Up @@ -161,10 +161,10 @@ private String getPubmedPubModID(Reference singleReference) {
return null;
}

private String getDiseaseRelationNegation(String diseaseRelation, Boolean negated) {
private String getGeneratedRelationString(String relation, Boolean negated) {
if (!negated)
return diseaseRelation;
return diseaseRelation.replaceFirst("_", "_not_");
return relation;
return relation.replaceFirst("_", "_not_");
}

private List<AlleleDiseaseAnnotationDocument> createAlleleDiseaseAnnotationDocuments() {
Expand All @@ -178,17 +178,17 @@ private List<AlleleDiseaseAnnotationDocument> createAlleleDiseaseAnnotationDocum
HashMap<String, AlleleDiseaseAnnotationDocument> lookup = new HashMap<>();

for (DiseaseAnnotation da : entry.getValue().getRight()) {
String key = da.getDiseaseRelation().getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
String key = da.getRelation().getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
AlleleDiseaseAnnotationDocument adad = lookup.get(key);

if (adad == null) {
adad = new AlleleDiseaseAnnotationDocument();
HashMap<String, Integer> order = SpeciesType.getSpeciesOrderByTaxonID(entry.getValue().getLeft().getTaxon().getCurie());
adad.setSpeciesOrder(order);
adad.setSubject(entry.getValue().getLeft());
adad.setDiseaseRelation(da.getDiseaseRelation());
String diseaseRelationNegation = getDiseaseRelationNegation(da.getDiseaseRelation().getName(), da.getNegated());
adad.setDiseaseRelationNegation(diseaseRelationNegation);
adad.setRelation(da.getRelation());
String generatedRelationString = getGeneratedRelationString(da.getRelation().getName(), da.getNegated());
adad.setGeneratedRelationString(generatedRelationString);
adad.setObject(da.getObject());
lookup.put(key, adad);
}
Expand Down Expand Up @@ -220,15 +220,15 @@ private List<AGMDiseaseAnnotationDocument> createAGMDiseaseAnnotationDocuments()
HashMap<String, AGMDiseaseAnnotationDocument> lookup = new HashMap<>();

for (DiseaseAnnotation da : entry.getValue().getRight()) {
String key = da.getDiseaseRelation().getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
String key = da.getRelation().getName() + "_" + da.getObject().getName() + "_" + da.getNegated();
AGMDiseaseAnnotationDocument adad = lookup.get(key);

if (adad == null) {
adad = new AGMDiseaseAnnotationDocument();
HashMap<String, Integer> order = SpeciesType.getSpeciesOrderByTaxonID(entry.getValue().getLeft().getTaxon().getCurie());
adad.setSpeciesOrder(order);
adad.setSubject(entry.getValue().getLeft());
adad.setDiseaseRelation(da.getDiseaseRelation());
adad.setRelation(da.getRelation());
adad.setObject(da.getObject());
lookup.put(key, adad);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
public class DiseaseAnnotationDocument extends SearchableItemDocument {

private String uniqueId;
private VocabularyTerm diseaseRelation;
private VocabularyTerm relation;
private DOTerm object;
private List<ECOTerm> evidenceCodes;
private Reference singleReference;
private Set<Reference> references;

private String diseaseRelationNegation;
private String generatedRelationString;
mluypaert marked this conversation as resolved.
Show resolved Hide resolved
private Set<String> diseaseQualifiers;
private Set<String> pubmedPubModIDs;
private Set<String> parentSlimIDs;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>${quarkus.version}</quarkus.platform.version>
<curation.version>v0.25.0</curation.version>
<curation.version>v0.26.0</curation.version>
<!-- <curation.version>0.0.0-SNAPSHOT</curation.version> -->
</properties>
<dependencyManagement>
Expand Down
Loading