Skip to content

Commit

Permalink
remove redundant sample sheet parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Mar 19, 2024
1 parent db4ec6b commit 656c56c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 41 deletions.
14 changes: 3 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_ampl
//
workflow NFCORE_AMPLISEQ {

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

main:

//
// WORKFLOW: Run pipeline
//
AMPLISEQ (
samplesheet
)
AMPLISEQ ()

emit:
multiqc_report = AMPLISEQ.out.multiqc_report // channel: /path/to/multiqc_report.html
Expand All @@ -67,16 +62,13 @@ workflow {
params.validate_params,
params.monochrome_logs,
args,
params.outdir,
params.input
params.outdir
)

//
// WORKFLOW: Run main workflow
//
NFCORE_AMPLISEQ (
PIPELINE_INITIALISATION.out.samplesheet
)
NFCORE_AMPLISEQ ()

//
// SUBWORKFLOW: Run completion tasks
Expand Down
25 changes: 0 additions & 25 deletions subworkflows/local/utils_nfcore_ampliseq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ workflow PIPELINE_INITIALISATION {
monochrome_logs // boolean: Do not use coloured log outputs
nextflow_cli_args // array: List of positional nextflow CLI args
outdir // string: The output directory where the results will be saved
input // string: Path to input samplesheet

main:

Expand Down Expand Up @@ -94,31 +93,7 @@ workflow PIPELINE_INITIALISATION {
sidlereftaxonomyExistsError()
}

//
// Create channel from input file provided through params.input
//
Channel
.fromSamplesheet("input")
.map {
meta, fastq_1, fastq_2 ->
if (!fastq_2) {
return [ meta.id, meta + [ single_end:true ], [ fastq_1 ] ]
} else {
return [ meta.id, meta + [ single_end:false ], [ fastq_1, fastq_2 ] ]
}
}
.groupTuple()
.map {
validateInputSamplesheet(it)
}
.map {
meta, fastqs ->
return [ meta, fastqs.flatten() ]
}
.set { ch_samplesheet }

emit:
samplesheet = ch_samplesheet
versions = ch_versions
}

Expand Down
6 changes: 1 addition & 5 deletions workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ include { makeComplement } from '../subworkflows/local/utils_nfcore_ampl

workflow AMPLISEQ {

take:
ch_samplesheet // channel: samplesheet read in from --input

main:

ch_versions = Channel.empty()
Expand All @@ -266,7 +263,6 @@ workflow AMPLISEQ {
//
// Create input channels
//
//TODO: --input, --input_folder, --input_fasts, --metadata, --multiregion might need adjustments, because above under "tae:" it is supposed to be coming from!
ch_input_fasta = Channel.empty()
ch_input_reads = Channel.empty()
if ( params.input ) {
Expand Down Expand Up @@ -905,7 +901,7 @@ workflow AMPLISEQ {
ch_metadata.ifEmpty( [] ),
params.input ? file(params.input) : [], // samplesheet input
ch_input_fasta.ifEmpty( [] ), // fasta input
!params.input_fasta && !params.skip_fastqc && !params.skip_multiqc ? MULTIQC.out.plots : [], //.collect().flatten().collectFile(name: "mqc_fastqc_per_sequence_quality_scores_plot_1.svg")
!params.input_fasta && !params.skip_fastqc && !params.skip_multiqc ? MULTIQC.out.plots : [], //.collect().flatten().collectFile(name: "fastqc_per_sequence_quality_scores_plot.svg")
!params.skip_cutadapt ? CUTADAPT_WORKFLOW.out.summary.collect().ifEmpty( [] ) : [],
find_truncation_values,
DADA2_PREPROCESSING.out.args.first().ifEmpty( [] ),
Expand Down

0 comments on commit 656c56c

Please sign in to comment.