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

hisat2: update process and config to match new format

parent 215c8f71
No related branches found
No related tags found
No related merge requests found
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: index_fasta {
cpus = 4
container = "hisat2:2.0.0"
}
}
}
singularity {
singularity.enabled = true
process {
withName: index_fasta {
cpus = 4
container = "file://bin/hisat2:2.0.0.sif"
}
}
}
sge {
process{
withName: index_fasta {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "hisat2/2.0.0"
executor = "sge"
clusterOptions = "-cwd -V"
memory = "20GB"
cpus = 16
time = "12h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
...@@ -27,6 +27,6 @@ process index_fasta { ...@@ -27,6 +27,6 @@ process index_fasta {
script: script:
""" """
hisat2-build ${fasta} ${fasta.baseName}.index hisat2-build -p {task.cpus} ${fasta} ${fasta.baseName}.index
""" """
} }
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: mapping_fastq {
cpus = 4
container = "hisat2:2.0.0"
}
}
}
singularity {
singularity.enabled = true
process {
withName: mapping_fastq {
cpus = 4
container = "file://bin/hisat2:2.0.0.sif"
}
}
}
sge {
process{
withName: mapping_fastq {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "hisat2/2.0.0"
executor = "sge"
clusterOptions = "-cwd -V"
memory = "20GB"
cpus = 16
time = "12h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
...@@ -14,20 +14,24 @@ Channel ...@@ -14,20 +14,24 @@ Channel
.set { index_files } .set { index_files }
process mapping_fastq { process mapping_fastq {
tag "$reads" tag "$pair_id"
//tag "$index.baseName"
cpus 4
publishDir "results/mapping/", mode: 'copy' publishDir "results/mapping/", mode: 'copy'
input: input:
set pair_id, file(reads) from fastq_files set pair_id, file(reads) from fastq_files
file index from index_files.toList() file index from index_files.collect()
output: output:
file "*" into counts_files file "*" into counts_files
script: script:
index_id = index[0]
for (index_file in index) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
""" """
hisat2 -x ${file(file(index[0]).baseName).baseName} -1 ${reads[0]} -2 ${reads[1]} -S ${pair_id}.sam -p ${task.cpus} hisat2 -x ${index_id} -1 ${reads[0]} -2 ${reads[1]} -S ${pair_id}.sam -p ${task.cpus}
""" """
} }
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: mapping_fastq {
cpus = 4
container = "hisat2:2.0.0"
}
}
}
singularity {
singularity.enabled = true
process {
withName: mapping_fastq {
cpus = 4
container = "file://bin/hisat2:2.0.0.sif"
}
}
}
sge {
process{
withName: mapping_fastq {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "hisat2/2.0.0"
executor = "sge"
clusterOptions = "-cwd -V"
memory = "20GB"
cpus = 16
time = "12h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
...@@ -11,6 +11,7 @@ log.info "index files : ${params.index}" ...@@ -11,6 +11,7 @@ log.info "index files : ${params.index}"
Channel Channel
.fromPath( params.fastq ) .fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fastq_files } .set { fastq_files }
Channel Channel
.fromPath( params.index ) .fromPath( params.index )
...@@ -18,19 +19,24 @@ Channel ...@@ -18,19 +19,24 @@ Channel
.set { index_files } .set { index_files }
process mapping_fastq { process mapping_fastq {
tag "$reads.baseName" tag "$file_id"
cpus 4
publishDir "results/mapping/", mode: 'copy' publishDir "results/mapping/", mode: 'copy'
input: input:
file reads from fastq_files set file_id, file(reads) from fastq_files
file index from index_files.toList() file index from index_files.collect()
output: output:
file "*" into count_files file "*" into count_files
script: script:
index_id = index[0]
for (index_file in index) {
if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/)) {
index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1]
}
}
""" """
hisat2 -x ${file(file(index[0]).baseName).baseName} -U ${reads} -S ${reads.baseName}.sam -p ${task.cpus} hisat2 -x ${index_id} -U ${reads} -S ${file_id}.sam -p ${task.cpus}
""" """
} }
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