-
Notifications
You must be signed in to change notification settings - Fork 197
Splitting and grouping side quest #595
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: master
Are you sure you want to change the base?
Splitting and grouping side quest #595
Conversation
First draft of a splitting and grouping side quest. This includes separating samples using filter, then grouping and spreading by intervals. Early version but introduces key operator concepts to participants.
This commit reverses the order to spread over intervals prior to grouping. This achieves two things: 1. It explains everything once and only once to make the tutorial simpler 2. It provides a real world reason for using groupTuple This makes the flow of the tutorial easier to understand, at the cost of very verbose outputs.
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.
Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (3)
- side-quests/splitting_and_grouping/data/intervals.txt: Language not supported
- side-quests/splitting_and_grouping/data/samplesheet.csv: Language not supported
- side-quests/splitting_and_grouping/main.nf: Language not supported
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
NIce! I might simplify the join one by reducing the ways of manipulating the grouping key.
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.
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (2)
- side-quests/splitting_and_grouping/data/samplesheet.csv: Language not supported
- side-quests/splitting_and_grouping/main.nf: Language not supported
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 quite like it.
For the introduction, I would vote for having a small picture illustrating the concept using the mail sorting. Maybe that's just me and the way I tend to memorise things.
Maybe it's because I just looked at the working with file PR, but it feels like, we could finish that module with splitCSV and then reuse it here. That way we could keep files and what to do with them a bit more separate?
Let's move into the project directory. | ||
|
||
```bash | ||
cd side-quests/splitting-and-grouping |
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.
cd side-quests/splitting-and-grouping | |
cd side-quests/splitting_and_grouping |
Co-authored-by: Friederike Hanssen <[email protected]>
|
||
```groovy title="main.nf" linenums="2" hl_lines="5 8 9" | ||
ch_samplesheet = Channel.fromPath("./data/samplesheet.csv") | ||
.splitCsv(header: true) |
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.
Is it worth mentioning that we could have done the mapping here with the same results and that we do this here for teaching purposes?
|
||
Let's now group the samples by this new grouping element, using the [`groupTuple` operator](https://www.nextflow.io/docs/latest/operator.html#grouptuple). | ||
|
||
=== "After" |
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.
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 this is good now. There is just the tiny rendering thing. I still think in a second iteration we should add some illustrations.
First draft of a splitting and grouping side quest. This will likely be part 2 of a 4 part series:
This includes separating samples using filter, then spreading by intervals then grouping together by sample ID and interval (i.e. grouping replicates).
Bad bits so far:
normal_samples*?.fastq1
)Good bits:
map