Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3124feb
Next development iteration `v1.0.0-RC4-SNAPSHOT`.
ielis Apr 25, 2023
71c6a2e
Merge pull request #183 from ielis/develop
ielis Apr 25, 2023
03de2a9
Add molecule context to the variation descriptor during conversion fr…
ielis Apr 27, 2023
3cc54e1
Improve handling of the VcfRecord filter field.
ielis Apr 27, 2023
6cf109f
Add missing VCF info field.
ielis Apr 27, 2023
b477d3f
Fix conversion test.
ielis Apr 27, 2023
4869dc3
Merge pull request #185 from ielis/fix_variant_conversion
ielis Apr 27, 2023
f9a0219
The conversion code should not set default instances to a field in ca…
ielis Apr 28, 2023
10e6420
Fix bug in `PhenotypicFeatureConverter`.
ielis Apr 28, 2023
930c3c3
Merge pull request #187 from ielis/conversion_subtleties
ielis Apr 28, 2023
70c79bd
Add instructions for validation results serialization.
ielis May 25, 2023
eb2f991
`phenopacket-tools-validator-jsonschema` requires `phenopacket.schema…
ielis May 25, 2023
f3dbf59
Try to be portable with Windows.
ielis May 25, 2023
ac1fc24
Merge pull request #188 from ielis/add_json_annotations
ielis May 25, 2023
56f605c
Add message utils package into `phenopacket-tools-util`.
ielis Jun 2, 2023
41c3734
Merge pull request #189 from ielis/message_utils
ielis Jun 2, 2023
5516c33
Use phenol `2.0.2`. Use `MinimalOntology` and the new graph API inste…
ielis Jul 27, 2023
b770324
Run CI using `mvnw`.
ielis Jul 27, 2023
e6fb479
Merge pull request #190 from ielis/update-phenol
ielis Jul 27, 2023
7a431fc
Check that phenotypic features are present at most once.
ielis Aug 22, 2023
848e357
Remove unused `conf.py` parts.
ielis Aug 22, 2023
11a452a
Add unique validator into the standard validation pipeline.
ielis Aug 22, 2023
539ce11
Update changelog.
ielis Aug 22, 2023
3db71e5
Merge pull request #191 from ielis/check-phenotypic-features-are-unique
ielis Aug 22, 2023
53c9733
Check `Age` is a valid ISO8601 period string.
ielis Sep 3, 2023
b911773
Merge pull request #193 from ielis/validate-iso8601
ielis Sep 22, 2023
1ba1d94
Ignore `venv`.
ielis Feb 16, 2026
e469eb0
Update action step versions.
ielis Feb 17, 2026
8c809c7
Update the documentation links.
ielis Feb 17, 2026
5551bd7
Update Maven and several plugins.
ielis Feb 17, 2026
096d8a5
Update HPO test resource.
ielis Feb 17, 2026
436c876
Add molecule context to the variation descriptor during conversion fr…
ielis Apr 27, 2023
3ebfe57
Improve handling of the VcfRecord filter field.
ielis Apr 27, 2023
2dfd635
Add missing VCF info field.
ielis Apr 27, 2023
b85416d
Fix conversion test.
ielis Apr 27, 2023
bc12ca7
The conversion code should not set default instances to a field in ca…
ielis Apr 28, 2023
b979e3e
Fix bug in `PhenotypicFeatureConverter`.
ielis Apr 28, 2023
44debbf
Add instructions for validation results serialization.
ielis May 25, 2023
6a75ba3
`phenopacket-tools-validator-jsonschema` requires `phenopacket.schema…
ielis May 25, 2023
d9dabb6
Try to be portable with Windows.
ielis May 25, 2023
e7e9991
Add message utils package into `phenopacket-tools-util`.
ielis Jun 2, 2023
50f93ae
Use phenol `2.0.2`. Use `MinimalOntology` and the new graph API inste…
ielis Jul 27, 2023
c5a9b81
Run CI using `mvnw`.
ielis Jul 27, 2023
f6ca2f9
Check that phenotypic features are present at most once.
ielis Aug 22, 2023
59c49e1
Remove unused `conf.py` parts.
ielis Aug 22, 2023
7952210
Add unique validator into the standard validation pipeline.
ielis Aug 22, 2023
155bca4
Update changelog.
ielis Aug 22, 2023
d88585d
Check `Age` is a valid ISO8601 period string.
ielis Sep 3, 2023
42c878b
Ignore `venv`.
ielis Feb 16, 2026
5219119
Update action step versions.
ielis Feb 17, 2026
bf4ea5c
Update the documentation links.
ielis Feb 17, 2026
2448374
Update Maven and several plugins.
ielis Feb 17, 2026
ba1a4ba
Update HPO test resource.
ielis Feb 17, 2026
4ae3a89
Merge remote-tracking branch 'origin/fix-broken-doc-links' into fix-b…
ielis Feb 17, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v5.2.0
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
run: ./mvnw --batch-mode --update-snapshots verify
10 changes: 5 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
ref: main

- name: Set up Python 3.
uses: actions/setup-python@v4
uses: actions/setup-python@v6.2.0
with:
python-version: 3.9
python-version: 3.12

- name: Install Python dependencies
run: |
pip install sphinx
pip install sphinx-rtd-theme

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v5.2.0
with:
java-version: '17'
distribution: 'adopt'
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Deploy documentation.
if: ${{ github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh-pages
force: true
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ families/*
phenopackets/*
cohorts/*

# Python stuff
venv/
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Changelog
* Improve user guide, tutorial, and documentation.
* Introduce *latest* and *stable* documentation branches
* Add showcase of apps that use phenopacket-tools to add more code examples
* Run `MetaDataValidator` during base validation
* Run `MetaDataValidator` and `HpoUniqueValidator` during base validation
* Finalize JSON and YAML format sniffing
* Fix example phenopackets

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ a *Library user guide*, and the *Javadoc API documentation*.

The documentation is published in two documentation branches:
- **stable**: corresponds to the latest published release, and generally also to the last commit of the `main` Git branch
- [Tutorial](http://phenopackets.org/phenopacket-tools/stable/tutorial.html)
- [CLI user guide](http://phenopackets.org/phenopacket-tools/stable/cli.html)
- [Library user guide](http://phenopackets.org/phenopacket-tools/stable)
- [Javadoc API documentation](http://phenopackets.org/phenopacket-tools/stable/apidocs)
- [Tutorial](https://phenopackets.github.io/phenopacket-tools/stable/tutorial.html)
- [CLI user guide](https://phenopackets.github.io/phenopacket-tools/stable/cli.html)
- [Library user guide](https://phenopackets.github.io/phenopacket-tools/stable)
- [Javadoc API documentation](https://phenopackets.github.io/phenopacket-tools/stable/apidocs)
- **latest**: corresponds to the bleeding edge code that is on the `develop` Git branch
- [Tutorial](http://phenopackets.org/phenopacket-tools/latest/tutorial.html)
- [CLI user guide](http://phenopackets.org/phenopacket-tools/latest/cli.html)
- [Library user guide](http://phenopackets.org/phenopacket-tools/latest)
- [Javadoc API documentation](http://phenopackets.org/phenopacket-tools/latest/apidocs)
- [Tutorial](https://phenopackets.github.io/phenopacket-tools/latest/tutorial.html)
- [CLI user guide](https://phenopackets.github.io/phenopacket-tools/latest/cli.html)
- [Library user guide](https://phenopackets.github.io/phenopacket-tools/latest)
- [Javadoc API documentation](https://phenopackets.github.io/phenopacket-tools/latest/apidocs)

## Issues

Expand Down
19 changes: 1 addition & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

#############
# JR added:
import os
import sys

sys.path.insert(0, os.path.abspath('../../'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx_rtd_theme',
'recommonmark'
]

html_theme = 'sphinx_rtd_theme'
##############

project = 'phenopacket-tools'
copyright = '2022, Daniel Danis, Peter Robinson'
author = u'Daniel Danis, Peter Robinson'
Expand All @@ -33,7 +17,7 @@
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.0-RC3'
release = '1.0.0-RC4-SNAPSHOT'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand All @@ -48,7 +32,6 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
html_static_path = ['_static']
html_css_files = ['pxftools.css']

Expand Down
2 changes: 1 addition & 1 deletion docs/converting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ See also
^^^^^^^^

The API documentation of the conversion functionality is located in the
`org.phenopackets.phenopackettools.converter <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.converter/module-summary.html>`_
`org.phenopackets.phenopackettools.converter <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.converter/module-summary.html>`_
module.
6 changes: 3 additions & 3 deletions docs/creating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ of the phenopacket framework will want to use a recommended set of ontology term
the equivalent message.

This section exemplifies usage of `PhenotypicFeatureBuilder`, one of many builders provided by the
`org.phenopackets.phenopackettools.builder <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.builder/module-summary.html>`_
`org.phenopackets.phenopackettools.builder <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.builder/module-summary.html>`_
module.


Expand Down Expand Up @@ -89,12 +89,12 @@ See also
========

See the API documentation of the
`org.phenopackets.phenopackettools.builder <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.builder/module-summary.html>`_
`org.phenopackets.phenopackettools.builder <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.builder/module-summary.html>`_
module for a comprehensive list of ontology constants, convenience methods, and builders provided
by the *phenopacket-tools* library.

Several detailed examples are available in the ``phenopackets-tools-cli`` module in the
`org.phenopackets.phenopackettools.cli.examples <https://github.com/phenopackets/phenopacket-tools/tree/main/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/examples>`_
`org.phenopackets.phenopackettools.cli.examples <https://phenopackets.github.io/phenopacket-tools/tree/main/phenopacket-tools-cli/src/main/java/org/phenopackets/phenopackettools/cli/examples>`_
package.

.. _Protocol Buffer (protobuf): https://developers.google.com/protocol-buffers
22 changes: 18 additions & 4 deletions docs/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ and the discovered issues (if any):


The API documentation of the core validation API can be found in the
`org.phenopackets.phenopackettools.validator.core <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/module-summary.html>`_
`org.phenopackets.phenopackettools.validator.core <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/module-summary.html>`_
module.


Expand Down Expand Up @@ -327,7 +327,7 @@ because an annotation with a specific HPO term (e.g., a patient with perimembran

In this section, we describe validators that use HPO file to perform several checks that can be useful in many contexts.
The API documentation and the corresponding Java classes can be found in
`org.phenopackets.phenopackettools.validator.core.phenotype <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/org/phenopackets/phenopackettools/validator/core/phenotype/package-summary.html>`_
`org.phenopackets.phenopackettools.validator.core.phenotype <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/org/phenopackets/phenopackettools/validator/core/phenotype/package-summary.html>`_
package.


Expand All @@ -353,6 +353,20 @@ library to parse the HPO JSON file. The `OntologyLoader` is part of
`phenol-io <https://mvnrepository.com/artifact/org.monarchinitiative.phenol/phenol-io>`_ module, you may need to add
an appropriate dependency into your build file.

.. _rstuniquephenotypevalidation:

Unique phenotypic features
##########################

The `HpoUniqueValidator` checks if the HPO terms used by a phenopacket are *unique* - present at most once.
If a term is not unique, the validator points this out along with the term's occurrence count.

In code, we add the corresponding validator into the validation workflow by running:

.. code-block:: java

builder.addValidator(HpoPhenotypeValidators.Unique.phenopacketValidator(hpo));


.. _rstancestryphenotypevalidation:

Expand Down Expand Up @@ -432,7 +446,7 @@ See also
^^^^^^^^

Check out the
`org.phenopackets.phenopackettools.validator.core <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/module-summary.html>`_
`org.phenopackets.phenopackettools.validator.core <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.core/module-summary.html>`_
and
`org.phenopackets.phenopackettools.validator.jsonschema <http://phenopackets.org/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.jsonschema/module-summary.html>`_
`org.phenopackets.phenopackettools.validator.jsonschema <https://phenopackets.github.io/phenopacket-tools/apidocs/org.phenopackets.phenopackettools.validator.jsonschema/module-summary.html>`_
modules for more information regarding the public validation API.
2 changes: 1 addition & 1 deletion phenopacket-tools-builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.phenopackets.phenopackettools</groupId>
<artifactId>phenopacket-tools</artifactId>
<version>1.0.0-RC3</version>
<version>1.0.0-RC4-SNAPSHOT</version>
</parent>

<artifactId>phenopacket-tools-builder</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public VariationDescriptorBuilder transcript() {
return this;
}

public VariationDescriptorBuilder moleculeContext(MoleculeContext context) {
builder.setMoleculeContext(context);
return this;
}

public VariationDescriptorBuilder structuralType(OntologyClass structuralType) {
builder.setStructuralType(structuralType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

import org.ga4gh.vrsatile.v1.VcfRecord;

import java.util.ArrayList;
import java.util.List;

public class VcfRecordBuilder {

private final VcfRecord.Builder builder;
private boolean passIsSet = false;
private List<String> filters = null;

private VcfRecordBuilder(String assembly, String chromosome, int position, String ref, String alt) {
builder = VcfRecord.newBuilder()
Expand Down Expand Up @@ -48,18 +53,46 @@ public VcfRecordBuilder qual(String qual) {
}

/**
* If this method is called, "PASS" is added to the FILTER column
* If this method is called, the FILTER column is set to "PASS" and any other previously added filters are cleared.
* Calling {@code pass()} is equivalent to calling <code>filter("PASS")</code>.
*/
public VcfRecordBuilder pass() {
builder.setFilter("PASS");
public synchronized VcfRecordBuilder pass() {
passIsSet = true;
if (filters != null)
filters.clear();

return this;
}

/**
* @param filter FILTER field of VCF. calling {@link #pass()} is equivant to calling filter("PASS)
* Add a VCF filter field.
* <p>
* The field can be a single value (e.g. <code>q50</code>) or several values joined by <code>;</code> (e.g. <code>q10;q50</code>).
* <p>
* Calling <code>filter("PASS")</code> is equivalent to calling {@link #pass()}. As a side effect,
* all previously added filter values are removed.
*
* @param filter add a FILTER field.
* @see #pass()
*/
public VcfRecordBuilder filter(String filter) {
builder.setFilter(filter);
public synchronized VcfRecordBuilder filter(String filter) {
passIsSet = false;
if (filters == null)
filters = new ArrayList<>();

if ("PASS".equalsIgnoreCase(filter))
return pass();
else {
if (filter.contains(";")) {
for (String field : filter.split(";")) {
String trimmed = field.trim();
if (!trimmed.isEmpty())
this.filter(field);
}
} else
filters.add(filter);
}

return this;
}

Expand All @@ -71,7 +104,13 @@ public VcfRecordBuilder info(String info) {
return this;
}

public VcfRecord build() {
public synchronized VcfRecord build() {
if (passIsSet)
builder.setFilter("PASS");

else if (filters != null && !filters.isEmpty())
builder.setFilter(String.join(";", filters));

return builder.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.phenopackets.phenopackettools.builder.builders;

import org.ga4gh.vrsatile.v1.VcfRecord;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

public class VcfRecordBuilderTest {

@ParameterizedTest
@CsvSource({
"PASS, PASS",
"pass, PASS",
"q50, q50",
"q50;q10, q50;q10",
"q50;pass, PASS",
"pass;q50, q50",
})
public void addFilter(String filter, String expected) {
VcfRecord record = VcfRecordBuilder.builder("GRCh37", "chr1", 123_456, "C", "G")
.filter(filter)
.build();

assertThat(record.getFilter(), equalTo(expected));
}
}
2 changes: 1 addition & 1 deletion phenopacket-tools-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.phenopackets.phenopackettools</groupId>
<artifactId>phenopacket-tools</artifactId>
<version>1.0.0-RC3</version>
<version>1.0.0-RC4-SNAPSHOT</version>
</parent>

<artifactId>phenopacket-tools-cli</artifactId>
Expand Down
Loading