Skip to content
Snippets Groups Projects
Commit dfbcb8c5 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Bring params up to standards

parent aa1769fc
2 merge requests!63Develop,!61Resolve "Update params to current standards"
Pipeline #6543 failed with stages
in 10 seconds
...@@ -20,15 +20,33 @@ params.kitVersion = '3GEXv3' ...@@ -20,15 +20,33 @@ params.kitVersion = '3GEXv3'
params.version = '3.1.0' params.version = '3.1.0'
params.astrocyte = false params.astrocyte = false
params.outDir = "${baseDir}/output" params.outDir = "${baseDir}/output"
params.multiqcConf = "${baseDir}/conf/multiqc_config.yaml"
params.references = "${baseDir}/../docs/references.md"
// Variable error test
if (params.kitVersion == "3GEXv3" && params.version == '2.1.1') { if (params.kitVersion == "3GEXv3" && params.version == '2.1.1') {
print("Cellranger Version 2.1.1 requires kitVersion 2") print("Cellranger Version 2.1.1 requires kitVersion 2")
System.exit(32) System.exit(32)
} }
// Assign variables if astrocyte // Define variables from input
name = params.name
designLocation = Channel
.fromPath(params.designFile)
.ifEmpty { exit 1, "design file not found: ${params.designFile}" }
fastqList = Channel
.fromPath(params.fastq)
.flatten()
.map { file -> [ file.getFileName().toString(), file.toString() ].join("\t") }
.collectFile(name: 'fileList.tsv', newLine: true)
refLocation = Channel
.fromPath(params.genomeLocationFull)
.ifEmpty { exit 1, "referene not found: ${params.genome}" }
expectCells = params.expectCells
forceCells = params.forceCells
chemistryParam = params.chemistryParam
version = params.version
outDir = params.outDir
// Define variables if astrocyte (or from config)
if (params.astrocyte) { if (params.astrocyte) {
print("Running under astrocyte") print("Running under astrocyte")
params.genomeLocation = '/project/apps_database/cellranger/refdata-cellranger-' params.genomeLocation = '/project/apps_database/cellranger/refdata-cellranger-'
...@@ -49,30 +67,14 @@ if (params.astrocyte) { ...@@ -49,30 +67,14 @@ if (params.astrocyte) {
} }
params.genomeLocationFull = params.genomeLocation+params.genome params.genomeLocationFull = params.genomeLocation+params.genome
// Define regular variables // Define constant variables
name = params.name multiqcConf = "${baseDir}/conf/multiqc_config.yaml"
designLocation = Channel references = "${baseDir}/../docs/references.md"
.fromPath(params.designFile)
.ifEmpty { exit 1, "design file not found: ${params.designFile}" }
fastqList = Channel
.fromPath(params.fastq)
.flatten()
.map { file -> [ file.getFileName().toString(), file.toString() ].join("\t") }
.collectFile(name: 'fileList.tsv', newLine: true)
refLocation = Channel
.fromPath(params.genomeLocationFull)
.ifEmpty { exit 1, "referene not found: ${params.genome}" }
expectCells = params.expectCells
forceCells = params.forceCells
chemistryParam = params.chemistryParam
version = params.version
outDir = params.outDir
multiqcConf = params.multiqcConf
references = params.references
/*
* checkDesignFile: check design file for errors
*/
process checkDesignFile { process checkDesignFile {
tag "${name}" tag "${name}"
module 'python/3.6.1-2-anaconda' module 'python/3.6.1-2-anaconda'
...@@ -93,7 +95,6 @@ process checkDesignFile { ...@@ -93,7 +95,6 @@ process checkDesignFile {
fi fi
python3 ${baseDir}/scripts/check_design.py -d \${noSpaceDesign} -f ${fastqList} python3 ${baseDir}/scripts/check_design.py -d \${noSpaceDesign} -f ${fastqList}
""" """
} }
...@@ -104,7 +105,6 @@ samples = designPaths ...@@ -104,7 +105,6 @@ samples = designPaths
.groupTuple() .groupTuple()
//.subscribe { println it } //.subscribe { println it }
// Duplicate variables // Duplicate variables
samples.into { samples.into {
samples211 samples211
...@@ -130,9 +130,10 @@ chemistryParam301 = chemistryParam ...@@ -130,9 +130,10 @@ chemistryParam301 = chemistryParam
chemistryParam302 = chemistryParam chemistryParam302 = chemistryParam
chemistryParam310 = chemistryParam chemistryParam310 = chemistryParam
/*
* count211: run cellranger count version 2.1.1
*/
process count211 { process count211 {
queue '128GB,256GB,256GBv1,384GB' queue '128GB,256GB,256GBv1,384GB'
tag "${sample}" tag "${sample}"
publishDir "${outDir}/${task.process}", mode: 'copy' publishDir "${outDir}/${task.process}", mode: 'copy'
...@@ -170,12 +171,12 @@ process count211 { ...@@ -170,12 +171,12 @@ process count211 {
sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv
""" """
} }
} }
/*
* count211: run cellranger count version 3.0.1
*/
process count301 { process count301 {
queue '128GB,256GB,256GBv1,384GB' queue '128GB,256GB,256GBv1,384GB'
tag "${sample}" tag "${sample}"
publishDir "${outDir}/${task.process}", mode: 'copy' publishDir "${outDir}/${task.process}", mode: 'copy'
...@@ -214,12 +215,12 @@ process count301 { ...@@ -214,12 +215,12 @@ process count301 {
sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv
""" """
} }
} }
/*
* count211: run cellranger count version 3.0.2
*/
process count302 { process count302 {
queue '128GB,256GB,256GBv1,384GB' queue '128GB,256GB,256GBv1,384GB'
tag "${sample}" tag "${sample}"
publishDir "${outDir}/${task.process}", mode: 'copy' publishDir "${outDir}/${task.process}", mode: 'copy'
...@@ -260,12 +261,12 @@ process count302 { ...@@ -260,12 +261,12 @@ process count302 {
sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv
""" """
} }
} }
/*
* count211: run cellranger count version 3.1.0
*/
process count310 { process count310 {
queue '128GB,256GB,256GBv1,384GB' queue '128GB,256GB,256GBv1,384GB'
tag "${sample}" tag "${sample}"
publishDir "${outDir}/${task.process}", mode: 'copy' publishDir "${outDir}/${task.process}", mode: 'copy'
...@@ -305,12 +306,12 @@ process count310 { ...@@ -305,12 +306,12 @@ process count310 {
sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv sed -E 's/("([^"]*)")?(,|\$)/\\2\t/g' ${sample}/outs/metrics_summary.csv | tr -d "," | sed "s/^/${sample}\t/" > ${sample}_metrics_summary.tsv
""" """
} }
} }
/*
* versions: collect too versions into a single yml
*/
process versions { process versions {
tag "${name}" tag "${name}"
module 'python/3.6.1-2-anaconda:pandoc/2.7:multiqc/1.7' module 'python/3.6.1-2-anaconda:pandoc/2.7:multiqc/1.7'
...@@ -329,15 +330,15 @@ process versions { ...@@ -329,15 +330,15 @@ process versions {
python3 "${baseDir}/scripts/generate_versions.py" -f version_*.txt -o versions python3 "${baseDir}/scripts/generate_versions.py" -f version_*.txt -o versions
python3 "${baseDir}/scripts/generate_references.py" -r "${references}" -o references python3 "${baseDir}/scripts/generate_references.py" -r "${references}" -o references
""" """
} }
// Collect all metrics summaries reguardless of cellranger version
metricsSummary = metricsSummary211.mix(metricsSummary301, metricsSummary302, metricsSummary310) metricsSummary = metricsSummary211.mix(metricsSummary301, metricsSummary302, metricsSummary310)
/*
* multiqc: create multiqc report
*/
process multiqc { process multiqc {
tag "${name}" tag "${name}"
publishDir "${outDir}/${task.process}/${name}", mode: 'copy' publishDir "${outDir}/${task.process}/${name}", mode: 'copy'
module 'multiqc/1.7' module 'multiqc/1.7'
...@@ -357,5 +358,4 @@ process multiqc { ...@@ -357,5 +358,4 @@ process multiqc {
sed -i '1s/^.*\tE/Sample\tE/' metrics_summary_mqc.tsv sed -i '1s/^.*\tE/Sample\tE/' metrics_summary_mqc.tsv
multiqc -c ${multiqcConf} . multiqc -c ${multiqcConf} .
""" """
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment