egonw / bacting

Bacting is an open-source platform for chemo- and bioinformatics based on Bioclipse that defines a number of common domain objects and wraps common functionality, providing a toolkit independent, scriptable solution to handle data from the life sciences.
Other
14 stars 5 forks source link
bioclipse bioinformatics blueobelisk cheminformatics excel hacktoberfest rdf

Bacting

License DOI build Maven Central codecov

Bacting := acting as the Bioclipse TNG (The Next Generation)

Bacting is an open-source platform for chemo- and bioinformatics based on Bioclipse that defines a number of common domain objects and wraps common functionality, providing a toolkit independent, scriptable solution to handle data from the life sciences. Like Bioclipse, Bacting is written in the Java language, making use in Java-derived languages like Groovy easy, but also accessible to Python. Deposition of the Bacting package on Maven Central allows it to be easily used in Groovy scripts with @Grab instructions.

How to cite

If you use this software, please cite the article in JOSS:

DOI

Install

For the below use cases, Bacting is actually installed on demand. In Groovy this is done with @Grab and in Python with from pybacting import cdk (see pybacting) or scyjava.config. This section explains how Bacting can be installed from the source code.

From the source code

First, you need a working Maven installation and the code is tested with Java 11, 17, and 19, and can be installed with:

mvn clean install -Dgpg.skip -Dmaven.javadoc.skip=true

Making releases

Before making a release, update the version number in this README.md and in CITATION.cff.

Releases are created by the release manager and requires permission to submit the release to Maven Central (using an approved Sonatype (oss.sonatype.org) account). If these requirements are fulfilled then the following commands to the job:

export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
mvn versions:set -DnewVersion=1.0.3
git commit -m "New release" -a
mvn deploy -P release

Making snapshots

mvn versions:set -DnewVersion=1.0.4-SNAPSHOT
mvn deploy

Updating the JavaDoc

After the release is avaiable on Maven Central, the JavaDoc needs to be updated. The JavaDoc is generated with the below command, and the results are stored in the target/site/apidocs/ folder:

mvn clean javadoc:javadoc javadoc:aggregate

That created content needs to be copied into the docs/ folder of this git repository.

Usage

Groovy

It can be used in Groovy by including the Bacting managers you need. The following example tells Groovy to download the CDKManager and instantiate it for the given workspace location (as it if was running in Bioclipse itself), and then converts a SMILES string to a Bioclipse IMolecule data object:

@Grab(group='io.github.egonw.bacting', module='managers-cdk', version='1.0.3')

workspaceRoot = "."
def cdk = new net.bioclipse.managers.CDKManager(workspaceRoot);

println cdk.fromSMILES("COC")

Python

Bacting can also be used in Python 3.7 with pybacting and scyjava.

Pybacting

Pybacting can be installed with pip install pybacting (or pip3, depending on your platform). The above code example looks like:

from pybacting import cdk

print(cdk.fromSMILES("COC"))

Pybacting uses a specific Bacting version, so check the website to see which Bacting version you are using.

Scyjava

Scyjava can be installed with pip install scyjava (or pip3, depending on your platform). The code example looks like:

from scyjava import config, jimport
config.add_endpoints('io.github.egonw.bacting:managers-cdk:1.0.3')

workspaceRoot = "."
cdkClass = jimport("net.bioclipse.managers.CDKManager")
cdk = cdkClass(workspaceRoot)

print(cdk.fromSMILES("COC"))

Code examples

Full code examples can be found in the following sources:

API Coverage

For the time being, the coverage of the original API is incomplete. Particularly, manager functionality around graphical UX in the original Bioclipse may never be implemented. Each Bacting release will implement more APIs and the release notes will mention which managers and which methods have been added. An overview of the supports APIs can be found in this overview.

For a description of the API, I refer to the book A lot of Bioclipse Scripting Language examples that Jonathan and I compiled. However, a JavaDoc API is also available.

All Bacting scripts will be backwards compatible with Bioclipse. If you want to install Bioclipse and see its wonderful UX in actions, download Bioclipse 2.6.2 here.

Using SNAPSHOT versions

You may need to occassionally delete the modules cached by Groovy, by doing something like, to remove earlier SNAPSHOT versions:

\rm -Rf ~/.groovy/grapes/io.github.egonw.bacting/

Copyright and authors

Code in this repository contains mostly code that originated from Bioclipse and the headers of the individual source code files describe who contributed to that code of that class, but unfortunately this code ownership is not always clear. I refer to the various Bioclipse code repositories for the git history for detailed information.