Skip to content

Rename FASTQ files and check sample ids#145

Merged
skrakau merged 4 commits intonf-core:devfrom
skrakau:rename_fastqs
Dec 17, 2020
Merged

Rename FASTQ files and check sample ids#145
skrakau merged 4 commits intonf-core:devfrom
skrakau:rename_fastqs

Conversation

@skrakau
Copy link
Copy Markdown
Member

@skrakau skrakau commented Dec 16, 2020

  • rename all short read FASTQ files to ensure consistent names in reports from FastQC and allow non-unique read file base names
  • added check for unique sample IDs, return error otherwise

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated
  • If necessary, also make a PR on the nf-core/mag branch on the nf-core/test-datasets repo

Comment thread main.nf Outdated
Comment on lines +466 to +467
[ -f "${name}_R1.fastq.gz" ] || ln -s "${reads[0]}" "${name}_R1.fastq.gz"
[ -f "${name}_R2.fastq.gz" ] || ln -s "${reads[1]}" "${name}_R2.fastq.gz"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this is not readable. What does this do?

Guessing: If file "${name}_R1.fastq.gz" doesnt exist than link reads[0} to "${name}_R1.fastq.gz"
If yes, could you write that in an easier understandable way? With an in if such? Like this its short but hard to read, in my opinion.
How does this interact with includeInputs: true, havent seen that one before, I guess it is important if the above link isnt created. But what happens is the link is actually created? Isnt than reads[0] also added to the output channel, provided it follows *.fastq.gz as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh true, I forgot to add the corresponding glob pattern, thanks for reviewing!

includeInputs is important, because by default input files will not be used for the output (https://www.nextflow.io/docs/latest/process.html#output-path), even if the name matches.
I didn't want to rename the input files, that's why I did it this way.

Copy link
Copy Markdown
Collaborator

@d4straub d4straub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@skrakau skrakau merged commit cfc7493 into nf-core:dev Dec 17, 2020
@skrakau skrakau deleted the rename_fastqs branch May 31, 2021 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants