Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve user interface #117

Merged
merged 13 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
30 changes: 12 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
name: Bug Report
about: Create a report to help improve the APE library
title: '[BUG] '
labels: 'bug'
assignees: vedran-kasalica
name: Bug report
about: Create a report to help us improve the APE library
title: ''
labels: bug
assignees: ''

---

**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report.
## Checklist before submitting a bug report

- [ ] I have checked the [existing issues](https://github.com/NLeSC/python-template/issues) and couldn't find an issue about this bug.


## Description
<!-- Provide a clear and concise description of what the bug is. -->
Expand All @@ -16,12 +19,10 @@ assignees: vedran-kasalica
<!-- Indicate whether this issue is related to the API or the CLI. -->
- [ ] API
- [ ] CLI
- [ ] REST API

## APE Version
<!-- Specify the version of APE you're using. -->

## Java Version
<!-- Specify the Java version you're using. -->
## APE and Java Version
<!-- Specify the version of APE and Java you're using. -->

## Steps to Reproduce
<!-- Provide detailed steps to reproduce the bug: -->
Expand All @@ -30,14 +31,7 @@ assignees: vedran-kasalica
3.
4.

## Expected Behavior
<!-- Describe what you expected to happen. -->

## Actual Behavior
<!-- Describe what actually happened. Include complete error messages, screenshots, or logs if possible. -->

## Possible Solution
<!-- Suggest a fix/reason for the bug, if you have one in mind. -->

## Additional Context
<!-- Add any other context about the problem here, such as special configurations, environment details, etc. -->
27 changes: 2 additions & 25 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
---
name: Feature Request
about: Suggest a new feature or enhancement for the APE library
title: '[FEATURE] '
title: ''
labels: 'enhancement'
assignees: vedran-kasalica
assignees: ''

---

**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report.

## Feature Description
<!-- Provide a clear and concise description of the feature or enhancement you're proposing. -->

## Is this feature related to a problem? Please describe.
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

## Describe the solution you'd like
<!-- A detailed description of what you want to happen. -->

## Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

## API/CLI Impact
<!-- Indicate whether this feature is related to the API, CLI, or both. -->
- [ ] API
- [ ] CLI
- [ ] Both

## Potential Benefits
<!-- Describe the potential benefits this feature would bring to APE library users, such as increased efficiency, new capabilities, or compatibility improvements. -->

## Additional Context
<!-- Add any other context or screenshots about the feature request here. -->
56 changes: 10 additions & 46 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,18 @@
---
name: Pull Request
about: Submit a pull request to contribute to the APE library
title: ''
labels: ''
assignees: vedran-kasalica

---

**Note:** Not all fields are obligatory, but the more details you provide, the easier it will be for us to address the issue. Feel free to omit sections that you feel are not relevant to your report.

## Pull Request Overview
<!-- Provide a brief overview of what this PR aims to accomplish. For instance, this could be a bug fix, feature addition, documentation update, etc. -->
<!-- Briefly describe what this PR does (e.g., bug fix, feature addition, etc.). -->

## Related Issue(s) or Pull Request(s)
<!-- Mention any related issues or previous PRs that this PR is related to or dependent on. Use the format `#issue_number` or `#PR_number` to automatically link them. -->
## Related Issue
<!-- Link the related issue using the format `#issue_number`. -->

## Changes Introduced
<!-- Provide a detailed list of the changes introduced in this PR. Break down new features, bug fixes, enhancements, and API or CLI modifications. -->

## Motivation and Context
<!-- Explain the background for making these changes. What is the current problem you’re solving, or what new functionality are you adding? -->
<!-- List the key changes made in this PR. -->

## How Has This Been Tested?
<!-- Describe in detail how you tested your changes. Include details of your testing environment, tests ran, and any other relevant information. If applicable, include steps to reproduce the issue this PR addresses. -->

## API/CLI Changes
<!-- Specify any changes to the API or CLI interface. Include a brief description of the change and how developers should adapt their usage of the library or CLI. -->

## Screenshots (if appropriate):
<!-- Include any relevant screenshots or gifs to visually illustrate the changes made in this PR. -->

## Potential Impacts
<!-- Discuss any potential impacts or side effects of this PR. This includes implications for users, dependencies, or other parts of the system. -->

## Checklist:
<!-- Before submitting this PR, please go through the following checklist and check all the boxes that apply. -->
- [ ] I have followed the [style guidelines](https://github.com/sanctuuary/APE/blob/main/CONTRIBUTION.md#good-java-practices) of this project.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation (if applicable).
- [ ] My changes generate no new warnings.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] New and existing unit tests pass locally with my changes.
<!-- Briefly describe how you tested your changes. -->

## Additional Notes
<!-- Any additional information that you believe is important to the review. -->
## Checklist

## Reviewer Checklist:
<!-- Before approving this PR, please go through the following checklist and check all the boxes that apply. -->
- [ ] The code follows the project’s style guide.
- [ ] The changes are well-documented and commented.
- [ ] The tests cover all changes adequately.
- [ ] All checks pass successfully.
- [ ] I have referenced a related issue.
- [ ] I have followed the project’s style guidelines.
- [ ] My changes include tests, if applicable.
- [ ] All tests pass locally.
16 changes: 9 additions & 7 deletions .github/workflows/mvnbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build, test and package with Maven
Expand All @@ -35,11 +35,13 @@ jobs:
pip3 install cwlref-runner
- name: Test CWL generation
run: |
git clone https://github.com/Workflomics/domain-annotations
cd domain-annotations/WombatP_tools
java -jar ../../target/APE-*-executable.jar ./config.json
git clone https://github.com/Workflomics/containers
cd containers/domains/proteomics
java -jar ../../../target/APE-*-executable.jar ./config.json
cd ./CWL
cwltool --enable-dev --validate candidate_workflow_1.cwl
cwltool --enable-dev --validate candidate_workflow_2.cwl
cwltool --enable-dev --validate candidate_workflow_3.cwl

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.sanctuuary</groupId>
<artifactId>APE</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<packaging>jar</packaging>
<name>io.github.sanctuuary:APE</name>
<description>APE is a command line tool and an API for the automated exploration of possible computational pipelines (workflows) from large collections of computational tools.</description>
Expand All @@ -31,8 +31,8 @@
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<build>
<plugins>
Expand All @@ -41,8 +41,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
<!-- Enable additional compiler warnings -->
<compilerArgs>
<arg>-Xlint:all</arg>
Expand All @@ -67,8 +67,8 @@
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>nl.uu.cs.ape.Main</Main-Class>
<X-Compile-Source-JDK>1.8</X-Compile-Source-JDK>
<X-Compile-Target-JDK>1.8</X-Compile-Target-JDK>
<X-Compile-Source-JDK>17</X-Compile-Source-JDK>
<X-Compile-Target-JDK>17</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/nl/uu/cs/ape/APE.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package nl.uu.cs.ape;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.SortedSet;

import org.json.JSONException;
import org.json.JSONObject;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.yaml.snakeyaml.Yaml;

import guru.nidi.graphviz.attribute.For;
import guru.nidi.graphviz.attribute.Rank.RankDir;
import guru.nidi.graphviz.engine.Format;
import lombok.extern.slf4j.Slf4j;
Expand Down
79 changes: 73 additions & 6 deletions src/main/java/nl/uu/cs/ape/Main.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package nl.uu.cs.ape;

import guru.nidi.graphviz.attribute.Rank.RankDir;
import lombok.extern.slf4j.Slf4j;
import nl.uu.cs.ape.configuration.APEConfigException;
import nl.uu.cs.ape.configuration.APERunConfig;
import nl.uu.cs.ape.domain.BioToolsAPI;
import nl.uu.cs.ape.utils.APEFiles;
import nl.uu.cs.ape.solver.solutionStructure.SolutionsList;

import org.apache.commons.lang3.ArrayUtils;
import org.json.JSONException;
import org.json.JSONObject;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
Expand All @@ -27,12 +28,78 @@ public class Main {
* The entry point of application when the library is used in a Command Line
* Interface (CLI).
*
* @param args APE expects at most one (1) argument: The absolute or relative
* path to the configuration file.
* @param args APE expects the first argument to specify the method to be executed.
* The rest of the arguments are provided depending on the method.
*/
public static void main(String[] args) {

String method = args[0];
switch (method) {
case "synthesis":
executeSynthesis(ArrayUtils.remove(args, 0));
break;
case "convert-tools":
convertBioToolsAnnotations(ArrayUtils.remove(args, 0));
break;
case "bio.tools":
try {
BioToolsAPI.fetchBioTools("./tools.json");
} catch (IOException e) {
log.error("Error in fetching the tools from bio.tools.");
}
break;
default:
if (args.length == 0 || args.length == 1) {
executeSynthesis(args);
} else {
log.error("Invalid method provided.");
}
}

}

/**
* Retrieve tools from bio.tools using bio.tools API and convert them to
* APE-compatible tool annotation format.
*
* @param args The arguments provided to the method. Only one argument is
* expected, the path to the file where the biotoolsIDs are stored.
*/
public static void convertBioToolsAnnotations(String[] args) {
String path;
if (args.length != 1) {
log.error("Error: bio.tools method expects path as the only additional argument.");
return;
}

path = args[0];
if (!APEFiles.isValidReadFile(path)) {
log.error("Error: Invalid path provided.");
return;
}

try {
BioToolsAPI.fetchToolSet(path, "./tools.json");
} catch (IOException e) {
log.error("Error in fetching the tools from bio.tools.");
return;
}
log.info("File generated successfully in the current directory.");
}

/**
* Executes the synthesis based on the provided configuration file.
* @param args The arguments provided to the method.
*/
public static void executeSynthesis(String[] args) {
String path;
int solutionsNo = -1;

if (args.length > 2) {
log.error("Error: synthesis method expects at most two additional arguments.");
return;
}

if (args.length == 1) {
path = args[0];
} else if (args.length == 2) {
Expand Down Expand Up @@ -97,11 +164,11 @@ public static void main(String[] args) {
} else {
try {
APE.writeSolutionToFile(solutions);
APE.writeDataFlowGraphs(solutions, RankDir.TOP_TO_BOTTOM);
// APE.writeControlFlowGraphs(solutions, RankDir.LEFT_TO_RIGHT);
// The following method can be changed to write the solutions in different
// formats (e.g., control flow graph, data flow graph)
APE.writeTavernaDesignGraphs(solutions);
APE.writeExecutableWorkflows(solutions);
APE.writeCWLWorkflows(solutions);
// APE.writeExecutableCWLWorkflows(solutions, apeFramework.getConfig());
} catch (IOException e) {
log.error("Error in writing the solutions. to the file system.");
e.printStackTrace();
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/nl/uu/cs/ape/configuration/APERunConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,6 @@ public interface IBuildStage {

IBuildStage withNoCWL(int noCWL);

IBuildStage withNoExecutableCWL(int noExecutableCWL);

IBuildStage withProgramInputs(List<Type> programInputs);

IBuildStage withProgramOutputs(List<Type> programOutputs);
Expand Down Expand Up @@ -678,7 +676,6 @@ public static final class Builder implements ISolutionMinLengthStage, ISolutionM
private int noExecutions;
private int noGraphs;
private int noCWL;
private int noExecutableCWL;
private List<Type> programInputs = Collections.emptyList();
private List<Type> programOutputs = Collections.emptyList();
private ConfigEnum useWorkflowInput;
Expand Down Expand Up @@ -749,12 +746,6 @@ public IBuildStage withNoCWL(int noCWL) {
return this;
}

@Override
public IBuildStage withNoExecutableCWL(int noExecutableCWL) {
this.noExecutableCWL = noExecutableCWL;
return this;
}

@Override
public IBuildStage withProgramInputs(List<Type> programInputs) {
this.programInputs = programInputs;
Expand Down
Loading
Loading