Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • dev
  • master
  • v0.1.0
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.4.0
  • v2.0.0
17 results

Target

Select target project
  • LBMC/regards/nextflow
  • elabaron/nextflow
  • lanani/nextflow
  • mlepetit/nextflow
  • mdjaffar/nextflow
  • LBMC/RMI2/rmi2_pipelines
  • lpicard/nextflow
  • rseraphi/nextflow
  • hregue/nextflow
  • letien02/nextflow
  • mshamjal/nextflow
  • z483801/nextflow
  • fduveau/nextflow
  • cginevra/nextflow
  • dtorresc/nextflow
  • fmortreu/nextflow
  • jshapiro/nextflow
  • carpin/nextflow
  • LBMC/Delattre/JU28_59vs17_SNP
  • jclaud01/nextflow
  • dchalopi/nextflow
  • mvilcot/nextflow
  • mherbett/nextflow
  • lestrada/nextflow
  • nfontrod/nextflow
  • gbenoit/nextflow
  • gyvert/nextflow
  • aguill09/nextflow
  • alapendr/nextflow
  • jprobin/nextflow
  • vvanoost/nextflow
  • jblin/nextflow
  • mparis/nextflow
  • ogandril/nextflow
  • cbourgeo/nextflow
  • ggirau03/nextflow
  • ecombe01/nextflow
  • acorbin/nextflow
  • pberna01/nextflow
  • pmarie01/nextflow
  • rhoury/nextflow
  • lgely/nextflow
  • jvalat/nextflow
  • cfournea/nextflow
  • mprieux/nextflow
  • hpolvech/nextflow
  • LBMC/nextflow
  • mcariou/nextflow
  • z483800/nextflow
  • yjia01/nextflow
  • jkleine/nextflow
  • LBMC/Palladino/RNAseq_nextflow
  • jseimand/nextflow
  • nlecouvr/nextflow-nathan
54 results
Select Git revision
  • dev
  • master
  • revert-0d3ded33
3 results
Show changes
Showing
with 955 additions and 333 deletions
log.info "fastq files : ${params.fastq}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$pair_id"
cpus 4
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads[0]} --inpair ${reads[1]} \
--out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
> ${pair_id}_trimming_report.txt
"""
}
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$reads.baseName"
cpus 4
input:
file reads from fastq_files
output:
file "*_trim.fastq.gz" into fastq_files_trim
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads} \
--out ${reads.baseName}_trim.fastq.gz \
> ${reads.baseName}_trimming_report.txt
"""
}
profiles {
docker {
process {
$trimming {
container = "urqt:d62c1f8"
}
}
}
sge {
process{
$trimming {
beforeScript = "module purge; module load UrQt/d62c1f8"
}
}
}
}
/*
* urqt :
* Imputs : fastq files
* Output : fastq files
*/
/* quality trimming */
/*
* for paired-end data
*/
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$pair_id"
cpus 4
publishDir "results/fastq/trimming/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads[0]} --inpair ${reads[1]} \
--out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
> ${pair_id}_trimming_report.txt
"""
}
/*
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$reads.baseName"
cpus 4
publishDir "results/fastq/trimming/", mode: 'copy'
input:
file reads from fastq_files
output:
file "*_trim.fastq.gz" into fastq_files_trim
script:
"""
UrQt --t 20 --m ${task.cpus} --gz \
--in ${reads} \
--out ${reads.baseName}_trim.fastq.gz \
> ${reads.baseName}_trimming_report.txt
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.8.0"
container_url = "lbmc/agat:${version}"
params.gff_to_bed = ""
params.gff_to_bed_out = ""
process gff_to_bed {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.gff_to_bed_out != "") {
publishDir "results/${params.gff_to_bed_out}", mode: 'copy'
}
input:
tuple val(file_id), path(gff)
output:
tuple val(file_id), path("*.bed"), emit: bed
script:
"""
zcat ${gff} > ${gff.baseName}.gff
agat_convert_sp_gff2bed.pl ${params.gff_to_bed} --gff ${gff.baseName}.gff -o ${gff.simpleName}.bed
"""
}
params.gff_to_gtf = ""
params.gff_to_gtf_out = ""
process gff_to_gtf {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.gff_to_gtf_out != "") {
publishDir "results/${params.gff_to_gtf_out}", mode: 'copy'
}
input:
tuple val(file_id), path(gff)
output:
tuple val(file_id), path("*.gtf"), emit: gtf
script:
"""
zcat ${gff} > ${gff.baseName}.gff
agat_convert_sp_gff2gtf.pl ${params.gff_to_gtf} --gff ${gff.baseName}.gff -o ${gff.simpleName}.gtf
"""
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "dd96682"
container_url = "lbmc/alntools:${version}"
params.bam2ec = ""
params.bam2ec_out = ""
process bam2ec {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.bam2ec_out != "") {
publishDir "results/${params.bam2ec_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bam), path(bam_idx)
tuple val(transcripts_lengths_id), path(transcripts_lengths)
output:
tuple val(file_id), path("${bam.simpleName}.bin"), emit: bin
tuple val(transcripts_lengths_id), path("${transcripts_lengths}"), emit: tsv
tuple val(file_id), path("${bam.simpleName}_bam2ec_report.txt"), emit: report
script:
"""
mkdir tmp
alntools bam2ec \
-c 1 ${params.bam2ec} \
-d ./tmp \
-t ${transcripts_lengths} \
-v \
${bam} ${bam.simpleName}.bin &> \
${bam.simpleName}_bam2ec_report.txt
"""
}
params.gtf_to_transcripts_lengths = ""
params.gtf_to_transcripts_lengths_out = ""
process gtf_to_transcripts_lengths {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.gtf_to_transcripts_lengths != "") {
publishDir "results/${params.gtf_to_transcripts_lengths}", mode: 'copy'
}
input:
tuple val(file_id), path(gtf)
output:
tuple val(file_id), path("${gtf.simpleName}_transcripts_lengths.tsv"), emit: tsv
script:
"""
awk -F"[\\t;]" '
\$3=="exon" {
ID=gensub(/transcript_id \\"(.*)\\"/, "\\\\1", "g", \$11);
LEN[ID]+=\$5-\$4+1;
}
END{
for(i in LEN)
{print i"\\t"LEN[i]}
}
' ${gtf} > ${gtf.simpleName}_transcripts_lengths.tsv
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "5.1_24Aug19.3e8--hdfd78af_1"
container_url = "quay.io/biocontainers/beagle::${version}"
params.phasing = ""
process phasing {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
input:
tuple val(file_id), path(vcf)
tuple val(ref_id), path(ref_vcf)
output:
tuple val(file_id), path("*.bam*"), emit: bam
script:
"""
beagle nthread=${task.cpus} \
gtgl=${vcf} \
ref=${ref_vcf}
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "2.25.0"
container_url = "lbmc/bedtools:${version}"
params.fasta_from_bed = "-name"
params.fasta_from_bed_out = ""
process fasta_from_bed {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${file_id}"
if (params.fasta_from_bed_out != "") {
publishDir "results/${params.fasta_from_bed_out}", mode: 'copy'
}
input:
tuple val(fasta_id), path(fasta)
tuple val(file_id), path(bed)
output:
tuple val(file_id), path("*_extracted.fasta"), emit: fasta
script:
"""
bedtools getfasta ${params.fasta_from_bed} \
-fi ${fasta} -bed ${bed} -fo ${bed.baseName}_extracted.fasta
"""
}
params.merge_bed = ""
params.merge_bed_out = ""
process merge_bed {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${file_id}"
if (params.merge_bed_out != "") {
publishDir "results/${params.merge_bed_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bed)
output:
tuple val(file_id), path("*_merged.fasta"), emit: bed
script:
"""
bedtools merge ${params.merge_bed} -i ${bed} > ${bed[0].simpleName}_merged.bed
"""
}
params.bam_to_fastq_singleend = ""
params.bam_to_fastq_singleend_out = ""
process bam_to_fastq_singleend {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${bam_id}"
if (params.bam_to_fastq_singleend_out != "") {
publishDir "results/${params.bam_to_fastq_singleend_out}", mode: 'copy'
}
input:
tuple val(bam_id), path(bam)
output:
tuple val(bam_id), path("*.fastq"), emit: fastq
script:
"""
bedtools bamtofastq \
${params.bam_to_fastq_singleend} \
-i ${bam} -fq ${bam.baseName}.fastq
"""
}
params.bam_to_fastq_pairedend = ""
params.bam_to_fastq_pairedend_out = ""
process bam_to_fastq_pairedend {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${bam_id}"
if (params.bam_to_fastq_pairedend_out != "") {
publishDir "results/${params.bam_to_fastq_pairedend_out}", mode: 'copy'
}
input:
tuple val(bam_id), path(bam)
output:
tuple val(bam_id), path("*.fastq"), emit: fastq
script:
"""
bedtools bamtofastq \
${params.bam_to_fastq_pairedend} \
-i ${bam} -fq ${bam.baseName}_R1.fastq -fq2 ${bam.baseName}_R2.fastq
"""
}
params.bam_to_bedgraph = ""
params.bam_to_bedgraph_out = ""
process bam_to_bedgraph {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${bam_id}"
if (params.bam_to_bedgraph_out != "") {
publishDir "results/${params.bam_to_bedgraph_out}", mode: 'copy'
}
input:
tuple val(bam_id), path(bam)
output:
tuple val(bam_id), path("*.bed"), emit: bed
script:
"""
bedtools genomecov \
${params.bam_to_bedgraph} \
-ibam ${bam} \
-bg > ${bam.simpleName}.bed
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "1.0"
container_url = "lbmc/bioawk:${version}"
params.fasta_to_transcripts_lengths = ""
params.fasta_to_transcripts_lengths_out = ""
process fasta_to_transcripts_lengths {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.fasta_to_transcripts_lengths_out != "") {
publishDir "results/${params.fasta_to_transcripts_lengths_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("${fasta.simpleName}_transcripts_lengths.tsv"), emit: tsv
script:
"""
bioawk -c fastx '{print(\$name" "length(\$seq))}' ${fasta} > ${fasta.simpleName}_transcripts_lengths.tsv
"""
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.4.0"
container_url = "lbmc/bioconvert:${version}"
params.bigwig_to_wig = ""
params.bigwig_to_wig_out = ""
process bigwig_to_wig {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${file_id}"
if (params.bigwig_to_wig_out != "") {
publishDir "results/${params.bigwig_to_wig_out}", mode: 'copy'
}
input:
tuple val(file_id) path(bw)
output:
tuple val(file_id), path("*.wig"), emit: wig
script:
"""
bioconvert bigwig2wiggle ${bw} ${bw.simpleName}.wig
"""
}
params.bigwig2_to_wig2 = ""
params.bigwig2_to_wig2_out = ""
process bigwig2_to_wig2 {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "${file_id}"
if (params.bigwig_to_wig_out != "") {
publishDir "results/${params.bigwig_to_wig_out}", mode: 'copy'
}
input:
tuple val(file_id), path(bw_a), path(bw_b)
output:
tuple val(file_id), path("${bw_a.simpleName}.wig"), path("${bw_b.simpleName}.wig"), emit: wig
script:
"""
bioconvert bigwig2wiggle ${bw_a} ${bw_a.simpleName}.wig
bioconvert bigwig2wiggle ${bw_b} ${bw_b.simpleName}.wig
"""
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "1.2.2"
container_url = "lbmc/bowtie:${version}"
params.index_fasta = ""
params.index_fasta_out = ""
process index_fasta {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.index_fasta_out != "") {
publishDir "results/${params.index_fasta_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("*.index*"), emit: index
tuple val(file_id), path("*_report.txt"), emit: report
script:
"""
bowtie-build --threads ${task.cpus} \
${params.index_fasta} \
-f ${fasta} ${fasta.baseName}.index &> \
${fasta.baseName}_bowtie_index_report.txt
if grep -q "Error" ${fasta.baseName}_bowtie_index_report.txt; then
exit 1
fi
"""
}
params.mapping_fastq = "--very-sensitive"
params.mapping_fastq_out = ""
process mapping_fastq {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$pair_id"
if (params.mapping_fastq_out != "") {
publishDir "results/${params.mapping_fastq_out}", mode: 'copy'
}
input:
tuple val(index_id), path(index)
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*.bam"), emit: bam
path "*_report.txt", emit: report
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
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]
}
}
if (reads.size() == 2)
"""
# -v specify the max number of missmatch, -k the number of match reported per
# reads
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq} \
-1 ${reads[0]} -2 ${reads[1]} 2> \
${file_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${file_id}.bam
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
${file_id}_bowtie_mapping_report.txt
"""
else
"""
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq}
-q ${reads} 2> \
${file_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${file_id}.bam
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
${file_id}_bowtie_mapping_report.txt
"""
}
params.mapping_fastq_pairedend = ""
process mapping_fastq_pairedend {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$pair_id"
input:
path index
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("*.bam"), emit: bam
path "*_report.txt", emit: report
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]
}
}
"""
# -v specify the max number of missmatch, -k the number of match reported per
# reads
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq_pairedend} \
-1 ${reads[0]} -2 ${reads[1]} 2> \
${pair_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${pair_id}.bam
if grep -q "Error" ${pair_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${pair_id}_bowtie_report_tmp.txt > \
${pair_id}_bowtie_mapping_report.txt
"""
}
params.mapping_fastq_singleend = ""
process mapping_fastq_singleend {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
input:
path index
tuple val(file_id), path(reads)
output:
set file_id, "*.bam", emit: bam
file "*_report.txt", emit: report
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]
}
}
"""
bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \
${params.mapping_fastq_singleend} \
-q ${reads} 2> \
${file_id}_bowtie_report_tmp.txt | \
samtools view -Sb - > ${file_id}.bam
if grep -q "Error" ${file_id}_bowtie_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_id}_bowtie_report_tmp.txt > \
${file_id}_bowtie_mapping_report.txt
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "2.3.4.1"
container_url = "lbmc/bowtie2:${version}"
params.index_fasta = ""
params.index_fasta_out = ""
process index_fasta {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.index_fasta_out != "") {
publishDir "results/${params.index_fasta_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("*.bt2"), emit: index
tuple val(file_id), path("*_report.txt"), emit: report
script:
"""
bowtie2-build --threads ${task.cpus} \
${fasta} \
${fasta.simpleName} &> \
${fasta.simpleName}_bowtie2_index_report.txt
if grep -q "Error" ${fasta.simpleName}_bowtie2_index_report.txt; then
exit 1
fi
"""
}
params.mapping_fastq = "--very-sensitive"
params.mapping_fastq_out = ""
process mapping_fastq {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.mapping_fastq_out != "") {
publishDir "results/${params.mapping_fastq_out}", mode: 'copy'
}
input:
tuple val(index_id), path(index)
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*.bam"), emit: bam
path "*_report.txt", emit: report
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]
}
}
switch(file_id) {
case {it instanceof List}:
file_prefix = file_id[0]
break
case {it instanceof Map}:
file_prefix = file_id.values()[0]
break
default:
file_prefix = file_id
break
}
if (reads.size() == 2)
"""
bowtie2 ${params.mapping_fastq} \
-p ${task.cpus} \
-x ${index_id} \
-1 ${reads[0]} \
-2 ${reads[1]} 2> \
${file_prefix}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${file_prefix}.bam
if grep -q "Error" ${file_prefix}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_prefix}_bowtie2_mapping_report_tmp.txt > \
${file_prefix}_bowtie2_mapping_report.txt
"""
else
"""
bowtie2 ${params.mapping_fastq} \
-p ${task.cpus} \
-x ${index_id} \
-U ${reads} 2> \
${file_prefix}_bowtie2_mapping_report_tmp.txt | \
samtools view -Sb - > ${file_prefix}.bam
if grep -q "Error" ${file_prefix}_bowtie2_mapping_report_tmp.txt; then
exit 1
fi
tail -n 19 ${file_prefix}_bowtie2_mapping_report_tmp.txt > \
${file_prefix}_bowtie2_mapping_report.txt
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "0.7.17"
container_url = "lbmc/bwa:${version}"
workflow mapping {
take:
fasta
fastq
main:
index_fasta(fasta)
mapping_fastq(index_fasta.out.index.collect(), fastq)
emit:
bam = mapping_fastq.out.bam
report = mapping_fastq.out.report
}
params.index_fasta = ""
params.index_fasta_out = ""
process index_fasta {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.index_fasta_out != "") {
publishDir "results/${params.index_fasta_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fasta)
output:
tuple val(file_id), path("${fasta.simpleName}.*"), emit: index
tuple val(file_id), path("*_bwa_report.txt"), emit: report
script:
"""
bwa index ${params.index_fasta} -p ${fasta.simpleName} ${fasta} \
&> ${fasta.simpleName}_bwa_report.txt
"""
}
params.mapping_fastq = ""
params.mapping_fastq_out = ""
process mapping_fastq {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$file_id"
if (params.mapping_fastq_out != "") {
publishDir "results/${params.mapping_fastq_out}", mode: 'copy'
}
input:
tuple val(index_id), path(index)
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*.bam"), emit: bam
tuple val(file_id), path("${file_prefix}_bwa_report.txt"), emit: report
script:
if (file_id instanceof List){
library = file_id[0]
file_prefix = file_id[0]
} else if (file_id instanceof Map) {
library = file_id[0]
file_prefix = file_id[0]
if (file_id.containsKey('library')) {
library = file_id.library
file_prefix = file_id.id
}
} else {
library = file_id
file_prefix = file_id
}
bwa_mem_R = "@RG\\tID:${library}\\tSM:${library}\\tLB:lib_${library}\\tPL:illumina"
if (reads.size() == 2)
"""
bwa mem -t ${task.cpus} \
${params.mapping_fastq} \
-R '${bwa_mem_R}' \
${index[0].baseName} ${reads[0]} ${reads[1]} 2> \
${file_prefix}_bwa_report.txt | \
samtools view -@ ${task.cpus} -Sb - > ${file_prefix}.bam
"""
else
"""
bwa mem -t ${task.cpus} \
${params.mapping_fastq} \
-R '${bwa_mem_R}' \
${index[0].baseName} ${reads} 2> \
${file_prefix}_bwa_report.txt | \
samtools view -@ ${task.cpus} -Sb - > ${file_prefix}.bam
"""
}
#!/bin/sh
docker build src/nf_modules/canu/1.6 -t 'canu:1.6'
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "3.0.0"
container_url = "mlepetit/cellphonedb:latest"
params.cellphonedb = ""
params.cellphonedb_out = ""
params.pval=""
params.thres=""
params.iterations=""
params.gene_id=""
workflow cellphone_statistical_analysis {
take:
meta
counts
main:
cpdb_methods_stats(meta,counts)
cpdb_plot_dot_plot(cpdb_methods_stats.out.means,cpdb_methods_stats.out.pvalues)
cpdb_plot_heatmap(cpdb_methods_stats.out.pvalues)
emit:
means = cpdb_methods_stats.out.means
pvalues = cpdb_methods_stats.out.pvalues
deconvoluted = cpdb_methods_stats.out.deconvoluted
significant_means = cpdb_methods_stats.out.significant_means
dot_plot = cpdb_plot_dot_plot.out.dot_plot
heatmap = cpdb_plot_heatmap.out.heatmap
heatmap_log = cpdb_plot_heatmap.out.heatmap_log
count_network = cpdb_plot_heatmap.out.count_network
interactions_count = cpdb_plot_heatmap.out.interactions_count
}
process cpdb_methods_stats {
container = "${container_url}"
label "big_mem_multi_cpus"
if (params.cellphonedb_out != "") {
publishDir "results/${params.cellphonedb_out}", mode: 'copy'
}
input:
tuple val(id_mtx), path(meta)
tuple val(id_mtx), path(counts)
output:
tuple val(id_mtx), path("out/means.txt"), emit: means
tuple val(id_mtx), path("out/pvalues.txt"), emit: pvalues
tuple val(id_mtx), path("out/deconvoluted.txt"), emit: deconvoluted
tuple val(id_mtx), path("out/significant_means.txt"), emit: significant_means
script:
"""
cellphonedb method statistical_analysis ${params.meta} ${params.counts} --counts-data ${params.gene_id} --threads ${task.cpus} --iterations ${params.iterations} --pvalue ${params.pval} --threshold ${params.thres}
"""
}
process cpdb_plot_dot_plot {
container = "${container_url}"
label "big_mem_mono_cpus"
if (params.cellphonedb_out != "") {
publishDir "results/${params.cellphonedb_out}", mode: 'copy'
}
input:
tuple val(id_mtx), path(means)
tuple val(id_mtx), path(pvalues)
output:
tuple val(id_mtx), path("out/plot.pdf"), emit: dot_plot
script:
"""
mkdir ./out
cellphonedb plot dot_plot --means-path ${means} --pvalues-path ${pvalues}
"""
}
process cpdb_plot_heatmap {
container = "${container_url}"
label "big_mem_multi_cpus"
if (params.cellphonedb_out != "") {
publishDir "results/${params.cellphonedb_out}", mode: 'copy'
}
input:
tuple val(id_mtx), path(pvalues)
output:
tuple val(id_mtx), path("out/heatmap_count.pdf"), emit: heatmap
tuple val(id_mtx), path("out/heatmap_log_count.pdf"), emit: heatmap_log
tuple val(id_mtx), path("out/count_network.txt"), emit: count_network
tuple val(id_mtx), path("out/interaction_count.txt"), emit: interactions_count
script:
"""
mkdir ./out
cellphonedb plot heatmap_plot --pvalues-path ${pvalues} --pvalue ${params.pval} ${params.meta}
"""
}
FROM ubuntu:18.04
MAINTAINER Laurent Modolo
ENV CUTADAPT_VERSION=1.14
ENV PACKAGES build-essential=12.4* \
python3-pip=9.0.1* \
python3-setuptools=39.0.1* \
python3-dev=3.6.5* \
python3-wheel=0.30.0*
RUN apt-get update && \
apt-get install -y --no-install-recommends ${PACKAGES} && \
apt-get clean
RUN pip3 install cutadapt==${CUTADAPT_VERSION}
#!/bin/sh
docker build src/nf_modules/cutadapt/1.14 -t 'cutadapt:1.14'
profiles {
docker {
docker {
temp = 'auto'
enabled = true
}
process {
$adaptor_removal {
container = "cutadapt:1.14"
}
}
}
sge {
process{
$adaptor_removal {
beforeScript = "module purge; module load cutadapt/1.14"
}
}
}
}
profiles {
docker {
process {
$trimming {
container = "cutadapt:1.14"
}
}
}
sge {
process{
$trimming {
beforeScript = "module purge; module load cutadapt/1.14"
}
}
}
}
/*
* cutadapt :
* Imputs : fastq files
* Output : fastq files
*/
/* Illumina adaptor removal */
/*
* for paired-end data
*/
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process adaptor_removal {
tag "$pair_id"
publishDir "results/fastq/adaptor_removal/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT -A AGATCGGAAGAG -G CTCTTCCGATCT \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
/*
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process adaptor_removal {
tag "$reads.baseName"
publishDir "results/fastq/adaptor_removal/", mode: 'copy'
input:
file reads from fastq_files
output:
file "*_cut.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT\
-o ${reads.baseName}_cut.fastq.gz \
${reads} > ${reads.baseName}_report.txt
"""
}
/* quality trimming */
/*
* for paired-end data
*/
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$pair_id"
publishDir "results/fastq/trimming/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
output:
file "*_trim_R{1,2}.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -q 20,20 \
-o ${pair_id}_trim_R1.fastq.gz -p ${pair_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
/*
* for single-end data
*/
params.fastq = "$baseDir/data/fastq/*.fastq"
log.info "fastq files : ${params.fastq}"
Channel
.fromPath( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
process trimming {
tag "$reads.baseName"
publishDir "results/fastq/trimming/", mode: 'copy'
input:
file reads from fastq_files
output:
file "*_trim.fastq.gz" into fastq_files_cut
script:
"""
cutadapt -q 20,20 \
-o ${reads.baseName}_trim.fastq.gz \
${reads} > ${reads.baseName}_report.txt
"""
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
version = "2.1"
container_url = "lbmc/cutadapt:${version}"
params.adapter_3_prim = "AGATCGGAAGAG"
params.adapter_5_prim = "CTCTTCCGATCT"
params.adaptor_removal = "-a ${params.adapter_3_prim} -g ${params.adapter_5_prim} -A ${params.adapter_3_prim} -G ${params.adapter_5_prim}"
params.adaptor_removal_out = ""
process adaptor_removal {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.adaptor_removal_out != "") {
publishDir "results/${params.adaptor_removal_out}", mode: 'copy'
}
input:
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*_cut_*"), emit: fastq
path "*_report.txt", emit: report
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
if (reads.size() == 2)
"""
cutadapt ${params.adaptor_removal} \
-o ${file_prefix}_cut_R1.fastq.gz -p ${file_prefix}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${file_prefix}_report.txt
"""
else
"""
cutadapt ${params.adaptor_removal} \
-o ${file_prefix}_cut.fastq.gz \
${reads} > ${file_prefix}_report.txt
"""
}
params.trim_quality = "20"
params.trimming = "-q ${params.trim_quality},${params.trim_quality}"
params.trimming_out = ""
process trimming {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.trimming_out != "") {
publishDir "results/${params.trimming_out}", mode: 'copy'
}
input:
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*_trim_*"), emit:fastq
path "*_report.txt", emit: report
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
if (reads.size() == 2)
"""
cutadapt ${params.trimming} \
-o ${file_prefix}_trim_R1.fastq.gz -p ${file_prefix}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${file_prefix}_report.txt
"""
else
"""
cutadapt ${params.trimming} \
-o ${file_prefix}_trim.fastq.gz \
${reads} > ${file_prefix}_report.txt
"""
}
process 5pRACE {
container = "${container_url}"
label "big_mem_mono_cpus"tag "$file_id"
if (params.cutadapt_out != "") {
publishDir "results/${params.cutadapt_out}", mode: 'copy'
}
input:
tuple val(file_id), path(fastq)
output:
tuple val(file_id), path("*_cut_*"), emit: fastq
"""
cutadapt -e 0.2 -g CGACTGGAGCACGAGGACACTGACATGGACTGAAGGAGTAGAAA -g TTAGGCAGAGGTGAAAAAGTTG
-a TTTCTACTCCTTCAGTCCATGTCAGTGTCCTCGTGCTCCAGTCG -a CAACTTTTTCACCTCTGCCTAA
-o ${}
${fastq}
"""
}
\ No newline at end of file