I need to use REST API to download files in JSON. Then, I will run another process to update these files, for example, modify these files and submit these files to another database, etc. However, my code returns nothing. I learned from the first script and I am aware that Nextflow
syntax looks like Groovy.
Has anyone experienced with Nextflow
to help me?
<code>params.input = "work/4b/f05e21cb1af45528bf4e66e45c7680/MD0001.json"
input_ch = Channel.fromPath(params.input)
params.modelId = "MD0001"
process downloadModel {
input:
def modelId
output:
path 'model_*'
script:
def idx = String.format("%06d", task.index)
"""
wget -O '${params.modelId}'.json https://www.myservice.com/download/'${params.modelId}'?format=json
printf ${idx}
"""
}
process handleSubmission {
input:
path file
output:
stdout
script:
//def idx = String.format("%06d", hash)
"""
printf '${hash}n'
cat '${file}' | jq
"""
}
workflow {
downloadModel
handleSubmission(input_ch)
handleSubmission.out.view()
}
</code>
<code>params.input = "work/4b/f05e21cb1af45528bf4e66e45c7680/MD0001.json"
input_ch = Channel.fromPath(params.input)
params.modelId = "MD0001"
process downloadModel {
input:
def modelId
output:
path 'model_*'
script:
def idx = String.format("%06d", task.index)
"""
wget -O '${params.modelId}'.json https://www.myservice.com/download/'${params.modelId}'?format=json
printf ${idx}
"""
}
process handleSubmission {
input:
path file
output:
stdout
script:
//def idx = String.format("%06d", hash)
"""
printf '${hash}n'
cat '${file}' | jq
"""
}
workflow {
downloadModel
handleSubmission(input_ch)
handleSubmission.out.view()
}
</code>
params.input = "work/4b/f05e21cb1af45528bf4e66e45c7680/MD0001.json"
input_ch = Channel.fromPath(params.input)
params.modelId = "MD0001"
process downloadModel {
input:
def modelId
output:
path 'model_*'
script:
def idx = String.format("%06d", task.index)
"""
wget -O '${params.modelId}'.json https://www.myservice.com/download/'${params.modelId}'?format=json
printf ${idx}
"""
}
process handleSubmission {
input:
path file
output:
stdout
script:
//def idx = String.format("%06d", hash)
"""
printf '${hash}n'
cat '${file}' | jq
"""
}
workflow {
downloadModel
handleSubmission(input_ch)
handleSubmission.out.view()
}