-
Notifications
You must be signed in to change notification settings - Fork 1k
fix issue #5612 - boolean param to optionally log skipped fastqs #5638
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
Closed
glichtenstein
wants to merge
5
commits into
nf-core:master
from
glichtenstein:boolean-parameter-to--log_skipped_fastqs
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
22bc6c5
boolean parameter --log_skipped_fastqs added, filename changed to ski…
glichtenstein 519a943
Final New Line Added
glichtenstein 7ca0df8
Merge branch 'master' into boolean-parameter-to--log_skipped_fastqs
glichtenstein 8e87edb
Merge branch 'master' into boolean-parameter-to--log_skipped_fastqs
glichtenstein ff2e7d2
log_skipped_fastqs -> log_empty_fastqs
glichtenstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,12 +8,13 @@ include { BCLCONVERT } from "../../../modules/nf-core/bclconvert/main" | |||||
| include { BCL2FASTQ } from "../../../modules/nf-core/bcl2fastq/main" | ||||||
|
|
||||||
| // Define the log file path before the workflow starts | ||||||
| def logFile = new File("${params.outdir}/invalid_fastqs.log") | ||||||
| def logFile = new File("${params.outdir}/skipped_fastqs.log") | ||||||
|
|
||||||
| workflow BCL_DEMULTIPLEX { | ||||||
| take: | ||||||
| ch_flowcell // [[id:"", lane:""],samplesheet.csv, path/to/bcl/files] | ||||||
| demultiplexer // bclconvert or bcl2fastq | ||||||
| log_skipped_fastqs // New parameter to control logging of empty FASTQ files | ||||||
|
|
||||||
| main: | ||||||
| ch_versions = Channel.empty() | ||||||
|
|
@@ -118,12 +119,14 @@ def generate_fastq_meta(ch_reads, logFile) { | |||||
| meta.readgroup = readgroup_from_fastq(fastq) | ||||||
| meta.readgroup.SM = meta.samplename | ||||||
| } else { | ||||||
| appendToLogFile( | ||||||
| "Empty or invalid FASTQ file: ${fastq}", | ||||||
| logFile | ||||||
| if (params.log_skipped_fastqs) { | ||||||
|
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.
Suggested change
Contributor
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. For some reason, when I remove |
||||||
| appendToLogFile( | ||||||
| "Empty or invalid FASTQ file: ${fastq}", | ||||||
| logFile | ||||||
| ) | ||||||
| fastq = null | ||||||
| } | ||||||
| } | ||||||
| fastq = null | ||||||
| } | ||||||
|
|
||||||
| return [meta, fastq] | ||||||
| }.filter { it[0] != null } | ||||||
|
|
@@ -132,8 +135,8 @@ def generate_fastq_meta(ch_reads, logFile) { | |||||
| // Add meta.single_end | ||||||
| .map { meta, fastq -> | ||||||
| if (meta != null) { | ||||||
| meta.single_end = fastq.size() == 1 | ||||||
| } | ||||||
| meta.single_end = fastq.size() == 1 | ||||||
| } | ||||||
| return [meta, fastq.flatten()] | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we generally try to avoid using
paramsin subworkflows 😦There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, if not it was ending in some temp workdir, this way it is saved inside the outdir provided in the
nextflow run --outdir /some/path/outdir, shall I remove it and leave it asdef logFile = new File("skipped_fastqs.log")?