Skip to content

Commit

Permalink
Merge pull request #53 from TheJacksonLaboratory/release_v2.0.1
Browse files Browse the repository at this point in the history
Release v2.0.1
  • Loading branch information
ielis committed May 5, 2023
2 parents 6062130 + 887eab3 commit d68bd94
Show file tree
Hide file tree
Showing 33 changed files with 172 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
distribution: 'adopt'

- name: Build with Maven
run: ./mvnw --batch-mode --update-snapshots verify
run: ./mvnw --quiet --batch-mode test
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## ✈ latest
## ✈ v2.0.1

- `squirls-core`
- fix bug in allele generator leading to generation of bad splice site snippets for transcripts on negative strand
in sequence trekker

## ✈ v2.0.0

- `Squirls`
- add `squirls-bootstrap` to quickly bootstrap Squirls even without Spring
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:bionic

RUN apt-get update && apt-get upgrade && apt-get -y install openjdk-11-jre \
procps

COPY squirls-cli/target/squirls-cli-2.0.1.jar /opt/squirls/squirls-cli-2.0.1.jar
COPY docker/squirls /opt/bin/squirls
RUN chmod +x /opt/bin/squirls

ENV PATH="/opt/bin:${PATH}"
3 changes: 2 additions & 1 deletion HOW_TO_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Release checklist items:

- update `CHANGELOG.md`, sync the content of `CHANGELOG.md` and `squirls-cli/CHANGELOG.md`
- update `CHANGELOG.md`
- update version in:
- `pom.xml`
- documentation
- `org.monarchinitiative.squirls.cli.Main`
- `org.monarchinitiative.squirls.ingest.Main`
- Dockerfile
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SQUIRLS

[![GitHub release](https://img.shields.io/github/release/TheJacksonLaboratory/Squirls.svg)](https://github.com/TheJacksonLaboratory/Squirls/releases)
![Java CI with Maven](https://github.com/TheJacksonLaboratory/Squirls/workflows/Java%20CI%20with%20Maven/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/squirls/badge/?version=latest)](https://squirls.readthedocs.io/en/master/?badge=master)

Expand Down
3 changes: 3 additions & 0 deletions docker/squirls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
SQUIRLS_JAR=/opt/squirls/squirls-cli-2.0.0.jar
java -jar ${SQUIRLS_JAR} ${@}
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
# -- Project information -----------------------------------------------------

project = 'Squirls'
copyright = '2022, Daniel Danis, Peter N Robinson'
copyright = '2023, Daniel Danis, Peter N Robinson'
author = 'Daniel Danis, Peter N Robinson'

# The short X.Y version
version = '2.0'
# The full version, including alpha/beta/rc tags
release = 'v2.0.0'
release = 'v2.0.1'


# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Squirls reports scores in four columns:
- maximum Squirls pathogenicity prediction rounded up to 3 significant digits
- Squirls pathogenicity predictions calculated for each transcript the variant overlaps with

.. note::
The options ``--output-format``, ``--n-variants-to-report``, ``--out-dir``, ``--report-features`` are ignored.

``annotate-csv`` - Annotate variant positions stored in a CSV file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -74,9 +76,9 @@ To annotate more than just a few variant positions, it may be more convenient to
Let's run the ``annotate-csv`` command to annotate four variants stored in the `example.csv`_ file
(an example CSV file with 4 variants stored in Squirls repository)::

java -jar squirls-cli.jar annotate-csv -d $SQUIRLS_DATA example.csv path/to/output/file
java -jar squirls-cli.jar annotate-csv -d $SQUIRLS_DATA example.csv output

Squirls reads the variants and stores the scores into ``path/to/output/file.html`` file. The *HTML* is the default output format,
Squirls reads the variants and stores the scores into ``output.html`` file. The *HTML* is the default output format,
see :ref:`rstoutputformats` section for more details.

Mandatory arguments
Expand All @@ -100,6 +102,7 @@ In addition to the mandatory arguments, Squirls allows to fine tune the annotati
in all output formats. Default: ``html``
* ``-n, --n-variants-to-report`` - number of most pathogenic variants to include in *HTML* report. The option has
no effect on *VCF* output format. Default: ``100``
* ``--out-dir`` - path to folder where to write the output files. Default: current working directory
* ``--report-features`` - include Squirls features into the output. Default: ``false``
* ``-t | --transcript-source`` - transcript source to use. Choose one of ``{REFSEQ, ENSEMBL, UCSC}``. Default: ``REFSEQ``
* ``--threads`` - process variants on *n* threads. Default: ``2``
Expand Down Expand Up @@ -137,6 +140,7 @@ In addition to the mandatory arguments, Squirls allows to fine tune the annotati
in all output formats. Default: ``html``
* ``-n, --n-variants-to-report`` - number of most pathogenic variants to include in *HTML* report. The option has
no effect on *VCF* output format. Default: ``100``
* ``--out-dir`` - path to folder where to write the output files. Default: current working directory
* ``--report-features`` - include Squirls features into the output. Default: ``false``
* ``-t | --transcript-source`` - transcript source to use. Choose one of ``{REFSEQ, ENSEMBL, UCSC}``. Default: ``REFSEQ``
* ``--threads`` - process variants on *n* threads. Default: ``2``
Expand Down
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.monarchinitiative.squirls</groupId>
<artifactId>Squirls</artifactId>
<packaging>pom</packaging>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.1</version>
<modules>
<module>squirls-core</module>
<module>squirls-io</module>
Expand Down Expand Up @@ -218,6 +218,14 @@
<artifactId>maven-wrapper-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -270,6 +278,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion squirls-bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>Squirls</artifactId>
<groupId>org.monarchinitiative.squirls</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion squirls-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>Squirls</artifactId>
<groupId>org.monarchinitiative.squirls</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
footer = Main.FOOTER)
public class Main implements Callable<Integer> {

public static final String VERSION = "squirls v1.0.1-SNAPSHOT";
public static final String VERSION = "squirls v2.0.1";

public static final int WIDTH = 120;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import org.monarchinitiative.squirls.cli.writers.*;
import picocli.CommandLine;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -97,6 +98,10 @@ public abstract class AnnotatingSquirlsCommand extends SquirlsCommand {
description = "Compress the output (default: ${DEFAULT-VALUE})")
public boolean compress = false;

@CommandLine.Option(names = {"--out-dir"},
description = "Path to folder where to write the output files (default: current working directory).")
public Path outDir = Path.of("");

@CommandLine.Option(names = {"-f", "--output-format"},
paramLabel = "html",
description = "Comma separated list of output formats to use for writing the results (default: ${DEFAULT-VALUE})")
Expand Down Expand Up @@ -133,18 +138,22 @@ protected static Collection<OutputFormat> parseOutputFormats(String outputFormat
return formats;
}

protected OutputOptions prepareOutputOptions(Path outputPrefix) throws IOException {
protected OutputOptions prepareOutputOptions(String prefix) throws IOException {
if (prefix.contains(File.separator)) {
// +1 to exclude the separator
prefix = prefix.substring(prefix.lastIndexOf(File.separator)+1);
LOGGER.warn("The prefix '{}' contains the file separator character '{}'. The CLI has changed, please provide the path to the output directory using the `--out-dir` option. Using the last part of the string as the prefix '{}'.", prefix, File.separator, prefix);
}

// Ensure the parent folders exist or explode.
if (Files.isDirectory(outputPrefix)) {
LOGGER.warn("Provided output prefix points to an existing directory. Results will be stored at {}/squirls*", outputPrefix.toAbsolutePath());
outputPrefix = outputPrefix.resolve("squirls");
if (!Files.isDirectory(outDir)) {
LOGGER.info("The output directory {} does not exist. Creating the missing directories.", outDir.toAbsolutePath());
Files.createDirectories(outDir);
}
Path parent = outputPrefix.getParent();
if (!Files.isDirectory(parent))
Files.createDirectories(parent);

return OutputOptions.builder()
.setOutputPrefix(outputPrefix)
.setOutputDirectory(outDir)
.setPrefix(prefix)
.addOutputFormats(parseOutputFormats(outputFormats))
.setCompress(compress)
.setReportFeatures(reportFeatures)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ public class AnnotateCsvCommand extends AnnotatingSquirlsCommand {
public Path inputPath;

@CommandLine.Parameters(index = "1",
paramLabel = "output",
description = "Prefix for the output files")
public Path outputPrefix = Path.of("output");
public String outputPrefix;

private static GenomicVariant parseCsvRecord(GenomicAssembly assembly, CSVRecord record) throws SquirlsException {
// parse contig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
import org.monarchinitiative.squirls.core.SquirlsResult;
import org.monarchinitiative.squirls.core.VariantSplicingEvaluator;
import org.monarchinitiative.squirls.core.reference.SplicingPwmData;
import org.monarchinitiative.squirls.io.SquirlsResourceException;
import org.monarchinitiative.svart.*;
import org.monarchinitiative.svart.assembly.GenomicAssembly;
import org.monarchinitiative.vmvt.core.VmvtGenerator;
Expand Down Expand Up @@ -134,9 +133,8 @@ public class AnnotateVcfCommand extends AnnotatingSquirlsCommand {
public Path inputPath;

@CommandLine.Parameters(index = "1",
paramLabel = "output",
description = "Prefix for the output files.")
public Path outputPrefix = Path.of("output");
public String prefix;

private static Function<VariantContext, Collection<VariantContext>> meltToSingleAltVariants() {
return vc -> {
Expand Down Expand Up @@ -318,7 +316,7 @@ public Integer call() {
.addAllVariants(annotated)
.build();

analysisResultsWriter.writeResults(results, prepareOutputOptions(outputPrefix));
analysisResultsWriter.writeResults(results, prepareOutputOptions(prefix));
} catch (Exception e) {
LOGGER.error("Error: ", e);
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void writeResults(AnalysisResults results, OutputOptions options) {
for (OutputFormat format : options.outputFormats()) {
ResultWriter writer = resultWriterForFormat(format, options.compress(), options.reportFeatures(), options.reportAllTranscripts());
try {
writer.write(results, options.outputPrefix());
writer.write(results, options);
} catch (IOException e) {
LOGGER.error("Error writing {} results: {}", format, e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ public class OutputOptions {
private final boolean reportFeatures;
private final boolean reportAllTranscripts;
private final Set<OutputFormat> outputFormats;
private final Path outputPrefix;
private final Path outputDirectory;
private final String prefix;

private OutputOptions(Builder builder) {
this.compress = builder.compress;
this.reportFeatures = builder.reportFeatures;
this.reportAllTranscripts = builder.reportAllTranscripts;
this.outputFormats = Set.copyOf(builder.outputFormats);
this.outputPrefix = Objects.requireNonNull(builder.outputPrefix);
this.outputDirectory = Objects.requireNonNull(builder.outputDirectory);
this.prefix = Objects.requireNonNull(builder.prefix);
}

public static Builder builder() {
Expand All @@ -118,21 +120,12 @@ public Set<OutputFormat> outputFormats() {
return outputFormats;
}

public Path outputPrefix() {
return outputPrefix;
public Path outputDirectory() {
return outputDirectory;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OutputOptions that = (OutputOptions) o;
return compress == that.compress && reportFeatures == that.reportFeatures && reportAllTranscripts == that.reportAllTranscripts && Objects.equals(outputFormats, that.outputFormats) && Objects.equals(outputPrefix, that.outputPrefix);
}

@Override
public int hashCode() {
return Objects.hash(compress, reportFeatures, reportAllTranscripts, outputFormats, outputPrefix);
public String prefix() {
return prefix;
}

@Override
Expand All @@ -142,7 +135,8 @@ public String toString() {
", reportFeatures=" + reportFeatures +
", reportAllTranscripts=" + reportAllTranscripts +
", outputFormats=" + outputFormats +
", outputPrefix='" + outputPrefix + '\'' +
", outputDirectory=" + outputDirectory +
", prefix='" + prefix + '\'' +
'}';
}

Expand All @@ -152,7 +146,8 @@ public static class Builder {
private boolean compress = false;
private boolean reportFeatures = false;
private boolean reportAllTranscripts = false;
private Path outputPrefix = Path.of("output");
private Path outputDirectory;
private String prefix;

private Builder() {
}
Expand All @@ -172,8 +167,13 @@ public Builder setReportAllTranscripts(boolean reportAllTranscripts) {
return this;
}

public Builder setOutputPrefix(Path outputPrefix) {
this.outputPrefix = outputPrefix;
public Builder setOutputDirectory(Path outputDirectory) {
this.outputDirectory = outputDirectory;
return this;
}

public Builder setPrefix(String prefix) {
this.prefix = prefix;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.file.Path;

/**
* Implementors write {@link AnalysisResults} in different formats.
Expand All @@ -90,5 +89,5 @@ public interface ResultWriter {

Logger LOGGER = LoggerFactory.getLogger(ResultWriter.class);

void write(AnalysisResults results, Path prefix) throws IOException;
void write(AnalysisResults results, OutputOptions outputOptions) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@
import de.charite.compbio.jannovar.annotation.VariantAnnotations;
import org.monarchinitiative.squirls.cli.visualization.SplicingVariantGraphicsGenerator;
import org.monarchinitiative.squirls.cli.visualization.VisualizableVariantAllele;
import org.monarchinitiative.squirls.cli.writers.AnalysisResults;
import org.monarchinitiative.squirls.cli.writers.OutputFormat;
import org.monarchinitiative.squirls.cli.writers.ResultWriter;
import org.monarchinitiative.squirls.cli.writers.WritableSplicingAllele;
import org.monarchinitiative.squirls.cli.writers.*;
import org.monarchinitiative.squirls.core.SquirlsResult;
import org.monarchinitiative.svart.CoordinateSystem;
import org.monarchinitiative.svart.GenomicVariant;
Expand All @@ -95,7 +92,6 @@
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Comparator;
Expand Down Expand Up @@ -141,8 +137,8 @@ private static String getRepresentation(WritableSplicingAllele writableSplicingA
}

@Override
public void write(AnalysisResults results, Path prefix) throws IOException {
Path outputPath = Paths.get(prefix.toAbsolutePath().toString() + '.' + OutputFormat.HTML.getFileExtension());
public void write(AnalysisResults results, OutputOptions outputOptions) throws IOException {
Path outputPath = outputOptions.outputDirectory().resolve(outputOptions.prefix() + '.' + OutputFormat.HTML.getFileExtension());
LOGGER.info("Writing HTML output to `{}`", outputPath);

// sort results by max squirls pathogenicity and select at most n variants
Expand Down

0 comments on commit d68bd94

Please sign in to comment.