Skip to content

Commit

Permalink
avoid creating extra param
Browse files Browse the repository at this point in the history
  • Loading branch information
ggabernet committed Feb 16, 2024
1 parent ebbd620 commit bc1e316
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 63 deletions.
1 change: 0 additions & 1 deletion conf/test_10x_sc.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ params {

// params
mode = 'fastq'
sc_raw = true
library_generation_method = 'sc_10x_genomics'
clonal_threshold = 0

Expand Down
2 changes: 0 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ params {
// Single cell raw input options
// -----------------------
reference_10x = null
sc_raw = false


// -----------------------
Expand Down Expand Up @@ -296,7 +295,6 @@ profiles {
test_assembled_immcantation_devel_mm { includeConfig 'conf/test_assembled_immcantation_devel_mm.config' }
test_nocluster { includeConfig 'conf/test_nocluster.config' }
test_fetchimgt { includeConfig 'conf/test_fetchimgt.config' }
test_igblast { includeConfig 'conf/test_igblast.config' }
test_10x_sc { includeConfig 'conf/test_10x_sc.config' }
test_clontech_umi { includeConfig 'conf/test_clontech_umi.config' }
test_nebnext_umi { includeConfig 'conf/test_nebnext_umi.config' }
Expand Down
6 changes: 0 additions & 6 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,6 @@
"description": "Path to the reference directory required by cellranger. Can either be directory or tar.gz.",
"help_text": "See for [IMGT](https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/advanced/references#imgt) or [default](https://www.10xgenomics.com/support/software/cell-ranger/downloads).",
"fa_icon": "fas fa-database"
},
"sc_raw": {
"type": "boolean",
"description": "Must be given when raw single cell data should be run.",
"help_text": "Must be given when raw single cell data should be run.",
"fa_icon": "fas fa-database"
}
},
"help_text": "Options for running raw single cell data.",
Expand Down
97 changes: 46 additions & 51 deletions subworkflows/local/sc_raw_input.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,69 +26,64 @@ workflow SC_RAW_INPUT {
ch_reads = FASTQ_INPUT_CHECK.out.reads

// validate library generation method parameter
if (params.library_generation_method == 'sc_10x_genomics') {
if (params.vprimers) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require V-region primers, please provide a reference file instead or select another library method option."
} else if (params.race_linker) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require the --race_linker parameter, please provide a reference file instead or select another library method option."
}
if (params.cprimers) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require C-region primers, please provide a reference file instead or select another library method option."
}
if (params.umi_length > 0) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require to set the UMI length, please provide a reference file instead or select another library method option."
}
if (params.reference_10x) {
// necessary to allow tar.gz files as input so that tests can run
if (params.reference_10x.endsWith(".tar.gz")){
UNZIP_CELLRANGERDB(
params.reference_10x
)
UNZIP_CELLRANGERDB.out.unzipped.set { ch_sc_reference }
} else {
ch_sc_reference = Channel.fromPath(params.reference_10x, checkIfExists: true)
}
if (params.vprimers) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require V-region primers, please provide a reference file instead or select another library method option."
} else if (params.race_linker) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require the --race_linker parameter, please provide a reference file instead or select another library method option."
}
if (params.cprimers) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require C-region primers, please provide a reference file instead or select another library method option."
}
if (params.umi_length > 0) {
error "The transcript-specific primer, 5'-RACE, UMI library generation method does not require to set the UMI length, please provide a reference file instead or select another library method option."
}
if (params.reference_10x) {
// necessary to allow tar.gz files as input so that tests can run
if (params.reference_10x.endsWith(".tar.gz")){
UNZIP_CELLRANGERDB(
params.reference_10x
)
UNZIP_CELLRANGERDB.out.unzipped.set { ch_sc_reference }
} else {
error "The transcript-specific primer, 5'-RACE, UMI library generation method requires you to provide a reference file."
ch_sc_reference = Channel.fromPath(params.reference_10x, checkIfExists: true)
}
} else {
error "The transcript-specific primer, 5'-RACE, UMI library generation method requires you to provide a reference file."
}

// run cellranger vdj
CELLRANGER_VDJ (
ch_reads,
ch_sc_reference
)
ch_versions = ch_versions.mix(CELLRANGER_VDJ.out.versions)
// run cellranger vdj
CELLRANGER_VDJ (
ch_reads,
ch_sc_reference
)
ch_versions = ch_versions.mix(CELLRANGER_VDJ.out.versions)

ch_cellranger_out = CELLRANGER_VDJ.out.outs
ch_cellranger_out = CELLRANGER_VDJ.out.outs

ch_cellranger_out
.map { meta, out_files ->
[ meta, out_files.find { it.endsWith("airr_rearrangement.tsv") } ]
}
.set { ch_cellranger_airr }
ch_cellranger_out
.map { meta, out_files ->
[ meta, out_files.find { it.endsWith("airr_rearrangement.tsv") } ]
}
.set { ch_cellranger_airr }

// TODO : add VALIDATE_INPUT Module
// this module requires input in csv format... Might need to create this in an extra module
// TODO : add VALIDATE_INPUT Module
// this module requires input in csv format... Might need to create this in an extra module

// rename tsv file to unique name
RENAME_FILE_TSV(
ch_cellranger_airr
)
.set { ch_renamed_tsv }
// rename tsv file to unique name
RENAME_FILE_TSV(
ch_cellranger_airr
)
.set { ch_renamed_tsv }

// convert airr tsv to fasta (cellranger does not create any fasta with clonotype information)
CHANGEO_CONVERTDB_FASTA_FROM_AIRR(
RENAME_FILE_TSV.out.file
)
// convert airr tsv to fasta (cellranger does not create any fasta with clonotype information)
CHANGEO_CONVERTDB_FASTA_FROM_AIRR(
RENAME_FILE_TSV.out.file
)

ch_fasta = CHANGEO_CONVERTDB_FASTA_FROM_AIRR.out.fasta
ch_fasta = CHANGEO_CONVERTDB_FASTA_FROM_AIRR.out.fasta

// TODO: here you can add support for MiXCR sc protocols.

} else {
error "The provided library generation method is not supported. Please check the docs for `--library_generation_method`."
}

emit:
versions = ch_versions
// complete cellranger output
Expand Down
6 changes: 3 additions & 3 deletions workflows/airrflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ workflow AIRRFLOW {
if ( params.mode == "fastq" ) {

// SC:Perform sequence assembly if input type is fastq from single-cell sequencing data (currently only 10XGenomics)
if (params.sc_raw) {
if (params.library_generation_method == "sc_10x_genomics") {

SC_RAW_INPUT(
ch_input
)

ch_fasta = SC_RAW_INPUT.out.fasta
ch_versions = ch_versions.mix(SC_RAW_INPUT.out.versions)
ch_cellranger_airr = SC_RAW_INPUT.out.airr
Expand All @@ -122,8 +124,6 @@ workflow AIRRFLOW {
ch_fastqc_postassembly_mqc = Channel.empty()
} else {
// Perform sequence assembly if input type is fastq from bulk sequencing data
// TODO make this part run from ch_reads_split.bulk! -> other input, FASTQ_INPUT_CHECK is not needed then anymore

SEQUENCE_ASSEMBLY(
ch_input,
DATABASES.out.igblast.collect()
Expand Down

0 comments on commit bc1e316

Please sign in to comment.