-
Notifications
You must be signed in to change notification settings - Fork 10
Long due nextflowmodules update #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
a16bed5
64ea49a
fcd72d7
7bf677e
5f303eb
4cd4aa4
1047203
33695a6
0750e12
6e80f90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process ConvertGffToGtf { | ||
| tag {"AGAT ConvertGffToGtf ${gff}"} | ||
| label 'AGAT_0_8_1' | ||
| label 'AGAT_0_8_1_ConvertGffToGtf' | ||
| container = 'quay.io/biocontainers/agat:0.8.1--pl5262hdfd78af_0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| path(gff) | ||
|
|
||
| output: | ||
| path("${gff.simpleName}.gtf", emit: gtf) | ||
|
|
||
| script: | ||
| """ | ||
| agat_convert_sp_gff2gtf.pl -gff ${gff} -o ${gff.simpleName}.gtf | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| process View_bcf_vcf { | ||
| // BCFtools view can use different input and output files, this process converts bcf to vcf files. | ||
| tag {"BCFtools View_BCF_VCF ${sample_id}"} | ||
| label 'BCFtools_1_17' | ||
| label 'BCFtools_1_17_View_BCF_VCF' | ||
| container = 'quay.io/biocontainers/bcftools:1.17--h3cc50cf_1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), file(input_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), file("${input_file.baseName}.${extension}")) | ||
|
|
||
| script: | ||
| extension = input_file.getExtension() == "vcf" ? "bcf" : "vcf" | ||
| """ | ||
| bcftools view ${params.optional} ${input_file} > ${input_file.baseName}.${extension} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process BWASW { | ||
| tag {"BWA_MEM2 BWASW ${sample_id} - ${rg_id}"} | ||
| label 'BWA_MEM2_2_2_1' | ||
| label 'BWA_MEM2_2_2_1_BWASW' | ||
| container = 'blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), val(rg_id), path(fastq)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rg_id not used? |
||
|
|
||
| output: | ||
| tuple(val(sample_id), val(rg_id_), path("${fastq[0].simpleName}.sam"), emit: sam_file) | ||
|
|
||
| script: | ||
| """ | ||
| bwa-mem2 bwasw -t ${task.cpus} ${params.optional} ${params.genome} ${fastq} > ${fastq[0].simpleName}.sam | ||
| """ | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| index_loc = file("${params.genome_fasta}").toRealPath().toString().split("/")[0..-2].join("/") | ||
|
|
||
| process Index { | ||
| tag {"BWA_MEM2 Index $fasta"} | ||
| label 'BWA_MEM2_2_2_1' | ||
| label 'BWA_MEM2_2_2_1_Index' | ||
| container = 'library://blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment on BWASW. |
||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| storeDir = index_loc | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should configure cache in config files not in code. |
||
|
|
||
| input: | ||
| path(fasta) | ||
|
|
||
| output: | ||
| path("${fasta}.{alt,amb,ann,bwt,pac,sa}", emit: bwa_index) | ||
|
|
||
| script: | ||
| """ | ||
| bwa-mem2 index $params.optional $fasta | ||
| """ | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| process MEM { | ||
| tag {"BWA_MEM2 MEM ${sample_id} - ${rg_id}"} | ||
| label 'BWA_MEM2_2_2_1' | ||
| label 'BWA_MEM2_2_2_1_MEM' | ||
| container = 'quay.io/blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), val(rg_id), path(fastq)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), val(rg_id), path("${fastq[0].simpleName}.sam"), emit: sam_file) | ||
|
|
||
| script: | ||
| def barcode = rg_id.split('_')[1] | ||
| def readgroup = "\"@RG\\tID:${rg_id}\\tSM:${sample_id}\\tPL:ILLUMINA\\tLB:${sample_id}\\tPU:${barcode}\"" | ||
|
|
||
| """ | ||
| bwa-mem2 mem -t ${task.cpus} -R ${readgroup} ${params.optional} ${params.genome} ${fastq} > ${fastq[0].simpleName}.sam | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| process BWAMapping { | ||
| tag {"BWA_MEM2 Mem ${sample_id} - ${rg_id}"} | ||
| label 'BWA_MEM2_2_2_1' | ||
| label 'BWA_MEM2_2_2_1_Mem' | ||
| container = 'library://blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), val(rg_id), path(fastq)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), val(rg_id), path("${rg_id}_sorted.bam"), path("${rg_id}_sorted.bai"), emit: mapped_bams) | ||
|
|
||
| script: | ||
| def barcode = rg_id.split('_')[1] | ||
| def bwa_readgroup = "\"@RG\\tID:${rg_id}\\tSM:${sample_id}\\tPL:ILLUMINA\\tLB:${sample_id}\\tPU:${barcode}\"" | ||
|
|
||
| """ | ||
| bwa-mem2 mem $params.optional -t ${task.cpus} -R $bwa_readgroup $params.genome_fasta $fastq | \ | ||
| samtools sort > ${rg_id}_sorted.bam | ||
| samtools index ${rg_id}_sorted.bam ${rg_id}_sorted.bai | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process AssessSignificance { | ||
| tag {"Control Freec AssessSignificance ${sample_id}"} | ||
| label 'ControlFreec_11_6' | ||
| label 'ControlFreec_11_6_AssessSignificance' | ||
| container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), path("${cnv_file.name}.p.value.txt"), emit: cnv_pvalue) | ||
|
|
||
| script: | ||
| """ | ||
| cat /usr/local/bin/assess_significance.R | R --slave --args ${cnv_file} ${ratio_file} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| process Freec { | ||
| tag {"Control Freec ${sample_id}"} | ||
| label 'ControlFreec_11_6' | ||
| label 'ControlFreec_11_6_Freec' | ||
| container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), path(bam_file), path(bai_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), path("${bam_file.name}_ratio.txt"), path("${bam_file.name}_CNVs"), emit: cnv) | ||
| tuple(val(sample_id), path("${bam_file.name}_sample.cpn"), path("${bam_file.name}_ratio.BedGraph"), path("${bam_file.name}_info.txt"), emit: other) | ||
|
|
||
| script: | ||
| def config = "${sample_id}.config" | ||
| """ | ||
| touch ${config} | ||
| echo "[general]" >> ${config} | ||
| echo "chrLenFile = ${params.chr_len_file}" >> ${config} | ||
| echo "chrFiles = ${params.chr_files}" >> ${config} | ||
| echo "gemMappabilityFile = ${params.gem_mappability_file}" >> ${config} | ||
| echo "ploidy = ${params.ploidy}" >> ${config} | ||
| echo "window = ${params.window}" >> ${config} | ||
| echo "telocentromeric = ${params.telocentromeric}" >> ${config} | ||
| echo "BedGraphOutput=TRUE" >> ${config} | ||
| echo "maxThreads=${task.cpus}" >> ${config} | ||
|
|
||
| echo "[sample]" >> ${config} | ||
| echo "inputFormat = BAM" >> ${config} | ||
| echo "mateFile = ${bam_file}" >> ${config} | ||
|
|
||
| freec -conf ${config} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MakeGraph { | ||
| tag {"Control Freec MakeGraph ${sample_id}"} | ||
| label 'ControlFreec_11_6' | ||
| label 'ControlFreec_11_6_MakeGraph' | ||
| container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), path("${ratio_file.name}.png"), path("${ratio_file.name}.log2.png"), emit: ratio_png) | ||
|
|
||
| script: | ||
| """ | ||
| cat /usr/local/bin/makeGraph.R | R --slave --args ${params.ploidy} ${ratio_file} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MakeGraphChromosome { | ||
| tag {"Control Freec MakeGraphChromosome ${sample_id}"} | ||
| label 'ControlFreec_11_6' | ||
| label 'ControlFreec_11_6_MakeGraphChromosome' | ||
| container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), path("${ratio_file.name}*.png"), emit: ratio_png) | ||
|
|
||
| script: | ||
| """ | ||
| cat /usr/local/bin/makeGraph_Chromosome.R | R --slave --args 1 ${params.ploidy} ${ratio_file} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MakeKaryotype { | ||
| tag {"Control Freec MakeKaryotype ${sample_id}"} | ||
| label 'ControlFreec_11_6' | ||
| label 'ControlFreec_11_6_MakeKaryotype' | ||
| container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample_id), path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(val(sample_id), path("*_karyotype.pdf"), emit: karyotype_pdf) | ||
|
|
||
| script: | ||
| """ | ||
| cat makeKaryotype.R | R --slave --args ${params.ploidy} ${params.maxlevel} ${params.telocentromeric} ${ratio_file} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| process Deseq2Normalize { | ||
| tag "deseq2normalize ${run_id}" | ||
| label 'biconductor_1_28_0' | ||
| label 'biconductor_1_28_0_deseq2normalize' | ||
| container = 'quay.io/biocontainers/bioconductor-deseq2:1.28.0--r40h5f743cb_0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| val(run_id) | ||
| file(counts) | ||
|
|
||
| output: | ||
| file("${run_id}_featureCounts_deseq2.txt") | ||
|
|
||
| script: | ||
| """ | ||
| deseq2Normalize.R ${counts} ${run_id} | ||
| """ | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| process Deseq2Normalize { | ||
| tag "deseq2normalize ${run_id}" | ||
| label 'biconductor_1_38_0' | ||
| label 'biconductor_1_38_0_deseq2normalize' | ||
| container = 'quay.io/biocontainers/bioconductor-deseq2:1.38.0--r42hc247a5b_0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| val(run_id) | ||
| file(counts) | ||
|
|
||
| output: | ||
| file("${run_id}_featureCounts_deseq2.txt") | ||
|
|
||
| script: | ||
| """ | ||
| deseq2Normalize.R ${counts} ${run_id} | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| process dmux { | ||
| tag {"Deeplexicon_dmux"} | ||
| label 'Deeplexicon_1_2_0' | ||
| label 'Deeplexicon_1_2_0_dmux' | ||
| container = 'lpryszcz/deeplexicon:1.2.0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(sample), val(chunk), path(fast5)) | ||
|
|
||
| output: | ||
| tuple(val(sample), val(chunk), path("${sample}_${chunk}.demux2.tsv"), emit:tsv) | ||
|
|
||
| script: | ||
| """ | ||
| #deeplexicon only works when folder is passed, not when fast5 itself is used so put file in folder for further processing | ||
| mkdir fast5_folder | ||
| cp -P ${fast5} fast5_folder/ | ||
| deeplexicon_multi.py dmux \ | ||
| --threads 2 \ | ||
| -p ./fast5_folder/ \ | ||
| -m /deeplexicon/models/resnet20-final.h5 \ | ||
| > ${sample}_${chunk}.demux2.tsv | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process deeplexicon_concatFastq { | ||
| tag {"Deeplexicon_concat_fastq"} | ||
| label 'Deeplexicon_1_2_0' | ||
| label 'Deeplexicon_1_2_0_concat_fastq' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(id), val(chunk), path(fastq)) | ||
|
|
||
| output: | ||
| tuple(val(id), path("${id}_combined.fastq"), emit:fastq) | ||
|
|
||
| script: | ||
| """ | ||
| cat *.fastq.gz > ${id}_combined.fastq.gz | ||
| gunzip ${id}_combined.fastq.gz | ||
| """ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| process split { | ||
| tag {"Deeplexicon_split"} | ||
| label 'Deeplexicon_1_2_0' | ||
| label 'Deeplexicon_1_2_0_split' | ||
| container = 'lpryszcz/deeplexicon:1.2.0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(val(id), path(tsv),path(fastq)) | ||
|
|
||
| output: | ||
| path("*.fastq.gz") | ||
|
|
||
| script: | ||
| """ | ||
| deeplexicon_multi.py split \ | ||
| -i ${tsv} \ | ||
| -o . \ | ||
| -s ${id} \ | ||
| -q ${fastq} | ||
|
|
||
| #deeplexicon outputs plain fastq, so gzip them | ||
| gzip ${id}_bc_*.fastq | ||
| """ | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need an container with samtools? Maybe just use bwa biocontainer?