Skip to content

Commit

Permalink
clean out repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmoho committed Aug 7, 2024
1 parent eeff80e commit 60e3007
Show file tree
Hide file tree
Showing 204 changed files with 4,412 additions and 7,572 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/gradle_build_test.yml

This file was deleted.

26 changes: 14 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
*.class
*.dump
.classpath
.gradle/
.idea/
.settings/
.classpath
.project
/build/
/target/
src/main/resources/edu/ucsd/sbrg/identifiersOrgRegistry/IdentifiersOrg-Registry.json
/src/scripts/ModelPolisherTemplate.*
ModelPolisher.iml
jsbml.log
.settings/
/.DS_Store
/.vscode/
/bin
/build/
/gradle
/lib
/minimalSysBio.xml
/model_polisher.log
/out
/src/main/resources/edu/ucsd/sbrg/example_models/output
/src/scripts/ModelPolisherTemplate.*
/src/test/resources/edu/ucsd/sbrg/bigg/e_coli_core.zip
*.class
/bin
/.vscode/
*.dump
/target/
ModelPolisher.iml
jsbml.log
src/main/resources/edu/ucsd/sbrg/identifiersOrgRegistry/IdentifiersOrg-Registry.json
8 changes: 2 additions & 6 deletions docker/java_docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM openjdk:11-slim
FROM openjdk:17-slim

# Set the maintainer email for the image
LABEL maintainer="[email protected]"
LABEL maintainer="[email protected]"

# Copy the ModelPolisher jar file into the root directory of the image
COPY ModelPolisher-2.1.jar /

# Create necessary directories for Java preferences and set permissions
# Reference: https://stackoverflow.com/a/23961144
RUN mkdir -p /.java/.systemPrefs && mkdir /.java/.userPrefs && chmod -R 777 /.java

# Set the container to run the ModelPolisher jar file as the default executable
ENTRYPOINT ["java", "-jar", "/ModelPolisher-2.1.jar"]

Expand Down
146 changes: 76 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,103 @@
# ModelPolisher
**Annotating Systems Biology Models**

<img align="right" src="doc/img/ModelPolisherIcon256.png" width="64"/>
<img align="right" src="public/img/ModelPolisherIcon256.png" width="64"/>

*Authors:* [Andreas Dräger](https://github.com/draeger/), [Thomas J. Zajac](https://github.com/mephenor/), [Matthias König](https://github.com/matthiaskoenig), [Kaustubh Trivedi](https://github.com/codekaust)

[![Build Status](https://travis-ci.org/draeger-lab/ModelPolisher.svg?branch=master?style=plastic)](https://travis-ci.org/draeger-lab/ModelPolisher)
[![Stable version](https://img.shields.io/badge/Stable_version-2.0-brightgreen.svg?style=plastic)](https://github.com/draeger-lab/ModelPolisher/releases/)
[![Stable version](https://img.shields.io/badge/Stable_version-2.1-brightgreen.svg?style=plastic)](https://github.com/draeger-lab/ModelPolisher/releases/)
[![DOI](http://img.shields.io/badge/DOI-10.1371%20%2F%20journal.pone.0149263-blue.svg?style=plastic)](https://doi.org/10.1371/journal.pone.0149263)
[![License (MIT)](https://img.shields.io/badge/license-MIT-blue.svg?style=plastic)](http://opensource.org/licenses/MIT)

ModelPolisher accesses the [BiGG Models knowledgebase](http://bigg.ucsd.edu) to annotate and autocomplete [SBML](http://sbml.org) models.
Thereby, the program mainly relies on [BiGG identifiers](https://github.com/SBRG/bigg_models/wiki/BiGG-Models-ID-Specification-and-Guidelines) for model components.
Moreover, it fixes some apparent errors in the models and uses mappings from [AnnotateDB](https://github.com/matthiaskoenig/annotatedb) to further add annotations.
ModelPolisher is a simple single-purpose automated curation tool for SBML models.
It

- improves the adherence to FAIR data standards as practiced in the SBML modelling community,
- implements non-binding best practices as defined by the [SBML specification]() documents,
- adds MIRIAM-style semantic annotations to models, using the [BiGG Models knowledgebase](http://bigg.ucsd.edu) and [AnnotateDB]().

You can find comprehensive documentation on what ModelPolisher does in [our Wiki](https://github.com/draeger-lab/ModelPolisher/wiki).

Furthermore, it can, on a best effort basis, attempt to perform minimal fixes on a model to make it valid with regards to the [SBMLValidator]().
Note however, that it will not perform curation on a model that cannot be brought into a valid state.

Again, you find comprehensive documentation on this in [our Wiki](https://github.com/draeger-lab/ModelPolisher/wiki).

Currently supported versions of the SBML standard are:

ModelPolisher is primarily a command-line based tool. You can run ModelPolisher locally [using `Docker`](#using-docker) or using your installation of BiGG Models database (see https://github.com/SBRG/bigg_models).
- Version 3 Level 1
- FBC Version 2

You can use ModelPolisher as a tool via its [Python API client]() to our HTTP server, or locally using Docker or as a Standalone JAR.

ModelPolisher can also be used as a Java library, building on the [JSBML]() project.

# Table of Contents

* [Usage Notes](#run-ModelPolisher)
* [Performance](#performance)
* [Using ModelPolisher as a Tool](#using-modelpolisher-as-a-tool)
* [Parameters](#parameters)
* [Using the Python API package](#using-the-python-api-client-
package)
* [Using Docker](#using-docker)
* [Using ModelPolisher jar](#using-jar)
* [How to cite ModelPolisher?](#cite-ModelPolisher)
* [Using ModelPolisher Jar](#using-modepolisher-jar)
* [Using ModelPolisher as a Java library](#using-modelpolisher-as-a-java-library)
* [How to cite ModelPolisher](#how-to-cite-ModelPolisher)
* [Licenses](#licenses)

# <a name="run-ModelPolisher"></a>Usage Notes
# Performance
We have run ModelPolisher on all models in the BiGG Database and on 3000 models available on Biomodels. Furthermore, we have evaluated it's performance on newly generated models using [CarveMe](), [Reconstructor]() and the [KBase Create Metabolic Model App](), with regards to [MEMOTE]() scores.

We recommend users to run ModelPolisher [using `docker`](#using-docker), though ModelPolisher can be run [from ModelPolisher `jar`](#using-jar), which is preferred for developers.
Here you can see a brief overview of its impact:

NOTE: ModelPolisher provides various command line arguments which can be seen using arguments `-?` and `--help`:
```
java -jar <path>/ModelPolisher/target/ModelPolisher-2.1.jar -?
```
You can find a more detailed analysis in [our Wiki]().

See further documentation on the most important arguments here [here](https://github.com/draeger-lab/ModelPolisher/wiki/Command-Line-Arguments).
# Using ModelPolisher as a Tool
We recommend users to either use the [Python API client package](#using-the-python-api-client-package) or run ModelPolisher [using `docker`](#using-docker).

## <a name="using-docker"></a>Using Docker
ModelPolisher can be run in docker containers. This allows user to skip the build process, and database setup required to run ModelPolisher. Please install `docker` and `docker-compose`, if not installed already.
However, ModelPolisher can also be run [from the ModelPolisher `Jar`](#using-jar).

Clone ModelPolisher and change directory to ModelPolisher/:
```
git clone https://github.com/draeger-lab/ModelPolisher/
cd <path>/ModelPolisher
```
Now, bring up docker containers required for ModelPolisher(NOTE: You must be in `ModelPolisher/` directory):
```
docker-compose up
```
## Using the Python API client package
If you don't want to process large numbers of models and have an internet connection available, this is the recommended usage.

We recommend using docker-compose in non-detached mode when building containers for first time. If you have previously built ModelPolisher containers use `docker-compose up --detach`.
ModelPolisher is hosted as an HTTP server at [biodata.informatik.uni-halle.de/modelling/polisher](biodata.informatik.uni-halle.de/modelling/polisher).

NOTE: Once database backend is set-up by `docker-compose`, the databases are also available at following ports for `localhost`:
- AnnotateDB: `1013`
- BiGGDB: `1310`
We provide a [Python API client package](https://github.com/draeger-lab/MPClient) (available on PyPI) for interaction with the server. All documentation regarding usage of the API client can be found in that repository.

On running these commands, databases will be restored in respective containers. After databases are successfully set up, use the following command (in `ModelPolisher/` directory) to run ModelPolisher:
```
docker-compose run -v <path_directory_containing_models>:/models/ polisher --input=/models/<model_name> --output=/models/output/<output_name> --annotate-with-bigg=true --add-adb-annotations=true --output-combine=true
```
## Using ModelPolisher Locally
ModelPolisher can also be run locally.

Note: You must pass *absolute path for host directory*. This command will mount volume `<path_directory_having_models>` to `/models/` in container. Thus, outputs will be produced in directory `<path_directory_having_models>/output`.
If you want to process a large number of models, or you don't feel comfortable using the Python API client package, this is the recommendend usage.

User may use `-u <username_or_uid>` with `docker-compose run` in above command to generate output with correct ownership. Preferably use uid (obtained by `id -u <username>`) due to some existing bugs in docker.
### Parameters
Parameters can be passed via a [json file](https://github.com/draeger-lab/ModelPolisher/wiki/Parameters#json-file) or as [command line arguments]((https://github.com/draeger-lab/ModelPolisher/wiki/Parameters#command-line-arguments)).

To bring down the containers, you can run `docker-compose stop`. This will only stop the containers but won't delete them. Otherwise, you can use `docker-compose down -v` to stop and remove all containers and related volumes.
### Using Docker
ModelPolisher is provided as a [Docker image]().

Note: `docker-compose down -v` will cause all databases to be restored again on running `docker-compose up`, as restored databases exist in containers not in images.
This repository contains a [`docker-compose.yml`](./docker-compose.yml) which also sets up [BiGG DB]() and [AnnotateDB]() as Docker containers, to support the [annotation functionality](https://github.com/draeger-lab/ModelPolisher/wiki/Annotation).

Using `docker` might cause system space to be filled up, and `docker-compose up` may fail due to insufficient space. Use the following commands if there is need to empty space used by ModelPolisher_docker:
```
docker stop modelpolisher_biggdb modelpolisher_adb modelpolisher_java
docker rm modelpolisher_biggdb modelpolisher_adb modelpolisher_java
docker rmi modelpolisher_java:latest modelpolisher_adb:latest modelpolisher_biggdb:latest postgres:11.4 openjdk:11-slim
docker volume prune
For a single model file, you can use
``` shell
docker-compose run \
-v <absolute_path_to_directory_containing_models>:/models/ \
polisher \
--input=/models/<model_name> \
--output=/models/output/<output_name> \
--annotate-with-bigg=true \
--add-adb-annotations=true \
--output-combine=true
```

#### <a name="non-release">Using a non-release jar with Docker</a>
Output will be produced in directory `<absolute_path_to_directory_containing_models>/output`.

Building using `gradle devel` builds a container with the local ModelPolisher jar.
This container can be used analogously to the release version, though either `-f docker-compose.devel.yml` needs to be
passed to each invocation of `docker-compose` or the `COMPOSE_FILE` environment variable needs to be set so it points
to `docker-compose.devel.yml`, e.g. using `export COMPOSE_FILE=docker-compose.devel.yml` for sh or bash.
*Note*: It is always recommended to [run Docker as your current user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) and not as root. Running as root will produce root-owned output. Users can use `-u <username_or_uid>` with `docker-compose run` to generate output with correct ownership in this case.

## <a name="using-jar"></a>Using ModelPolisher jar
For polishing models, you essentially need to run ModelPolisher using `jar` produced from [build instructions](#build-instructions).
### Using ModelPolisher Jar
You can run ModelPolisher using its `Jar `.
See [Releases](https://github.com/draeger-lab/ModelPolisher/releases/latest) for downloads of stable versions of standalone Jars and the [Parameters](https://github.com/draeger-lab/ModelPolisher/wiki/Parameters) Wiki page for documentation of the input parameters.

User needs to host the [BiGG](https://github.com/SBRG/bigg_models) Database & [AnnotateDB](https://github.com/matthiaskoenig/annotatedb) on `PostgreSQL` on your local system.
If the [annotation functionality](https://github.com/draeger-lab/ModelPolisher/wiki/Annotation) is required, users need to provide connections to the [BiGG](https://github.com/SBRG/bigg_models) Database and/or [AnnotateDB](https://github.com/matthiaskoenig/annotatedb) as `PostgreSQL` databases.

Now, you can run the following command in general:
This can be achieved like this:
```
java -jar "<path>/ModelPolisher/target/ModelPolisher-2.1.jar" \
--input=<input> \
Expand All @@ -107,22 +117,18 @@ java -jar "<path>/ModelPolisher/target/ModelPolisher-2.1.jar" \
--adb-passwd=<user_password>
```

We understand problems in setting-up database backend and that a developer would need to build ModelPolisher multiple times and making required changes in `java` Dockerfile will be a tedious task.
We recommend the following practice for developers:
1. Set up required databases by running `docker-compose up`.
2. After making required changes in codebase build `jar` by `gradle fatJar`.
3. Run the newly build jar using:
```
java -jar ./target/ModelPolisher-2.1.jar --input=<input> --output=<output> --output-combine=true --annotate-with-bigg=true --bigg-host=0.0.0.0 --bigg-port=1310 --add-adb-annotations=true --adb-host=0.0.0.0 --adb-port=1013
```
Note: All above commands must be run in `<path>/ModelPolisher/` directory and you must have installed Java `version >= 8` and Gradle `version >= 5.0`.
# <a name="cite-ModelPolisher"></a>How to cite ModelPolisher?
Note: ModelPolisher requires Java `version >= 17`.

# Using ModelPolisher as a Java library
ModelPolisher and all its dependencies are hosted on [Maven Central](). You can see our [GitHub Pages](http://draeger-lab.github.io/ModelPolisher/) for its Javadocs.

# How to cite ModelPolisher
The online version of ModelPolisher is described in this article: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0149263

The article ["BiGG Models: A platform for integrating, standardizing and sharing genome-scale models"](https://nar.oxfordjournals.org/content/44/D1/D515) describes BiGG Models knowledge-base including ModelPolisher.

# <a name="licenses"></a>Licenses

# Licenses
ModelPolisher is distributed under the MIT License (see LICENSE).
An Overview of all dependencies is provided in [THIRD-PARTY.txt](https://github.com/draeger-lab/ModelPolisher/blob/master/THIRD-PARTY.txt), their respective licenses can be found in the licenses folder.
An Overview of all dependencies is provided in [THIRD-PARTY.txt](https://github.com/draeger-lab/ModelPolisher/blob/master/THIRD-PARTY.txt), their respective licenses can be found in the [licenses](./licenses) folder.


45 changes: 5 additions & 40 deletions build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ licenseReport {

/** === Java plugin configuration === **/
// sourceCompatibility defines the version of Java for compiling the source code.
// Ensures that the Java compiler will accept Java 18 language features.
sourceCompatibility = JavaVersion.VERSION_18
// Ensures that the Java compiler will accept Java 17 language features.
sourceCompatibility = JavaVersion.VERSION_17

// targetCompatibility defines the version of Java bytecode to be generated.
// Ensures that the compiled bytecode is compatible with Java 18 JVMs.
// Implication: The generated bytecode will run on Java 18 and newer JVMs,
// Implication: The generated bytecode will run on Java 17 and newer JVMs,
// but not on older versions.
targetCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_17

/*
Logical grouping of source files and resources.
Expand Down Expand Up @@ -220,7 +220,7 @@ processResources.dependsOn(downloadMIRIAM)

// create distributable standalone JAR that includes
// not only the project's compiled classes but also all the dependencies' classes
tasks.register('uberJar', Jar) {
tasks.register('uberjar', Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

from sourceSets.main.output
Expand All @@ -230,41 +230,6 @@ tasks.register('uberJar', Jar) {
}
}

// build a Docker container image after rebuilding the JAR
tasks.register('buildDockerContainer', Exec) {
commandLine "sh", "-c", "cp target/ModelPolisher-" + project.version + ".jar docker/java_docker && " +
"export COMPOSE_FILE=docker-compose.devel.yml && " +
"docker-compose pull && " +
"docker-compose build && " +
"rm docker/java_docker/ModelPolisher-" + project.version + ".jar"
dependsOn uberJar
}

// bump jar version in ModelPolisher.sh
if (project.file( "src/scripts/ModelPolisher.sh").exists()) {
tasks.register('bumpVersionMP') {
replaceVersion(rootProject.projectDir.toString() + "/docker/java_docker/Dockerfile")
replaceVersion(rootProject.projectDir.toString() + "/README.md")
replaceVersion(rootProject.projectDir.toString() + "/src/scripts/ModelPolisher.sh")
}
processResources.dependsOn bumpVersionMP
}

def replaceVersion(String path) {
ArrayList<String> content = new ArrayList<>()
File file = new File(path)
String MPVersion = /ModelPolisher-(.*?)\d{1,2}(.\d{1,2}){1,2}(-beta)?.jar/
file.eachLine {
line ->
content.add(line.replaceAll(MPVersion, "ModelPolisher-" + "${version}.jar"))
}
BufferedWriter writer = new BufferedWriter(new FileWriter(file))
content.each {
line -> writer.writeLine(line)
}
writer.close()
}

/*
=== Application Plugin configuration
*/
Expand Down
3 changes: 0 additions & 3 deletions dependency-licenses.txt

This file was deleted.

Loading

0 comments on commit 60e3007

Please sign in to comment.