Skip to content

Commit

Permalink
Make it work without specifying GTF file
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Apr 30, 2024
1 parent 118d754 commit 619d921
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
9 changes: 0 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ nextflow.enable.dsl = 2
include { SCRNASEQ } from './workflows/scrnaseq'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_scrnaseq_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_scrnaseq_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_scrnaseq_pipeline'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
// we cannot modify params. here, we must load the files
ch_genome_fasta = params.genome ? file( getGenomeAttribute('fasta'), checkIfExists: true ) : []
ch_gtf = params.genome ? file( getGenomeAttribute('gtf'), checkIfExists: true ) : []

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -44,8 +41,6 @@ workflow NFCORE_SCRNASEQ {

take:
samplesheet // channel: samplesheet read in from --input
ch_genome_fasta
ch_gtf

main:

Expand All @@ -54,8 +49,6 @@ workflow NFCORE_SCRNASEQ {
//
SCRNASEQ (
samplesheet,
ch_genome_fasta,
ch_gtf
)

emit:
Expand Down Expand Up @@ -90,8 +83,6 @@ workflow {
//
NFCORE_SCRNASEQ (
PIPELINE_INITIALISATION.out.samplesheet,
ch_genome_fasta,
ch_gtf
)

//
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/align_cellrangermulti.nf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ workflow CELLRANGER_MULTI_ALIGN {
//
// Prepare GTF
//
if (!cellranger_gex_index || !cellranger_vdj_index) {
if ( !cellranger_gex_index || (!cellranger_vdj_index && !params.skip_cellrangermulti_vdjref) ) {

// Filter GTF based on gene biotypes passed in params.modules
CELLRANGER_MKGTF ( ch_gtf )
Expand Down
11 changes: 5 additions & 6 deletions workflows/scrnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ include { paramsSummaryMultiqc } from '../subworkflows/nf-core/uti
include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline'
include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_scrnaseq_pipeline'
include { paramsSummaryLog; paramsSummaryMap } from 'plugin/nf-validation'
include { getGenomeAttribute } from '../subworkflows/local/utils_nfcore_scrnaseq_pipeline'



workflow SCRNASEQ {

take:
ch_fastq
ch_genome_fasta
ch_gtf

main:

Expand All @@ -32,9 +32,8 @@ workflow SCRNASEQ {
error "Only cellranger supports `protocol = 'auto'`. Please specify the protocol manually!"
}

// overwrite fasta and gtf if user provide a custom one
ch_genome_fasta = Channel.value(params.fasta ? file(params.fasta) : ch_genome_fasta)
ch_gtf = Channel.value(params.gtf ? file(params.gtf) : ch_gtf)
ch_genome_fasta = params.fasta ? file(params.fasta, checkIfExists: true) : ( params.genome ? file( getGenomeAttribute('fasta'), checkIfExists: true ) : [] )
ch_gtf = params.gtf ? file(params.gtf, checkIfExists: true) : ( params.genome ? file( getGenomeAttribute('gtf'), checkIfExists: true ) : [] )

// general input and params
ch_transcript_fasta = params.transcript_fasta ? file(params.transcript_fasta): []
Expand Down Expand Up @@ -118,7 +117,7 @@ workflow SCRNASEQ {
}

// filter gtf
ch_filter_gtf = GTF_GENE_FILTER ( ch_genome_fasta, ch_gtf ).gtf
ch_filter_gtf = ch_gtf ? GTF_GENE_FILTER ( ch_genome_fasta, ch_gtf ).gtf : []

// Run kallisto bustools pipeline
if (params.aligner == "kallisto") {
Expand Down

0 comments on commit 619d921

Please sign in to comment.