Commit 7bb5c7ab authored by Jeremy Mathews's avatar Jeremy Mathews

Change main and scripts

parent 49f1f62c
Pipeline #8282 failed with stages
in 13 seconds
......@@ -18,6 +18,7 @@ main.nf
// Define input variables
params.name = "run"
params.ranger = "cellranger"
params.bcl = "${baseDir}/../test_data/simple1/*.tar.gz"
params.designFile = "${baseDir}/../test_data/single1/cellranger-tiny-bcl-simple-1_2_0.csv"
params.mask = ""
......@@ -34,6 +35,7 @@ bclCount = Channel
// Define regular variables
pipelineVersion = "3.0.0_indev"
name = params.name
ranger = params.ranger
designLocation = Channel
.fromPath(params.designFile)
.ifEmpty { exit 1, "design file not found: ${params.designFile}" }
......@@ -43,13 +45,13 @@ outDir = params.outDir
// Define script files
check_designScript = Channel.fromPath("$baseDir/scripts/check_design.py")
untarBCLScript = Channel.fromPath("$baseDir/scripts/untarBCL.sh")
countDesignScript = Channel.fromPath("$baseDir/scripts/countDesign.sh")
fastqcScript = Channel.fromPath("$baseDir/scripts/fastqc.sh")
versionsScript = Channel.fromPath("$baseDir/scripts/generate_versions.py")
referencesScript = Channel.fromPath("$baseDir/scripts/generate_references.py")
versions_pythonScript = Channel.fromPath("$baseDir/scripts/versions_python.sh")
//versions_pigzScript = Channel.fromPath("$baseDir/scripts/versions_pigz.sh")
versions_cellrangerScript = Channel.fromPath("$baseDir/scripts/versions_cellranger.sh")
versions_spacerangerScript = Channel.fromPath("$baseDir/scripts/versions_spaceranger.sh")
versions_bcl2fastqScript = Channel.fromPath("$baseDir/scripts/versions_bcl2fastq.sh")
versions_fastqcScript = Channel.fromPath("$baseDir/scripts/versions_fastqc.sh")
......@@ -90,6 +92,7 @@ log.info """\
BICF cellranger_mkfastq Pipeline
================================
Run name : ${params.name}
Ranger : ${params.ranger}
bcl : ${params.bcl}
Design File : ${params.designFile}
Output Directory: ${params.outDir}
......@@ -163,7 +166,7 @@ process untarBCL {
}
process mkfastq {
process cellranger_mkfastq {
tag "${bcl.simpleName}"
publishDir "${outDir}/${task.process}", mode: 'copy', pattern: "{*/outs/**/*.fastq.gz}"
queue '128GB,256GB,256GBv1,384GB'
......@@ -178,11 +181,14 @@ process mkfastq {
output:
file("fq/${bcl.simpleName}/*.fastq.gz") into fastqPaths
val "${bcl.simpleName}" into bclName
file("**/outs/**/*.fastq.gz") into cellrangerCount mode flatten
file("**/outs/**/*.fastq.gz") into rangerCount mode flatten
file("**/outs/fastq_path/Stats/*") into bqcPaths
file("version_cellranger.txt") into version_cellranger
file("version_ranger.txt") into version_ranger
file("version_bcl2fastq.txt") into version_bcl2fastq
when:
ranger == "cellranger"
script:
"""
hostname
......@@ -192,32 +198,47 @@ process mkfastq {
mkdir fq
mkdir "fq/${bcl.simpleName}"
find . -name "*.fastq.gz" -exec cp {} fq/${bcl.simpleName}/ \\;
bash versions_cellranger.sh > version_cellranger.txt
bash versions_cellranger.sh > version_ranger.txt
bash versions_bcl2fastq.sh > version_bcl2fastq.txt
"""
}
if (bclCount.value == 1) {
process countDesign {
tag "${name}"
publishDir "${outDir}/${task.process}/${name}", mode: 'copy'
process spaceranger_mkfastq {
tag "${bcl.simpleName}"
publishDir "${outDir}/${task.process}", mode: 'copy', pattern: "{*/outs/**/*.fastq.gz}"
queue '128GB,256GB,256GBv1,384GB'
module 'spaceranger/1.1.0:bcl2fastq/2.19.1'
input:
file versions_spacerangerScript
file versions_bcl2fastqScript
each file(bcl) from bclPaths.collect()
file design from designPaths
input:
file countDesignScript
file fastqs from cellrangerCount.collect()
file design from designCount
output:
file("fq/${bcl.simpleName}/*.fastq.gz") into fastqPaths
val "${bcl.simpleName}" into bclName
file("**/outs/**/*.fastq.gz") into rangerCount mode flatten
file("**/outs/fastq_path/Stats/*") into bqcPaths
file("version_ranger.txt") into version_ranger
file("version_bcl2fastq.txt") into version_bcl2fastq
output:
file("Cellranger_Count_Design.csv") into CountDesign
when:
ranger == "spaceranger"
script:
"""
hostname
ulimit -a
bash countDesign.sh
"""
}
script:
"""
hostname
ulimit -u 16384
ulimit -a
spaceranger mkfastq --id=mkfastq_${bcl.simpleName} --run=${bcl} --csv=${design} ${mask}
mkdir fq
mkdir "fq/${bcl.simpleName}"
find . -name "*.fastq.gz" -exec cp {} fq/${bcl.simpleName}/ \\;
bash versions_spaceranger.sh > version_ranger.txt
bash versions_bcl2fastq.sh > version_bcl2fastq.txt
"""
}
......@@ -249,7 +270,7 @@ process fastqc {
process versions {
tag "${name}"
module 'python/3.6.1-2-anaconda:cellranger/3.1.0:bcl2fastq/2.19.1:fastqc/0.11.5:pandoc/2.7'
module 'python/3.6.1-2-anaconda:pandoc/2.7'
input:
file versionsScript
......@@ -258,7 +279,7 @@ process versions {
file version_nextflow
file version_python
//file version_pigz
file version_cellranger
file version_ranger
file version_bcl2fastq
file version_fastqc
file references
......
......@@ -30,7 +30,7 @@ SOFTWARE_REGEX = {
'Nextflow': ['version_nextflow.txt', r"(\S+)"],
'python': ['version_python.txt', r"(\S+)"],
#'pigz': ['version_pigz.txt', r"(\S+)"],
'cellranger': ['version_cellranger.txt', r"(\S+)"],
'10x-ranger': ['version_ranger.txt', r"(\S+)"],
'bcl2fastq': ['version_bcl2fastq.txt', r"(\S+)"],
'fastqc': ['version_fastqc.txt', r"(\S+)"],
}
......@@ -82,7 +82,7 @@ def main():
results['Nextflow'] = '<span style="color:#999999;\">N/A</span>'
results['python'] = '<span style="color:#999999;\">N/A</span>'
#results['pigz'] = '<span style="color:#999999;\">N/A</span>'
results['cellranger'] = '<span style="color:#999999;\">N/A</span>'
results['10x-ranger'] = '<span style="color:#999999;\">N/A</span>'
results['bcl2fastq'] = '<span style="color:#999999;\">N/A</span>'
results['fastqc'] = '<span style="color:#999999;\">N/A</span>'
......
#!/bin/bash
#countDesign.sh
#versions_spaceranger.sh
#*
#* --------------------------------------------------------------------------
#* Licensed under MIT (https://git.biohpc.swmed.edu/BICF/Astrocyte/cellranger_mkfastq/blob/develop/LICENSE)
#* --------------------------------------------------------------------------
#*
fastqs=($(ls *.fastq.gz))
design=$(ls *.csv)
sample=$(cat ${design} | tail -n +2 | cut -d ',' -f2)
echo "Sample,fastq_R1,fastq_R2" > Cellranger_Count_Design.csv;
for i in ${sample};
do
for j in $(seq 1 ${#fastqs[@]});
do
if [[ ${fastqs[${j}-1]} == *_I* ]]; then
continue
elif [[ ${fastqs[${j}-1]} == *${i}* && ${fastqs[${j}]} == *${i}* ]]; then
echo "${i},${fastqs[${j}-1]},${fastqs[${j}]}" >> Cellranger_Count_Design.csv
fi
done
done
spaceranger mkfastq --version | grep 'spaceranger mkfastq ' | sed 's/.*(\(.*\))/\1/'
Markdown is supported
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