Skip to content
Snippets Groups Projects
Verified Commit 854a2a43 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

SRAtoolkit: update nf strcuture and improve script

parent 67c4ff01
No related branches found
No related tags found
No related merge requests found
......@@ -15,30 +15,33 @@ log.info "downloading list srr : ${params.list_srr}"
Channel
.fromPath( params.list_srr )
.ifEmpty { error "Cannot find any bam files matching: ${params.list_srr}" }
.splitCsv(header: true)
.splitCsv()
.map { it -> it[0]}
.set { SRR }
//run is the column name containing SRR ids
process fastq_dump {
tag {"${x.run}"}
publishDir "results/download/fastq/${x.run}/", mode: 'copy'
tag "$file_id"
publishDir "results/download/fastq/${file_id}/", mode: 'copy'
input:
val x from SRR
val file_id from SRR
output:
file("*") into fastq
set file_id, "*.fastq" into fastq
script:
"""
#for test only 10000 reads are downloading with the option -N 10000 -X 20000
fastq-dump --split-files --defline-seq '@\$ac_\$si/\$ri' --defline-qual "+" -N 10000 -X 20000 ${x.run}
if [ -f ${x.run}_1.fastq ]
fastq-dump --split-files --defline-seq '@\$ac_\$si/\$ri' --defline-qual "+" -N 10000 -X 20000 ${file_id}
if [ -f ${file_id}_1.fastq ]
then
true
else
touch ${x.run}.fastq
mv ${file_id}_1.fastq ${file_id}_R1.fastq
fi
if [ -f ${file_id}_2.fastq ]
then
mv ${file_id}_2.fastq ${file_id}_R2.fastq
fi
"""
}
run
ERR572281
ERR572146
ERR572201
......
/*
* sra-tools :
*/
/* fastq-dump
* Imputs : srr list
* Outputs : fastq files
*/
params.list_srr = "$baseDir/data/SRR/*.txt"
log.info "downloading list srr : ${params.list_srr}"
Channel
.fromPath( params.list_srr )
.ifEmpty { error "Cannot find any bam files matching: ${params.list_srr}" }
.splitCsv(header: true)
.set { SRR }
//run is the column name containing SRR ids
process fastq_dump {
tag {"${x.run}"}
publishDir "results/download/fastq/${x.run}/", mode: 'copy'
input:
val x from SRR
output:
file("*") into fastq
script:
"""
fastq-dump --split-files --defline-seq '@\$ac_\$si/\$ri' --defline-qual "+" ${x.run}
if [ -f ${x.run}_1.fastq ]
then
true
else
touch ${x.run}.fastq
fi
"""
}
nextflow src/nf_modules/SRAtoolkit/fastqdump.nf \
-c src/nf_modules/SRAtoolkit/fastqdump.config \
-profile docker \
--list_srr "src/nf_modules/SRAtoolkit/list-srr.txt"
nextflow src/nf_modules/SRAtoolkit/tests/fastqdump.nf \
-c src/nf_modules/SRAtoolkit/sratoolkit.config \
-profile docker \
--list_srr "src/nf_modules/SRAtoolkit/tests/list-srr.txt"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment