Skip to content

Commit

Permalink
Merge pull request #465 from monarch-initiative/release-v2.1.1
Browse files Browse the repository at this point in the history
Release v2.1.1
  • Loading branch information
ielis authored Apr 17, 2024
2 parents 3685fbd + cccf148 commit bf81e5a
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 23 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
Changelog
=========

------
latest
------
-----
2.1.1
-----

- add *Past medical history* to `Aspect` enum

-----
2.1.0
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ associate phenotype annotation files.

- **Language/Platform:** Java >=11
- **License:** BSD 3-Clause Clear
- **Version:** 2.1.0
- **Authors:**
- Sebastian Bauer
- Peter N. Robinson
Expand All @@ -34,25 +33,25 @@ associate phenotype annotation files.
- `phenol-cli` for performing empirical score distribution computation as a stand-alone program.

## Usage
We recommend indicating the phenol version in the `properties` section of the pom file of the application.
We recommend importing the `phenol` modules that are needed for your application.

```
<properties>
(...)
<phenol.version>2.1.0</phenol.version>
</properties>
```
For instance:

Then import the phenol modules that are needed for your application.
```xml
<dependency>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol-core</artifactId>
<version>${phenol.version}</version>
</dependency>
<dependency>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol-io</artifactId>
<version>${phenol.version}</version>
</dependency>
<!-- ... and other modules -->
```

where `${phenol.version}` corresponds to the desired version, such as `2.1.0`.

## History
Phenol was initially forked from [ontolib]([https://github.com/Phenomics/ontolib) in February 2018, but was
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# The short X.Y version.
version = '2.1'
# The full version, including alpha/beta/rc tags.
release = '2.1.0'
release = '2.1.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion phenol-analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>phenol-analysis</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion phenol-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>phenol-annotations</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public final class HpoSubOntologyRootTermIds {
/** {@link TermId} of sub ontology "mode of inheritance" (<code>HP:0000005</code>). */
public static final TermId MODE_OF_INHERITANCE = TermId.of("HP:0000005");

/** {@link TermId} of sub ontology Past medical history (<code>HP:0032443</code>). */
public static final TermId PAST_MEDICAL_HISTORY = TermId.of("HP:0032443");
private HpoSubOntologyRootTermIds(){}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
package org.monarchinitiative.phenol.annotations.io.hpo;

import org.monarchinitiative.phenol.ontology.data.TermId;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoClinicalModifierTermIds.CLINICAL_COURSE;
import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoModeOfInheritanceTermIds.INHERITANCE_ROOT;
import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoSubOntologyRootTermIds.*;

/**
* An enum for aspect column of {@link HpoAnnotationLine}.
*/
public enum Aspect {

P,
I,
C,
M;
P(PHENOTYPIC_ABNORMALITY),
I(INHERITANCE_ROOT),
C(CLINICAL_COURSE),
M(CLINICAL_MODIFIER),
H(PAST_MEDICAL_HISTORY);

private final TermId termId;
private static final Map<TermId, Aspect> BY_TERMID = new HashMap<>();


static {
for (Aspect e: values()) {
BY_TERMID.put(e.termId, e);
}
}

Aspect(TermId termId) {
this.termId = termId;
}

public static Optional<Aspect> parse(String aspect) {
switch (aspect.toUpperCase()) {
Expand All @@ -22,8 +45,15 @@ public static Optional<Aspect> parse(String aspect) {
return Optional.of(Aspect.C);
case "M":
return Optional.of(Aspect.M);
case "H":
return Optional.of(Aspect.H);
default:
return Optional.empty();
}
}

public static Optional<Aspect> fromTermId(TermId termId) {
return Optional.ofNullable(BY_TERMID.get(termId));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.monarchinitiative.phenol.annotations.io.hpo;

import org.junit.jupiter.api.Test;
import org.monarchinitiative.phenol.ontology.data.TermId;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoClinicalModifierTermIds.CLINICAL_COURSE;
import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoModeOfInheritanceTermIds.INHERITANCE_ROOT;
import static org.monarchinitiative.phenol.annotations.constants.hpo.HpoSubOntologyRootTermIds.*;

public class AspectTest {

@Test
public void test_aspect_from_termId() {
assertThat(Aspect.fromTermId(PHENOTYPIC_ABNORMALITY).get(), equalTo(Aspect.P));
assertThat(Aspect.fromTermId(INHERITANCE_ROOT).get(), equalTo(Aspect.I));
assertThat(Aspect.fromTermId(CLINICAL_COURSE).get(), equalTo(Aspect.C));
assertThat(Aspect.fromTermId(CLINICAL_MODIFIER).get(), equalTo(Aspect.M));
assertThat(Aspect.fromTermId(PAST_MEDICAL_HISTORY).get(), equalTo(Aspect.H));
assertThat(Aspect.fromTermId(TermId.of("HP:0000000")).isEmpty(), equalTo(true));
assertThat(Aspect.H.toString(), equalTo("H"));
}
}
2 changes: 1 addition & 1 deletion phenol-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>phenol-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion phenol-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>phenol-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion phenol-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>phenol-io</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.monarchinitiative.phenol</groupId>
<artifactId>phenol</artifactId>
<packaging>pom</packaging>
<version>2.1.0</version>
<version>2.1.1</version>

<name>Phenol</name>

Expand Down

0 comments on commit bf81e5a

Please sign in to comment.