Skip to content
Snippets Groups Projects
Commit abe9129c authored by John Lafin's avatar John Lafin
Browse files

Update test inputs

parent 203876e5
Branches
Tags
1 merge request!4Multisample
/* /*
* Copyright (c) 2023. The University of Texas Southwestern Medical Center * Copyright (c) 2023. The University of Texas Southwestern Medical Center
* *
* This file is part of the BioHPC Workflow Platform * This file is part of the BioHPC Workflow Platform
* *
* This is a workflow package to run cellranger count on fastq files from single cell RNA data. * This is a workflow package to run cellranger count on fastq files from single cell RNA data.
* *
* @authors * @authors
* John Lafin * John Lafin
* *
*/ */
// Parameters for input values // Parameters for input values
params.sample_sheet = "${projectDir}/../test_data/sample_sheet.csv" params.sample_sheet = "${projectDir}/../test_data/sample_sheet.csv"
params.fastq = "${projectDir}/../test_data" params.fastq = "${projectDir}/../test_data/fastqs"
params.outDir = "${projectDir}/output" params.outDir = "${projectDir}/output"
params.astrocyte = false params.astrocyte = true
// Run cellranger count // Run cellranger count
process cr_count { process cr_count {
publishDir "${outDir}", mode: 'copy' publishDir "${outDir}", mode: 'copy'
module 'cellranger/7.1.0' module 'cellranger/7.1.0'
module 'singularity/3.9.9' module 'singularity/3.9.9'
errorStrategy 'ignore' errorStrategy 'ignore'
input: input:
tuple val(sample), val(ref), val(expectCells), val(chemistry), val(introns), val(noBam) tuple val(sample), val(ref), val(expectCells), val(chemistry), val(introns), val(noBam)
path(fastq) path(fastq)
path(outDir) path(outDir)
output: output:
tuple val(sample), path("${sample}/outs/**") tuple val(sample), path("${sample}/outs/**")
script: script:
// Check reference // Check reference
if (params.astrocyte) { if (params.astrocyte) {
switch (ref) { switch (ref) {
case "hg38": case "hg38":
ref = file("/project/apps_database/cellranger/refdata-gex-GRCh38-2020-A") ref = file("/project/apps_database/cellranger/refdata-gex-GRCh38-2020-A")
break break
case "mm10": case "mm10":
ref = file("/project/apps_database/cellranger/refdata-gex-mm10-2020-A") ref = file("/project/apps_database/cellranger/refdata-gex-mm10-2020-A")
break break
default: default:
ref = file(ref) ref = file(ref)
} }
} }
if ( ref.isEmpty() ) { if ( ref.isEmpty() ) {
error "Error: Missing reference. Please provide one of the options outlined in the documentation." error "Error: Missing reference. Please provide one of the options outlined in the documentation."
} }
// Run Cell Ranger count // Run Cell Ranger count
if( expectCells == 0 ) if( expectCells == 0 )
if( noBam ) if( noBam )
""" """
cellranger count --id=$sample \ cellranger count --id=$sample \
--transcriptome=$ref \ --transcriptome=$ref \
--fastqs=. \ --fastqs=. \
--sample=$sample \ --sample=$sample \
--chemistry=$chemistry \ --chemistry=$chemistry \
--include-introns=$introns \ --include-introns=$introns \
--no-bam --no-bam
""" """
else else
""" """
cellranger count --id=$sample \ cellranger count --id=$sample \
--transcriptome=$ref \ --transcriptome=$ref \
--fastqs=. \ --fastqs=. \
--sample=$sample \ --sample=$sample \
--chemistry=$chemistry \ --chemistry=$chemistry \
--include-introns=$introns --include-introns=$introns
""" """
else if( expectCells > 0) else if( expectCells > 0)
if( noBam ) if( noBam )
""" """
cellranger count --id=$sample \ cellranger count --id=$sample \
--transcriptome=$ref \ --transcriptome=$ref \
--fastqs=. \ --fastqs=. \
--sample=$sample \ --sample=$sample \
--expect-cells=$expectCells \ --expect-cells=$expectCells \
--chemistry=$chemistry \ --chemistry=$chemistry \
--include-introns=$introns \ --include-introns=$introns \
--no-bam --no-bam
""" """
else else
""" """
cellranger count --id=$sample \ cellranger count --id=$sample \
--transcriptome=$ref \ --transcriptome=$ref \
--fastqs=. \ --fastqs=. \
--sample=$sample \ --sample=$sample \
--expect-cells=$expectCells \ --expect-cells=$expectCells \
--chemistry=$chemistry \ --chemistry=$chemistry \
--include-introns=$introns --include-introns=$introns
""" """
} }
workflow { workflow {
// Parse sample sheet and run cellranger count // Parse sample sheet and run cellranger count
fastq = channel.fromPath(params.fastq).collect() fastq = channel.fromPath(params.fastq).collect()
outDir = channel.value(params.outDir) outDir = channel.value(params.outDir)
input = channel.fromPath(params.sample_sheet) \ input = channel.fromPath(params.sample_sheet) \
| splitCsv(header: true) \ | splitCsv(header: true) \
| map{ row -> tuple( row.sample, row.reference, row.expectCells, row.chemistry, row.introns, row.noBam ) } | map{ row -> tuple( row.sample, row.reference, row.expectCells, row.chemistry, row.introns, row.noBam ) }
cr_count(input, fastq, outDir) cr_count(input, fastq, outDir)
} }
\ No newline at end of file
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