-
Notifications
You must be signed in to change notification settings - Fork 130
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
Use relative paths for inputs to make the training portable #438
base: master
Are you sure you want to change the base?
Use relative paths for inputs to make the training portable #438
Conversation
The training encoded an absolute path in the samplesheet. This broke the training when ran on a devcontainer. Importantly, Gitpod will be deprecating their custom format in April 2025 and using devcontainers so even if we don't merge this PR it will help indicate what we need to change.
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
hello-nextflow/hello-config/main.nf
Outdated
reads_ch = Channel.fromPath(params.reads_bam) | ||
.splitText() | ||
.map { it.trim() } |
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.
Annoyingly, we need a trim()
in here to make it work. I'm not sure why we need this, but this is the simplest fix I can find.
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.
@adamrtalbot Can this be replaced by a .splitCsv()
. From what I recall it doesn't need the trim
.
Also, if we need to keep the it.trim()
we are moving away from using the implicit it
variable and should instead used named variables in our closures. It's much less confusing to newbies and will become mandatory in a future nextflow version according to Ben.
reads_ch = Channel.fromPath(params.reads_bam) | ||
.splitText() { bamPath -> file(bamPath.trim()) } |
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.
Does anyone know if there's a better way of doing this? Without the map nothing works 😠
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.
splitCsv
?
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.
This is the equivalent splitCsv()
:
reads_ch = Channel.fromPath(params.reads_bam)
.splitCsv()
.map { bamPath -> file(bamPath[0]) }
I think it looks nicer
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.
Yeah. I like that version a lot. It's a lot easier to follow.
One thing we should keep in mind is that, at least for now, it's the same cloud environment for all training materials. We set a default start working directory based on our preferences at the time, but we should use absolute paths in some places to make sure people will be at the right place according to what training they're doing. |
Use splitCsv to parse the sample_bams samplesheet, which means we do not need to strip the newline characters from the file paths and can use relative paths.
f46674c
to
603e7ac
Compare
/data/bam/reads_mother.bam | ||
/data/bam/reads_father.bam | ||
/data/bam/reads_son.bam |
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.
/data/bam/reads_mother.bam | |
/data/bam/reads_father.bam | |
/data/bam/reads_son.bam | |
./data/bam/reads_mother.bam | |
./data/bam/reads_father.bam | |
./data/bam/reads_son.bam |
``` | ||
|
||
This should show `/workspaces/training/hello-nextflow`. The important point is the `hello-nextflow` is the final path. |
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.
This should show `/workspaces/training/hello-nextflow`. The important point is the `hello-nextflow` is the final path. | |
This should show `/workspaces/hello-nextflow`. The important point is the `hello-nextflow` is the final path. |
See #462 for simpler short-term workaround |
The training encoded an absolute path in the samplesheet. This broke the
training when ran on a devcontainer. Importantly, Gitpod will be
deprecating their custom format in April 2025 and using devcontainers
so even if we don't merge this PR it will help indicate what we need to
change.