Skip to content
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
9 changes: 9 additions & 0 deletions src/components/explore/GenerationConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ const GenerationConfig: React.FC<any> = observer((props) => {
onChange={(event) => (workflowConfig.solutionCount = parseInt(event.target.value))}
/>
</div>
<div className="flex items-center m-2 tooltip tooltip-bottom"
data-tip="Specifies whether potentially non-executable workflow descriptions shall be generated.">
<label className="w-80 text-lg">Create Potentially Non-Executable Scripts</label>
<input type="checkbox"
className="checkbox checkbox-primary"
checked={workflowConfig.createPartialScripts}
onChange={(event) => { workflowConfig.createPartialScripts = event.target.checked }}
/>
</div>
</div>
</div>

Expand Down
51 changes: 51 additions & 0 deletions src/components/explore/GenerationResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ const GenerationResults: React.FC<any> = observer((props) => {
});
};

const downloadSnakeFile = (run_id: string, snakemake_name: string) => {
const request = {
run_id: run_id,
file_name: snakemake_name,
};
fetch("/ape/snakemake", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(request),
})
.then((response) => response.text())
.then((data) => {
const blob = new Blob([data], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = snakemake_name;
link.click();
URL.revokeObjectURL(url);
})
.catch((error) => {
console.error(
"There has been a problem with accessing a snakemake file from the REST APE service:",
error
);
});
};

const downloadInputFile = (run_id: string) => {
fetch(`/ape/cwl_input?run_id=${run_id}`)
.then((response) => response.text())
Expand Down Expand Up @@ -230,9 +260,30 @@ const GenerationResults: React.FC<any> = observer((props) => {
workflow.cwl_name
)
}
style={{
textDecoration: workflow.cwl_name === '' ? 'line-through' : 'none',
cursor: workflow.cwl_name === '' ? 'not-allowed' : 'pointer',
}}
disabled={workflow.cwl_name === ''}
>
CWL
</button>
<button
className="text-blue-500 hover:underline"
onClick={() =>
downloadSnakeFile(
workflow.run_id,
workflow.snakemake_name
)
}
disabled={workflow.snakemake_name === ''}
style={{
textDecoration: workflow.snakemake_name === '' ? 'line-through' : 'none',
cursor: workflow.snakemake_name === '' ? 'not-allowed' : 'pointer',
}}
>
SMK
</button>
</div>
</li>
)
Expand Down
1 change: 1 addition & 0 deletions src/stores/DomainStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface DomainConfig {
max: number;
};
solutions: number;
create_partial_scripts: boolean;

number_of_execution_scripts: number;
number_of_generated_graphs: number;
Expand Down
2 changes: 2 additions & 0 deletions src/stores/ExploreDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const emptyUserConfig = (): UserParams => {
maxSteps: 5,
timeout: 120,
solutionCount: 10,
createPartialScripts: true,
};
};

Expand Down Expand Up @@ -122,6 +123,7 @@ export class ExploreDataStore {
min: config.minSteps,
max: config.maxSteps,
},
create_partial_scripts: config.createPartialScripts,
solutions: config.solutionCount,
number_of_execution_scripts: config.solutionCount,
number_of_generated_graphs: config.solutionCount,
Expand Down
2 changes: 2 additions & 0 deletions src/stores/WorkflowTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type UserParams = {
maxSteps: number
timeout: number
solutionCount: number
createPartialScripts: boolean
}

export type WorkflowSolution = {
Expand All @@ -36,6 +37,7 @@ export type WorkflowSolution = {
descriptive_name: string,
description: string,
cwl_name: string,
snakemake_name: string,
figure_name: string,
benchmark_file: string,
isSelected: boolean,
Expand Down
Loading