Skip to content

Commit

Permalink
Modifiying quantifier param to make it more scalable
Browse files Browse the repository at this point in the history
  • Loading branch information
atrull314 committed Jan 10, 2025
1 parent 6c6e7ec commit d1f406e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ params {
barcode_format = "10X_3v3"

split_amount = 500000
quantifier = "both"
quantifier = "isoquant,oarfish"

}
4 changes: 2 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@
},
"quantifier": {
"type": "string",
"description": "Describe which quantification tool to use",
"enum": ["oarfish", "isoquant", "both"]
"description": "Provide a comma-delimited options of quantifiers for the pipeline to use. Options: (isoquant, oarfish)",
"pattern": "^(oarfish|isoquant)(,(oarfish|isoquant))*$"
}
},
"required": ["quantifier"],
Expand Down
12 changes: 8 additions & 4 deletions subworkflows/local/process_longread_scrna.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ workflow PROCESS_LONGREAD_SCRNA {
fastq // channel: [ val(meta), path(fastq) ]
rseqc_bed // channel: [ val(meta), path(rseqc_bed) ]
read_bc_info // channel: [ val(meta), path(read_barcode_info) ]
quant_list // list: List of quantifiers to use

skip_save_minimap2_index // bool: Skip saving the minimap2 index
skip_qc // bool: Skip qc steps
skip_rseqc // bool: Skip RSeQC
skip_bam_nanocomp // bool: Skip Nanocomp
quantifier // str: Quantifier
skip_seurat // bool: Skip seurat qc steps
skip_dedup // bool: Skip umitools deduplication
split_umitools_bam // bool: Skip splitting on chromsome for umitools

main:
Expand Down Expand Up @@ -87,7 +88,7 @@ workflow PROCESS_LONGREAD_SCRNA {
ch_dedup_log = Channel.empty()
ch_idxstats = Channel.empty()

if (!params.skip_dedup) {
if (!skip_dedup) {
UMITOOLS_DEDUP_SPLIT(
fasta,
fai,
Expand Down Expand Up @@ -115,7 +116,8 @@ workflow PROCESS_LONGREAD_SCRNA {

ch_gene_qc_stats = Channel.empty()
ch_transcript_qc_stats = Channel.empty()
if (quantifier.equals("oarfish")) {

if (quant_list.contains("oarfish")) {
QUANTIFY_SCRNA_OARFISH (
ch_bam,
ch_bai,
Expand All @@ -126,7 +128,9 @@ workflow PROCESS_LONGREAD_SCRNA {
)
ch_versions = ch_versions.mix(QUANTIFY_SCRNA_OARFISH.out.versions)
ch_transcript_qc_stats = QUANTIFY_SCRNA_OARFISH.out.transcript_qc_stats
} else {
}

if (quant_list.contains("isoquant")) {
QUANTIFY_SCRNA_ISOQUANT (
ch_bam,
ch_bai,
Expand Down
30 changes: 26 additions & 4 deletions workflows/scnanoseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

// Whitelist
if (params.whitelist) {
blaze_whitelist = params.whitelist
}
Expand All @@ -16,6 +17,25 @@ else {
}
}

// Quantifiers

// Associate the quantifiers with the kind of alignment needed
GENOME_QUANT_OPTS = [ 'isoquant' ]
TRANSCRIPT_QUANT_OPTS = [ 'oarfish' ]

genome_quants = []
transcript_quants = []
for (quantifier in params.quantifier.split(',')) {
if (quantifier in GENOME_QUANT_OPTS) {
genome_quants.add(quantifier)
}

if (quantifier in TRANSCRIPT_QUANT_OPTS) {
transcript_quants.add(quantifier)
}
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG FILES
Expand Down Expand Up @@ -389,20 +409,21 @@ workflow SCNANOSEQ {

ch_multiqc_finalqc_files = Channel.empty()

if (params.quantifier.equals('isoquant') || params.quantifier.equals('both')){
if (genome_quants){
PROCESS_LONGREAD_SCRNA_GENOME(
genome_fasta,
genome_fai,
gtf,
ch_extracted_fastq,
ch_rseqc_bed,
ch_corrected_bc_info,
genome_quants,
params.skip_save_minimap2_index,
params.skip_qc,
params.skip_rseqc,
params.skip_bam_nanocomp,
'isoquant',
params.skip_seurat,
params.skip_dedup,
true
)
ch_versions = ch_versions.mix(PROCESS_LONGREAD_SCRNA_GENOME.out.versions)
Expand Down Expand Up @@ -444,20 +465,21 @@ workflow SCNANOSEQ {
)
}

if (params.quantifier.equals('oarfish') || params.quantifier.equals('both')){
if (transcript_quants) {
PROCESS_LONGREAD_SCRNA_TRANSCRIPT (
transcript_fasta,
transcript_fai,
gtf,
ch_extracted_fastq,
ch_rseqc_bed,
ch_corrected_bc_info,
transcript_quants,
params.skip_save_minimap2_index,
params.skip_qc,
true,
params.skip_bam_nanocomp,
'oarfish',
params.skip_seurat,
true,
false
)

Expand Down

0 comments on commit d1f406e

Please sign in to comment.