Skip to content

Commit

Permalink
4 conditions for different short reads outdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
vagkaratzas committed Oct 10, 2024
1 parent 3b80e0c commit 2bd8352
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
20 changes: 15 additions & 5 deletions subworkflows/local/generate_downstream_samplesheets/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@ workflow GENERATE_DOWNSTREAM_SAMPLESHEETS {
ch_reads

main:
ch_header = Channel.empty()
format = 'csv' // most common format in nf-core
format_sep = ','

// Make your samplesheet channel construct here depending on your downstream pipelines
if ( params.generate_pipeline_samplesheets == 'taxprofiler' ) {
if ( params.generate_pipeline_samplesheets == 'taxprofiler' && params.save_clipped_reads ) { // save_clipped_reads must be true
def fastq_rel_path = '/'
if (params.bbnorm) {
fastq_rel_path = '/bbmap/bbnorm/'
} else if (!params.keep_phix) {
fastq_rel_path = '/QC_shortreads/remove_phix/'
}
else if (params.host_fasta) {
fastq_rel_path = '/QC_shortreads/remove_host/'
}
else if (!params.skip_clipping) {
fastq_rel_path = '/QC_shortreads/fastp/'
}
ch_list_for_samplesheet = ch_reads
.map {
meta, fastq ->
def sample = meta.id
def run_accession = meta.id
def instrument_platform = ""
def fastq_1 = file(params.outdir).toString() + '/' + fastq[0].getName()
def fastq_2 = file(params.outdir).toString() + '/' + fastq[1].getName()
def fastq_1 = file(params.outdir).toString() + fastq_rel_path + meta.id + '/' + fastq[0].getName()
def fastq_2 = file(params.outdir).toString() + fastq_rel_path + meta.id + '/' + fastq[1].getName()
def fasta = ""
[ sample: sample, run_accession: run_accession, instrument_platform: instrument_platform, fastq_1: fastq_1, fastq_2: fastq_2, fasta: fasta ]
}
Expand Down
1 change: 0 additions & 1 deletion workflows/mag.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,6 @@ workflow MAG {
ch_input_for_samplesheet = Channel
.empty()
.mix( ch_short_reads_assembly )
.view()

if ( params.generate_downstream_samplesheets ) {
GENERATE_DOWNSTREAM_SAMPLESHEETS ( ch_input_for_samplesheet )
Expand Down

0 comments on commit 2bd8352

Please sign in to comment.