Skip to content

Commit 7a76d40

Browse files
committed
Merge branch 'develop'
2 parents 1f7109b + d44032b commit 7a76d40

File tree

172 files changed

+38667
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+38667
-257
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to Sonatype Central
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger the workflow when a tag starting with 'v' is pushed, like v1.0.0
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v5
18+
with:
19+
java-version: '21'
20+
distribution: 'adopt'
21+
22+
- name: Cache Maven dependencies
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
30+
- name: Import GPG key
31+
run: |
32+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --armor --batch --no-tty
33+
34+
- name: Setup Maven settings
35+
run: |
36+
rm ${HOME}/.m2/settings.xml
37+
38+
cat << EOF > ${HOME}/.m2/settings.xml
39+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
40+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
41+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
42+
<servers>
43+
<server>
44+
<id>central</id>
45+
<username>${{ secrets.SONATYPE_USERNAME }}</username>
46+
<password>${{ secrets.SONATYPE_PASSWORD }}</password>
47+
</server>
48+
</servers>
49+
</settings>
50+
EOF
51+
52+
- name: Deploy to Sonatype Central
53+
run: |
54+
./mvnw clean deploy --batch-mode -Prelease \
55+
-Dgpg.keyname=${{ secrets.GPG_KEY_ID }}

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: Build with Maven
4747
run: ./mvnw -pl boqa-cli,boqa-core -am -B --quiet -Prelease --batch-mode package
4848
- name: Run CLI
49-
run: java -jar boqa-cli/target/boqa-cli-0.1.0-SNAPSHOT.jar --help
49+
run: java -jar boqa-cli/target/boqa-cli-0.1.0.jar --help

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ hs_err_pid*
1313
target/
1414
*.iml
1515
*.log
16-
data/
16+
boqa_info.*.gz
17+
/data/
1718
dev/
1819
results/
1920
dependency-reduced-pom.xml
2021
.settings
2122
.project
2223
.classpath
24+
boqacore.*.gz
2325

2426
docs/_build/

LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
11
# BOQA
22

3-
Bayesian Ontology Query Analysis
4-
5-
## Local setup
6-
7-
The project uses Exomiser as a library. However, Exomiser is not available from Maven central repository.
8-
Therefore, we must install Exomiser locally to be able to build the code.
9-
10-
The installation proceeds as follows:
11-
12-
```shell
13-
# First, let's check out Exomiser source code
14-
git clone https://github.com/exomiser/Exomiser.git
15-
16-
# Check out the version we use
17-
cd Exomiser
18-
git checkout 14.1.0
19-
20-
# Make mvnw executable
21-
chmod u+x mvnw
22-
23-
# Install Exomiser locally
24-
./mvnw install
25-
```
26-
27-
This should install Exomiser into local Maven repository, and it should be possible to build the project.
28-
29-
> **Note:** To only build the `boqa-cli` and `boqa-core` modules Exomiser is not needed. This can be done via
30-
```shell
31-
./mvnw -pl boqa-cli,boqa-core -am -Prelease package
32-
```
3+
Bayesian Ontology Query Algorithm
334

345
## Run tests
356

@@ -38,17 +9,6 @@ We use Maven Surefire plugin to run tests:
389
```shell
3910
./mvnw test
4011
```
41-
42-
## Run CLI
43-
44-
Run the following to run the CLI:
45-
46-
```shell
47-
./mvnw -Prelease package
48-
49-
java -jar boqa-cli/target/boqa-cli-0.1.0-SNAPSHOT.jar --help
50-
```
51-
5212
## Distribute CLI
5313

5414
The compilation of JAR files, generation of sources and Javadoc, as well as packaging into distribution ZIP file
@@ -57,31 +17,29 @@ requires activation of the `release` profile:
5717
```shell
5818
./mvnw -Prelease package
5919
```
60-
6120
## Input data
6221

6322
In BOQA analyses, observed phenotypic features of individuals are compared
6423
with annotated disease-phenotype associations.
65-
We use the following HPO data sources:
24+
We use the following [HPO resources](https://github.com/obophenotype/human-phenotype-ontology):
6625

6726
**1. Disease-phenotype associations: `phenotype.hpoa`**
6827

69-
```
70-
mkdir -p data
71-
wget -O data/phenotype.hpoa https://github.com/obophenotype/human-phenotype-ontology/releases/latest/download/phenotype.hpoa
72-
```
73-
7428
**2. HPO: `hp.json`**
7529

76-
```
77-
wget -O data/hp.json https://github.com/obophenotype/human-phenotype-ontology/releases/latest/download/hp.json
78-
```
79-
80-
**3. Disease-gene associations: `phenotype.hpoa`**
30+
**3. Disease-gene associations: `genes_to_disease.txt`**
8131

32+
Use the following command to download these files from the latest release:
33+
```shell
34+
java -jar boqa-cli/target/boqa-cli-0.1.0.jar download -d ./data
8235
```
83-
wget -O data/genes_to_disease.txt https://github.com/obophenotype/human-phenotype-ontology/releases/latest/download/genes_to_disease.txt
36+
The files are downloaded to a subdirectory `./data/latest_<time_stamp>`.
37+
38+
To download a specific release, use the following command;
39+
```shell
40+
java -jar boqa-cli/target/boqa-cli-0.1.0.jar download -d ./data -r v2025-05-06
8441
```
42+
The files are downloaded into a subdirectory of `./data` named after the release.
8543

8644
**4. Phenopackets containing phenotypic features observed in individuals: `phenopacket-store`**
8745

@@ -90,6 +48,12 @@ wget -O data/all_phenopackets.zip https://github.com/monarch-initiative/phenopac
9048
unzip data/all_phenopackets.zip -d data
9149
```
9250

93-
## TODO
51+
## Run CLI
52+
53+
Run the following to run the CLI:
9454

95-
Add more information at some point.
55+
```shell
56+
./mvnw -Prelease package
57+
58+
java -jar boqa-cli/target/boqa-cli-0.1.0.jar --help
59+
```

boqa-cli/pom.xml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
7-
<groupId>com.github.p2gx.boqa</groupId>
7+
<groupId>io.github.p2gx.boqa</groupId>
88
<artifactId>BOQA</artifactId>
9-
<version>0.1.0-SNAPSHOT</version>
9+
<version>0.1.0</version>
1010
</parent>
1111

1212
<artifactId>boqa-cli</artifactId>
1313

1414
<dependencies>
1515
<dependency>
16-
<groupId>com.github.p2gx.boqa</groupId>
16+
<groupId>io.github.p2gx.boqa</groupId>
1717
<artifactId>boqa-core</artifactId>
1818
<version>${project.parent.version}</version>
1919
</dependency>
@@ -22,6 +22,20 @@
2222
<groupId>info.picocli</groupId>
2323
<artifactId>picocli</artifactId>
2424
</dependency>
25+
<dependency>
26+
<groupId>org.monarchinitiative.biodownload</groupId>
27+
<artifactId>biodownload</artifactId>
28+
<version>1.0.1</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>net.lingala.zip4j</groupId>
32+
<artifactId>zip4j</artifactId>
33+
<version>2.11.5</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>ch.qos.logback</groupId>
37+
<artifactId>logback-classic</artifactId>
38+
</dependency>
2539
</dependencies>
2640

2741

@@ -49,7 +63,7 @@
4963
<addClasspath>true</addClasspath>
5064
<classpathPrefix>lib/</classpathPrefix>
5165
<useUniqueVersions>false</useUniqueVersions>
52-
<mainClass>com.github.p2gx.boqa.cli.Main</mainClass>
66+
<mainClass>org.p2gx.boqa.cli.Main</mainClass>
5367
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
5468
</manifest>
5569
</archive>
@@ -98,4 +112,4 @@
98112
</profile>
99113
</profiles>
100114

101-
</project>
115+
</project>

boqa-cli/src/main/java/com/github/p2gx/boqa/cli/cmd/BaseCommand.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

boqa-cli/src/main/java/com/github/p2gx/boqa/cli/cmd/BoqaCommand.java

Lines changed: 0 additions & 62 deletions
This file was deleted.

boqa-cli/src/main/java/com/github/p2gx/boqa/cli/Main.java renamed to boqa-cli/src/main/java/org/p2gx/boqa/cli/Main.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
package com.github.p2gx.boqa.cli;
1+
package org.p2gx.boqa.cli;
22

3-
import com.github.p2gx.boqa.cli.cmd.BoqaCommand;
4-
import com.github.p2gx.boqa.cli.cmd.BlendedCommand;
3+
import org.p2gx.boqa.cli.cmd.BoqaBenchmarkCommand;
4+
import org.p2gx.boqa.cli.cmd.BlendedBenchmarkCommand;
5+
import org.p2gx.boqa.cli.cmd.DownloadCommand;
56
import picocli.CommandLine;
67
import java.util.concurrent.Callable;
78
import static picocli.CommandLine.Help.Ansi.Style.*;
89

10+
/**
11+
* Main entry point for the BOQA (Bayesian Ontology Query Analysis) command-line application.
12+
* <p>
13+
* This class configures and executes the CLI using PicoCLI framework. It sets up the main command
14+
* with three subcommands:
15+
* <ul>
16+
* <li>{@code download} - Downloads disease and phenotype data</li>
17+
* <li>{@code plain} - Runs BOQA benchmark analysis using plain scoring</li>
18+
* <li>{@code blended} - Runs BOQA benchmark analysis using blended scoring (work in progress)</li>
19+
* </ul>
20+
* The application matches phenotypic features observed in patients with annotated
21+
* disease-phenotype associations.
22+
* </p>
23+
*
24+
* @version v0.1.0
25+
*/
926
@CommandLine.Command(name = "boqa",
1027
header = "Bayesian Ontology Query Analysis (BOQA)\n",
1128
mixinStandardHelpOptions = true,
@@ -14,7 +31,7 @@
1431
footer = Main.FOOTER)
1532
public class Main implements Callable<Integer> {
1633

17-
public static final String VERSION = "v0.1.0-SNAPSHOT";
34+
public static final String VERSION = "v0.1.0";
1835
public static final int WIDTH = 120;
1936
public static final String FOOTER = "The BOQA algorithm matches phenotypic features observed in patients " +
2037
"with annotated disease-phenotype associations.";
@@ -34,8 +51,9 @@ public static void main(String[] args) {
3451

3552
CommandLine cline = new CommandLine(new Main())
3653
.setColorScheme(COLOR_SCHEME)
37-
.addSubcommand("plain", new BoqaCommand())
38-
.addSubcommand("blended", new BlendedCommand());
54+
.addSubcommand("download", new DownloadCommand())
55+
.addSubcommand("plain", new BoqaBenchmarkCommand())
56+
.addSubcommand("blended", new BlendedBenchmarkCommand());
3957
cline.setToggleBooleanFlags(false);
4058
System.exit(cline.execute(args));
4159
}

0 commit comments

Comments
 (0)