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

CWL fixes and dependencies update #78

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/mvnbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
- name: Test CWL generation
run: |
git clone https://github.com/Workflomics/domain-annotations
cd domain-annotations
java -jar ../target/APE-*-executable.jar ./WombatP_tools/config_local.json
cd ./WombatP_tools/CWL
cd domain-annotations/WombatP_tools
java -jar ../../target/APE-*-executable.jar ./config.json
cd ./CWL
cwltool --enable-dev --validate workflowSolution_0.cwl

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
Expand Down
15 changes: 8 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.1.7</version>
<version>2.1.8</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 Down Expand Up @@ -162,7 +162,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
<version>20231013</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand All @@ -174,28 +174,29 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
<version>2.0.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.antlr/antlr4-runtime -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.13.0</version>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<version>2.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/nl/uu/cs/ape/APE.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import nl.uu.cs.ape.core.SynthesisEngine;
import nl.uu.cs.ape.core.implSAT.SATSynthesisEngine;
import nl.uu.cs.ape.core.solutionStructure.DefaultCWLCreator;
import nl.uu.cs.ape.core.solutionStructure.ExecutableCWLCreator;
import nl.uu.cs.ape.core.solutionStructure.SolutionWorkflow;
import nl.uu.cs.ape.core.solutionStructure.SolutionsList;
import nl.uu.cs.ape.io.APEFiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void generateWorkflowInputs() {
// Format
.append(ind(2))
.append("format: ")
.append(typeNode.getNodeID())
.append(typeNode.getFormat())
.append("\n");
}
}
Expand All @@ -92,7 +92,7 @@ private void generateWorkflowOutputs() {
// Format
.append(ind(2))
.append("format: ")
.append(typeNode.getNodeID())
.append(typeNode.getFormat())
.append("\n")
// outputSource
.append(ind(2))
Expand Down Expand Up @@ -323,7 +323,7 @@ private void generateTypeNodes(ModuleNode moduleNode, List<TypeNode> typeNodeLis
// Format
.append(ind(baseInd + 1))
.append("format: ")
.append(typeNode.getNodeID())
.append(typeNode.getFormat())
.append("\n");
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package nl.uu.cs.ape.core.solutionStructure;

import nl.uu.cs.ape.models.Type;
import nl.uu.cs.ape.models.logic.constructs.TaxonomyPredicate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;

import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -62,6 +64,19 @@ private void generateWorkflowInputs() {
* @return The CWL representation of the workflow outputs.
*/
private String getInputsInCWL(boolean formatForCwlInputsYmlFile) {

Map<String, String> availableData = new HashMap<>();
availableData.put("http://edamontology.org/format_3244",// mzML
"https://raw.githubusercontent.com/Workflomics/DemoKit/main/data/inputs/2021-10-8_Ecoli.mzML");
availableData.put("http://edamontology.org/format_1929",// FASTA
"https://raw.githubusercontent.com/Workflomics/DemoKit/main/data/inputs/up00000062.fasta");
availableData.put("http://edamontology.org/format_2196_plain",// OBO format_p
"https://raw.githubusercontent.com/Workflomics/DemoKit/main/data/inputs/go.obo");
availableData.put("http://edamontology.org/format_3475_plain",// TSV_p
"https://raw.githubusercontent.com/Workflomics/DemoKit/main/data/inputs/goa_human_smaller.gaf");



StringBuilder inputsInCWL = new StringBuilder();

int indentLevel = 1;
Expand All @@ -72,6 +87,13 @@ private String getInputsInCWL(boolean formatForCwlInputsYmlFile) {
}
int i = 1;
for (TypeNode typeNode : solution.getWorkflowInputTypeStates()) {
String currTypeFormat = "";
for (Type type : typeNode.getTypes()) {
if (type.getRootNodeID().equals("http://edamontology.org/format_1915")) {
currTypeFormat = type.getPredicateID();
}
}
String inputPath = availableData.containsKey(currTypeFormat) ? availableData.get(currTypeFormat) : "set_full_path_to_the_file_with_extension_here";
String inputName = String.format("input%o", i++);
addNewParameterToMap(typeNode, inputName);
inputsInCWL
Expand All @@ -92,7 +114,7 @@ private String getInputsInCWL(boolean formatForCwlInputsYmlFile) {
inputsInCWL
.append(ind(indentLevel + 1))
.append("path: ")
.append("set_full_path_to_the_file_with_extension_here")
.append(inputPath)
.append("\n");
}
}
Expand Down Expand Up @@ -234,7 +256,7 @@ private void generateDefaultStepRun(ModuleNode moduleNode) {
cwlRepresentation
// Main key
.append(ind(baseInd))
.append("run: https://raw.githubusercontent.com/Workflomics/containers/main/cwl/tools/" + moduleName
.append("run: https://raw.githubusercontent.com/Workflomics/containers/docker/cwl/tools/" + moduleName
+ "/" + moduleName + ".cwl")
.append("\n");
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ public String getNodeID() {
}

/**
* Get the unique ID of the current workflow node in .dot representation.
* Get the format of the current workflow node and a label for the CWL file.
*/
public String getFormat() {
StringBuilder printString = new StringBuilder();

for (Type type : this.usedTypes) {
if (type.getRootNodeID().equals("http://edamontology.org/format_1915")) {
printString.append("\"").append(type.getPredicateID()).append("\" # ").append(type.getPredicateLabel());
printString.append("\"").append(type.getPredicateLongLabel()).append("\" # ").append(type.getPredicateLabel());
}
}
if (printString.length() == 0) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/nl/uu/cs/ape/utils/BioToolsAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import org.json.JSONException;
import org.json.JSONObject;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import nl.uu.cs.ape.configuration.ToolAnnotationTag;
import nl.uu.cs.ape.io.APEFiles;
Expand All @@ -21,6 +23,7 @@
* from bio.tools API.
*/
@Slf4j
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class BioToolsAPI {

/** Http-Client */
Expand Down