-
Notifications
You must be signed in to change notification settings - Fork 154
Add support for generating taxprofiler/funcscan input samplesheets for preprocessed FASTQs/FASTAs #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Add support for generating taxprofiler/funcscan input samplesheets for preprocessed FASTQs/FASTAs #688
Changes from 6 commits
2a48e7f
3b80e0c
2bd8352
a744175
8672790
be91462
e9df126
e441e76
ddb9c96
bf11fb3
8724961
b354da9
f6b9a99
bec8347
67958ec
997674a
aa71298
0163690
535747c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,6 +194,9 @@ params { | |
| validationShowHiddenParams = false | ||
| validate_params = true | ||
|
|
||
| // Generate downstream samplesheets | ||
| generate_downstream_samplesheets = false | ||
| generate_pipeline_samplesheets = "funcscan,taxprofiler" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this default to null so that users have to opt-in to samplesheet generation?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's a good idea! I will set that in createtaxdb too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference? In both cases null/false as default it would be an opt-in by the user, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah maybe I misunderstood Carson... not sure :D |
||
| } | ||
|
|
||
| // Load base.config by default for all pipelines | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like @jfy133 used only one workflow, which will selectively generate samplesheets based on params.generate_pipeline_samplesheets. Do you think it would be best to keep that consistent?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, since FastQ files are being pulled from the publishDir, it might be a good idea to include options that override user inputs for params.publish_dir_mode (so that it is always 'copy' if a samplesheet is generated) and params.save_clipped_reads, params.save_phixremoved_reads ...etc so that the preprocessed FastQ files are published to the params.outdir if a downstream samplesheet is generated |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| // | ||
| // Subworkflow with functionality specific to the nf-core/mag pipeline | ||
| // | ||
|
|
||
| workflow SAMPLESHEET_TAXPROFILER { | ||
| take: | ||
| ch_reads | ||
|
|
||
| main: | ||
| 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_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 ] | ||
| } | ||
| .tap{ ch_header } | ||
|
|
||
| ch_header | ||
|
jfy133 marked this conversation as resolved.
Outdated
|
||
| .first() | ||
| .map{ it.keySet().join(",") } | ||
| .concat( ch_list_for_samplesheet.map{ it.values().join(",") }) | ||
| .collectFile( | ||
| name:"${params.outdir}/downstream_samplesheet/taxprofiler.csv", | ||
| newLine: true, | ||
| sort: false | ||
| ) | ||
| } | ||
|
|
||
| workflow SAMPLESHEET_FUNCSCAN { | ||
| take: | ||
| ch_assemblies | ||
|
|
||
| main: | ||
| ch_list_for_samplesheet = ch_assemblies | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Next thing which I don't think will be so complicated is to add another input channel for bins, and here make an if/else statement if they want to send just the raw assemblies (all contigs) or binned contigs to the samplesheet. It will need another pipeline level parameter too though |
||
| .map { | ||
| meta, filename -> | ||
| def sample = meta.id | ||
| def fasta = file(params.outdir).toString() + '/Assembly/' + meta.assembler + '/' + filename.getName() | ||
| [ sample: sample, fasta: fasta ] | ||
| } | ||
| .tap{ ch_header } | ||
|
|
||
| ch_header | ||
| .first() | ||
| .map{ it.keySet().join(",") } | ||
| .concat( ch_list_for_samplesheet.map{ it.values().join(",") }) | ||
| .collectFile( | ||
| name:"${params.outdir}/downstream_samplesheet/funcscan.csv", | ||
| newLine: true, | ||
| sort: false | ||
| ) | ||
| } | ||
|
|
||
| workflow GENERATE_DOWNSTREAM_SAMPLESHEETS { | ||
| take: | ||
| ch_reads | ||
| ch_assemblies | ||
|
|
||
| main: | ||
| def downstreampipeline_names = params.generate_pipeline_samplesheets.split(",") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've also implemented the same system in createtaxdb now, but with an additional input validation thing that you should also adopt here (i.e., to check that someone doesn't add an unsupported pipeline, or makes a typo). Check the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
|
||
| if ( downstreampipeline_names.contains('taxprofiler') && params.save_clipped_reads ) { // save_clipped_reads must be true | ||
| SAMPLESHEET_TAXPROFILER(ch_reads) | ||
| } | ||
|
|
||
| if ( downstreampipeline_names.contains('funcscan') ) { | ||
| SAMPLESHEET_FUNCSCAN(ch_assemblies) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.