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

Release 1.0.6 #124

Merged
merged 34 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e8cb040
Reving gradle
iimpulse Jan 4, 2023
b648b98
updating package
iimpulse Jan 4, 2023
4412fb6
14 rev
iimpulse Jan 4, 2023
e1c9f9b
rev everything else
iimpulse Jan 4, 2023
be167ae
enumerated relation. needs database migration
iimpulse Apr 17, 2023
82ebed4
string enumeration, reving version
iimpulse Apr 18, 2023
f7d0d95
fixing disease treatment bug and angular 14 rev bug
iimpulse Apr 18, 2023
27174eb
adding linkouts to diseases
iimpulse Apr 18, 2023
3f5d5a9
fixing test for release
iimpulse Apr 18, 2023
cb28419
fixing form control bug
iimpulse Apr 18, 2023
f03bb7c
Merge pull request #114 from TheJacksonLaboratory/feature/angular-14
iimpulse Apr 19, 2023
a05383b
adding snackbar alert for no orcid id, updating export service to oup…
iimpulse Apr 19, 2023
b543127
add jacoco ignore to some config files
iimpulse Apr 20, 2023
c37faa7
Merge pull request #115 from TheJacksonLaboratory/bugfix-102-106
iimpulse Apr 20, 2023
13ebd25
Merge pull request #113 from TheJacksonLaboratory/bugfix/105
iimpulse Apr 21, 2023
39a5d85
Adding some test coverage and save
iimpulse Apr 21, 2023
daac669
adding some tests for the url generate function
iimpulse Apr 21, 2023
e9af00b
adding documentation to new methods
iimpulse Apr 26, 2023
f31df9a
Merge pull request #117 from TheJacksonLaboratory/feature/disease-lin…
iimpulse Apr 26, 2023
a4edf2f
adding test and fixing discoveries
iimpulse Apr 26, 2023
1e52db8
a sweet of tests to raise coverage and updates to respective logic
iimpulse May 8, 2023
a523550
moar testing
iimpulse May 12, 2023
53d4be9
updating to is blank
iimpulse May 15, 2023
918be73
Merge pull request #118 from TheJacksonLaboratory/enhancement/orcid
iimpulse May 15, 2023
c8f956a
Merge branch 'develop' into enhancement/test-cov
iimpulse May 15, 2023
e251299
adding action workflow and removing empty test methods
iimpulse May 15, 2023
caec91e
some review changes
iimpulse May 16, 2023
c58ed37
Merge pull request #119 from TheJacksonLaboratory/enhancement/test-cov
iimpulse May 17, 2023
910e229
small bugfix for treatment changes
iimpulse May 17, 2023
f49d8f2
export bugfix, npe catch
iimpulse Jun 6, 2023
b613bc3
release lockdown and url update
iimpulse Jun 6, 2023
cb30c2b
changes to export format, bug catching export format
iimpulse Jun 7, 2023
3415a1d
adding comments for methods
iimpulse Jun 14, 2023
d1e1418
Merge pull request #122 from TheJacksonLaboratory/enhancement/release…
iimpulse Jun 14, 2023
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
34 changes: 34 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: test
30 changes: 23 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = 'org.monarchinitiative.poet'
version = '1.0.5'
version = '1.0.6'
sourceCompatibility = '11'

configurations {
Expand Down Expand Up @@ -57,6 +57,7 @@ task genJaxb {
repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
Expand All @@ -67,28 +68,30 @@ dependencies {
implementation 'org.springframework.security:spring-security-oauth2-jose'
implementation 'org.springframework.security:spring-security-config'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation group: 'org.monarchinitiative.phenol', name: 'phenol-core', version: '1.6.1'
implementation group: 'org.monarchinitiative.phenol', name: 'phenol-core', version: '2.0.0'
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
implementation 'org.monarchinitiative.phenol:phenol-annotations:1.6.2'
implementation 'org.monarchinitiative.phenol:phenol-io:1.6.2'
implementation 'org.monarchinitiative.phenol:phenol-annotations:2.0.0'
implementation 'org.monarchinitiative.phenol:phenol-io:2.0.0'
implementation 'org.apache.commons:commons-csv:1.9.0'
implementation 'org.springframework.ws:spring-ws-core'
implementation 'org.apache.commons:commons-text:1.10.0'
// For Java 11:
implementation 'org.glassfish.jaxb:jaxb-runtime'
implementation(files(genJaxb.classesDir).builtBy(genJaxb))
implementation ('org.springframework.boot:spring-boot-starter-web-services') {
implementation('org.springframework.boot:spring-boot-starter-web-services') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}

jaxb "com.sun.xml.bind:jaxb-xjc:2.1.7"

runtimeOnly 'com.h2database:h2'
testRuntimeOnly 'com.h2database:h2'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation group: 'org.spockframework', name: 'spock-core', version: '1.3-groovy-2.4'
testImplementation group: 'org.spockframework', name: 'spock-spring', version: '1.3-groovy-2.4'
testImplementation 'org.springframework.security:spring-security-test:4.2.3.RELEASE'
}

def profile = 'development'
Expand Down Expand Up @@ -128,8 +131,21 @@ test {
systemProperty 'spring.profiles.active', 'test'
}

jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/monarchinitiative/poet/service/InitDatabaseService.class",
"org/monarchinitiative/poet/views/*",
"org/monarchinitiative/poet/model/utility/HpoAnnotationLine.class",
])
}))
}
}

test.finalizedBy(jacocoTestReport)


clean {
delete fileTree(dir: "src/main/resources/static")
}
Expand Down Expand Up @@ -174,4 +190,4 @@ bootRun {
profile = "initialize"
}
systemProperty "spring.profiles.active", profile
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.monarchinitiative.poet.controller;

import org.apache.commons.csv.CSVFormat;
import org.monarchinitiative.poet.model.entities.Version;
import org.monarchinitiative.poet.model.enumeration.AnnotationStatus;
import org.monarchinitiative.poet.service.ExportService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
import org.springframework.data.domain.Sort;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -79,9 +75,11 @@ public List<DiseaseCount> getDiseaseActivity(@RequestParam(value = "all", defaul
map(UserActivity::getAnnotation).map(Annotation::getAnnotationSource)
.collect(Collectors.groupingByConcurrent(AnnotationSource::getDisease, Collectors.counting()))
.entrySet().stream()
.map(entry ->
new DiseaseCount(entry.getKey().getDiseaseId(), entry.getKey().getDiseaseName(),
entry.getValue())).collect(Collectors.toList());
.map(entry -> {
return new DiseaseCount(entry.getKey().getDiseaseId(), entry.getKey().getDiseaseName(),
entry.getValue());

}).collect(Collectors.toList());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

import javax.persistence.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Locale;
import java.util.Objects;

@Entity
Expand Down Expand Up @@ -47,6 +49,9 @@ public class Annotation {
@JsonView({AnnotationViews.Simple.class, AnnotationViews.UserSpecific.class})
private LocalDateTime lastUpdatedDate;

@Transient
private LocalDateTime createdDate;

@OneToOne
@JsonView({AnnotationViews.Simple.class, AnnotationViews.UserSpecific.class})
private User owner;
Expand Down Expand Up @@ -102,10 +107,22 @@ public LocalDateTime getLastUpdatedDate() {
return lastUpdatedDate;
}

public String getExportLastUpdatedDate(){
return DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.ENGLISH).format(this.lastUpdatedDate);
}

public void setLastUpdatedDate(LocalDateTime lastUpdatedDate) {
this.lastUpdatedDate = lastUpdatedDate;
}

public String getCreatedDate() {
return DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.ENGLISH).format(this.createdDate);
}

public void setCreatedDate(LocalDateTime createdDate) {
this.createdDate = createdDate;
}

public void newMessage(Message message){
this.reviewMessages.add(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public void setTreatmentCount(int treatmentCount) {
this.treatmentCount = treatmentCount;
}

public String getExportDiseaseId(){
return this.equivalentId == null || this.equivalentId.isBlank() ? this.diseaseId : this.equivalentId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.fasterxml.jackson.annotation.JsonView;
import org.monarchinitiative.poet.model.enumeration.AnnotationStatus;
import org.monarchinitiative.poet.model.enumeration.Relation;
import org.monarchinitiative.poet.model.requests.TreatmentRequest;
import org.monarchinitiative.poet.views.AnnotationViews;

Expand Down Expand Up @@ -30,7 +31,8 @@ public class TreatmentAnnotation extends Annotation {
private String evidence;
@JsonView(AnnotationViews.Simple.class)
@NotNull
private String relation;
@Enumerated(EnumType.STRING)
private Relation relation;
@JsonView(AnnotationViews.Simple.class)
private String extensionId;
@JsonView(AnnotationViews.Simple.class)
Expand All @@ -51,7 +53,7 @@ public TreatmentAnnotation(AnnotationSource annotationSource, AnnotationStatus s
this.hpoId = hpoId;
this.evidence = evidence;
this.comment = comment;
this.relation = relation;
this.relation = Relation.valueOf(relation);
this.extensionId = extensionId;
this.extensionLabel = extensionLabel;
}
Expand All @@ -64,7 +66,7 @@ public TreatmentAnnotation(String maxoId, String maxoName, String hpoName, Strin
this.hpoId = hpoId;
this.evidence = evidence;
this.comment = comment;
this.relation = relation;
this.relation = Relation.valueOf(relation);
this.extensionId = extensionId;
this.extensionLabel = extensionLabel;
}
Expand All @@ -79,7 +81,7 @@ public TreatmentAnnotation(TreatmentRequest treatmentRequest, AnnotationSource a
this.hpoName = treatmentRequest.getHpoName();
this.evidence = treatmentRequest.getEvidence();
this.comment = treatmentRequest.getComment();
this.relation = treatmentRequest.getRelation();
this.relation = Relation.valueOf(treatmentRequest.getRelation());
this.extensionId = treatmentRequest.getExtensionId();
this.extensionLabel = treatmentRequest.getExtensionLabel();
}
Expand All @@ -91,7 +93,7 @@ public void updateAnnotation(TreatmentRequest treatmentRequest, AnnotationSource
this.hpoName = treatmentRequest.getHpoName();
this.evidence = treatmentRequest.getEvidence();
this.comment = treatmentRequest.getComment();
this.relation = treatmentRequest.getRelation();
this.relation = Relation.valueOf(treatmentRequest.getRelation());
this.extensionId = treatmentRequest.getExtensionId();
this.extensionLabel = treatmentRequest.getExtensionLabel();
this.setAnnotationSource(annotationSource);
Expand Down Expand Up @@ -121,7 +123,7 @@ public String getComment() {
return comment;
}

public String getRelation() {
public Relation getRelation() {
return relation;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.monarchinitiative.poet.views.UserViews;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.Objects;

@Entity
Expand Down Expand Up @@ -62,10 +65,10 @@ public String getOrcid(){
}

public String getExportName(){
if (orcid != null) {
return String.format("%s[%s]", nickname, orcid);
if (orcid != null && !orcid.isBlank()) {
return String.format("ORCID:%s",orcid);
} else {
return String.format("%s[]", nickname);
return email;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(id, owner, annotation, dateTime, curationAction);
}

public Annotation getOldAnnotation() {
return oldAnnotation;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.monarchinitiative.poet.model.enumeration;

public enum Category {
PHENOTYPE, TREATMENT
PHENOTYPE, TREATMENT, UNKNOWN
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.monarchinitiative.poet.model.enumeration;

/**
* The relation of the MAXO term to the HPO term.
*/
public enum Relation {
TREATS, PREVENTS, INVESTIGATES, CONTRAINDICATED, NO_OBSERVED_BENEFIT
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
package org.monarchinitiative.poet.model.requests;

public class DiseaseRequest {
private final String id;
private final String diseaseId;
private final String diseaseName;
private final String description;
private final String equivalentId;

public DiseaseRequest(String id, String diseaseId, String diseaseName, String description, String equivalentId) {
this.id = id;
public DiseaseRequest(String diseaseId, String diseaseName, String description, String equivalentId) {
this.diseaseId = diseaseId;
this.diseaseName = diseaseName;
this.description = description;
this.equivalentId = equivalentId;
}

public String getId() {
return id;
}

public String getDiseaseId() {
return diseaseId;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
package org.monarchinitiative.poet.model.responses;

public class Contribution {
Integer treatment;
Integer phenotype;
Integer phenopackets;
private final int treatment;
private final int phenotype;

public Contribution(Integer treatment, Integer phenotype, Integer phenopackets) {
this.treatment = treatment == null ? 0 : treatment;
this.phenotype = phenotype == null ? 0 : phenotype;
this.phenopackets = phenopackets == null ? 0 : phenopackets;
public Contribution(int treatment, int phenotype) {
this.treatment = Math.max(treatment, 0);
this.phenotype = Math.max(phenotype, 0);
}

public Integer getTreatment() {
public int getTreatment() {
return treatment;
}

public Integer getPhenotype() {
public int getPhenotype() {
return phenotype;
}

public Integer getPhenopackets() {
return phenopackets;
}
}
Loading