Skip to content

Commit d484f29

Browse files
author
Yan Xu
committed
Test SRA workflow with cromwell
1 parent 788eb1e commit d484f29

File tree

4 files changed

+39
-9
lines changed

4 files changed

+39
-9
lines changed

installation/install.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,32 @@ if [ ! -d $io_home ]; then
2424
mkdir ${io_home}/${dir}
2525
done
2626

27-
test_data_home=$app_home/workflows/Nextflow/test_data
28-
if [ -d $test_data_home ]; then
29-
ln -s ${test_data_home} ${io_home}/public/nextflow
27+
cromwell_test_data_home=$app_home/workflows/Cromwell/test_data
28+
if [ -d $cromwell_test_data_home ]; then
29+
ln -s ${cromwell_test_data_home} ${io_home}/public/cromwell
30+
fi
31+
32+
nextflow_test_data_home=$app_home/workflows/Nextflow/test_data
33+
if [ -d $nextflow_test_data_home ]; then
34+
ln -s ${nextflow_test_data_home} ${io_home}/public/nextflow
3035
fi
3136
fi
3237

38+
echo "Generate Cromwell wdl imports.zip"
39+
wdl_dirs=(
40+
"data"
41+
)
42+
43+
for wdl_dir in "${wdl_dirs[@]}"
44+
do
45+
cd $app_home/workflows/Cromwell/WDL/${wdl_dir}
46+
zip -r imports.zip *.wdl
47+
if [ "$?" != "0" ]; then
48+
echo "Cannot create $app_home/workflows/Cromwell/WDL/${wdl_dir}/imports.zip!" 1>&2
49+
exit 1
50+
fi
51+
done
52+
3353
echo "Setup LANL EDGE webapp ..."
3454
#build client
3555
echo "build client..."

webapp/client/src/edge/project/forms/TextInput.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const TextInput = (props) => {
1212

1313
const {
1414
register,
15+
reset,
1516
formState: { errors },
1617
trigger,
1718
} = useForm({
@@ -54,6 +55,15 @@ export const TextInput = (props) => {
5455
}
5556
}, []) // eslint-disable-line react-hooks/exhaustive-deps
5657

58+
useEffect(() => {
59+
if (props.defaultValue) {
60+
reset({ textInput: props.defaultValue })
61+
} else {
62+
reset({ textInput: '' })
63+
}
64+
setDoValidation(doValidation + 1)
65+
}, [props.reset]) // eslint-disable-line react-hooks/exhaustive-deps
66+
5767
useEffect(() => {
5868
//validate form
5969
trigger().then((result) => {

webapp/server/utils/cromwell.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const generateInputs = async (projHome, projectConf, workflowConf) => {
2424
// projectConf: project conf.js
2525
// workflowList in utils/workflow
2626
const workflowSettings = workflowList[projectConf.workflow.name];
27-
const template = String(fs.readFileSync(`${config.CROMWELL.TEMPLATE_DIR}/${projectConf.category}/${workflowSettings.inputs_tmpl}`));
27+
const template = String(fs.readFileSync(`${config.CROMWELL.TEMPLATE_DIR}/${workflowSettings.inputs_tmpl}`));
2828
const params = { ...workflowConf, ...projectConf.workflow.input, outdir: `${projHome}/${workflowSettings.outdir}` };
2929

3030
if (projectConf.workflow.name === 'sra2fastq') {
@@ -35,8 +35,8 @@ const generateInputs = async (projHome, projectConf, workflowConf) => {
3535
const inputs = ejs.render(template, params);
3636
await fs.promises.writeFile(`${projHome}/pipeline_inputs.json`, inputs);
3737
// render options template and write to pipeline_options.json
38-
if (fs.existsSync(`${config.CROMWELL.TEMPLATE_DIR}/${projectConf.category}/${workflowSettings.options_tmpl}`)) {
39-
const optionsTemplate = String(fs.readFileSync(`${config.CROMWELL.TEMPLATE_DIR}/${projectConf.category}/${workflowSettings.options_tmpl}`));
38+
if (fs.existsSync(`${config.CROMWELL.TEMPLATE_DIR}/${workflowSettings.options_tmpl}`)) {
39+
const optionsTemplate = String(fs.readFileSync(`${config.CROMWELL.TEMPLATE_DIR}/${workflowSettings.options_tmpl}`));
4040
const options = ejs.render(optionsTemplate, params);
4141
await fs.promises.writeFile(`${projHome}/pipeline_options.json`, options);
4242
}
@@ -52,7 +52,7 @@ const submitWorkflow = (proj, projectConf, inputsize) => {
5252
formData.append('workflowInputs', fs.createReadStream(`${projHome}/pipeline_inputs.json`));
5353
// logger.debug(`workflowInputs${projHome}/pipeline_inputs.json`);
5454

55-
const imports = `${config.CROMWELL.WDL_DIR}/${projectConf.category}/${workflowList[projectConf.workflow.name].wdl_imports}`;
55+
const imports = `${config.CROMWELL.WDL_DIR}/${workflowList[projectConf.workflow.name].wdl_imports}`;
5656
const optionsJson = `${projHome}/pipeline_options.json`;
5757

5858
if (fs.existsSync(optionsJson)) {

webapp/server/utils/workflow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const nextflowConfigs = {
1212
const workflowList = {
1313
default_wdl_version: '1.0',
1414
sra2fastq: {
15-
wdl: 'sra2fastq.wdl',
16-
wdl_imports: 'imports.zip',
15+
wdl: 'data/sra2fastq.wdl',
16+
wdl_imports: 'data/imports.zip',
1717
inputs_tmpl: 'data/sra2fastq_inputs.tmpl',
1818
cromwell_calls: ['sra.sra2fastq'],
1919
outdir: 'output/sra2fastq',

0 commit comments

Comments
 (0)