I have a problem with nextflow -resume
Here is my script :
Reads_ch = Channel.fromSRA(params.ids, apiKey: params.apikey)
.flatMap { left, right ->
def SRRCode = left
switch(right) {
case { right.getClass() == java.util.ArrayList && right.size() == 2 }:
def forward = right[0]
def reverse = right[1]
return [tuple(SRRCode.concat("_1"), forward), tuple(SRRCode.concat("_2"), reverse)]
case { right.getClass() == java.util.ArrayList && right.size() == 3 }:
def forward = right[1]
def reverse = right[2]
return [tuple(SRRCode.concat("_1"), forward), tuple(SRRCode.concat("_2"), reverse)]
case right.getClass() == nextflow.file.http.XPath:
def sequence = right
return [tuple(SRRCode, sequence)]
}
}
process Unzip {
tag "Unzip $fileCode reads files using unpigz"
maxForks params.threads
cpus params.threads_unzip
input:
set fileCode, file(readsFile) from Reads_ch
output:
tuple fileCode, file("${fileCode}.fasta") into Kmer_ch
script:
"""
unpigz -cp${task.cpus} $readsFile | paste - - - - | cut -f 1,2 | sed 's/^@/>/' | tr "\\t" "\\n" > ${fileCode}.fasta
"""
}
process Kmer {
tag "Processing $fileCode reads files using kmer-ssr"
maxForks params.threads
cpus params.threads_kmer
input:
set fileCode, file(readsFile) from Kmer_ch
output:
tuple fileCode, file("${fileCode}.tsv") into ComputedReads_ch
script:
"""
kmer-ssr -d -t ${task.cpus} -p ${params.kmerSSR.periodMin}-${params.kmerSSR.periodMax} -n ${params.kmerSSR.ssrSizeTreshold} -r ${params.kmerSSR.repeatMin} -l ${params.kmerSSR.readLengthMin} -i ${fileCode}.fasta -o ${fileCode}.tsv
"""
}
When the pipeline is broken, I try to run again with nextflow run -resume and the problem is that all sequences from SRA are downloaded again ?? and the pipeline starts again from the beginning instead of resuming the job where it was interrupted. What is the problem, please ? Thanks.