diff --git a/astrocyte_pkg.yml b/astrocyte_pkg.yml index 095101c02e9f85f87c4f1d5a947ad50c1633c8c4..8181364bef69c246444ccc071edb19aba848fc98 100755 --- a/astrocyte_pkg.yml +++ b/astrocyte_pkg.yml @@ -41,6 +41,7 @@ documentation_files: workflow_modules: - 'python/3.6.1-2-anaconda' - 'cellranger/2.1.1' + - 'cellranger/3.0.1' - 'bcl2fastq/2.17.1.14' # A list of parameters used by the workflow, defining how to present them, @@ -122,6 +123,16 @@ workflow_parameters: description: | Force pipeline to use this number of cells, bypassing the cell detection algorithm. Use this if the number of cells estimated by Cell Ranger is not consistent with the barcode rank plot. A value of 0 ignores this option. Any value other than 0 overrides expect-cells. + - id: version + type: select + default: 3.0.1 + choices: + - [ 3, '3.0.1'] + - [ 2, '2.0.1'] + required: true + description: | + 10x cellranger version. + # ----------------------------------------------------------------------------- # SHINY APP CONFIGURATION # ----------------------------------------------------------------------------- diff --git a/test_data/design.csv b/test_data/design.csv index 9f80938e374370fe87577b2d19aef09fbc638f3f..f7087ee73e8758b6b2bd43748ccf595f1cb7255d 100755 --- a/test_data/design.csv +++ b/test_data/design.csv @@ -1,4 +1,4 @@ -Sample,fastq_R1,fastq_R2 -D17PrPzF_BE,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_BE_S1_L001_R1_001.fastq.gz,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_BE_S1_L001_R2_001.fastq.gz -D17PrPzF_BE,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_BE_S1_L002_R1_001.fastq.gz,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_BE_S1_L002_R2_001.fastq.gz -D17PrPzF_LE,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_LE_S3_L001_R1_001.fastq.gz,/work/urology/ghenry/Grimoire/Astrocyte/cellranger_count/test_data/D17PrPzF_LE_S3_L001_R2_001.fastq.gz +Sample,fastq_R1,fastq_R2 +D17PrPzF_BE,D17PrPzF_BE_S1_L001_R1_001.fastq.gz,D17PrPzF_BE_S1_L001_R2_001.fastq.gz +D17PrPzF_BE,D17PrPzF_BE_S1_L002_R1_001.fastq.gz,D17PrPzF_BE_S1_L002_R2_001.fastq.gz +D17PrPzF_LE,D17PrPzF_LE_S3_L001_R1_001.fastq.gz,D17PrPzF_LE_S3_L001_R2_001.fastq.gz diff --git a/workflow/conf/biohpc.config b/workflow/conf/biohpc.config index fbaca91b52ebdbf6475df54debd4002dcfd41e2a..0b515ecfaa151237a5969d4bf10ad017ded55e4f 100755 --- a/workflow/conf/biohpc.config +++ b/workflow/conf/biohpc.config @@ -7,9 +7,12 @@ process { module = ['python/3.6.1-2-anaconda'] executor = 'local' } - $count { + $count2 { module = ['cellranger/2.1.1'] } + $count3 { + module = ['cellranger/3.0.1'] + } } trace { diff --git a/workflow/main.nf b/workflow/main.nf index 71cb08c6c7088d163cbd8bfb4d8fe220b65a553b..1772db43c5bc5925da0b79d04ca849648312eb0c 100755 --- a/workflow/main.nf +++ b/workflow/main.nf @@ -41,7 +41,6 @@ process checkDesignFile { script: """ - module load python/3.6.1-2-anaconda python3 $baseDir/scripts/check_design.py -d $designLocation -f $fastqList """ } @@ -53,33 +52,78 @@ samples = designPaths .groupTuple() //.subscribe { println it } +// Duplicate variables +samples.into { + samples2 + samples3 +} +refLocation.into { + refLocation2 + refLocation3 +} +expectCells2 = expectCells +expectCells3 = expectCells +forceCells2 = forceCells +forceCells3 = forceCells + +process count2 { + tag "count2-$sample" + + publishDir "$baseDir/output", mode: 'copy' + + input: + + set sample, file("${sample}_S1_L00?_R1_001.fastq.gz"), file("${sample}_S1_L00?_R2_001.fastq.gz") from samples2 + file ref from refLocation2.first() + expectCells2 + forceCells2 + + output: + + file("**/outs/**") into outPaths2 -process count { - tag "$sample" + when: + version == 2 + + script: + if (forceCells2 == 0){ + """ + cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --expect-cells=$expectCells2 + """ + } else { + """ + cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --force-cells=$forceCells2 + """ + } +} + +process count3 { + tag "count3-$sample" publishDir "$baseDir/output", mode: 'copy' input: - set sample, file("${sample}_S1_L00?_R1_001.fastq.gz"), file("${sample}_S1_L00?_R2_001.fastq.gz") from samples - file ref from refLocation.first() - expectCells - forceCells + set sample, file("${sample}_S1_L00?_R1_001.fastq.gz"), file("${sample}_S1_L00?_R2_001.fastq.gz") from samples3 + file ref from refLocation3.first() + expectCells3 + forceCells3 output: - file("**/outs/**") into outPaths + file("**/outs/**") into outPaths3 + + when: + version == 3 script: - if (forceCells == 0){ - """ - module load cellranger/2.1.1 - cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --expect-cells=$expectCells - """ + if (forceCells3 == 0){ + """ + cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --expect-cells=$expectCells3 + """ } else { - """ - module load cellranger/2.1.1 - cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --force-cells=$forceCells - """ + """ + cellranger count --id="$sample" --transcriptome="./$ref" --fastqs=. --sample="$sample" --force-cells=$forceCells3 + """ } }