-
Notifications
You must be signed in to change notification settings - Fork 2
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
Simplify inputs and outputs for singler #478
Simplify inputs and outputs for singler #478
Conversation
Also add in example of how to join in outputs at the end (enabling separation for cellassign)
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.
LGTM!
meta.celltype_publish_dir = "${params.checkpoints_dir}/celltype/${meta.library_id}"; | ||
meta.singler_dir = "${meta.celltype_publish_dir}/${meta.library_id}_singler"; | ||
meta.cellassign_dir = "${meta.celltype_publish_dir}/${meta.library_id}_cellassign"; | ||
meta.singler_model_file = singler_model_file; | ||
meta.cellassign_reference_file = cellassign_reference_file; | ||
meta.cellassign_reference_name = cellassign_reference_name; | ||
// return simplified input: | ||
[meta, processed_sce] |
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.
so this syntax is augmenting meta as an "intermediate" step before returning [meta, processed_sce]
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.
Correct!
singler_input_ch = celltype_input_ch | ||
// add in singler model or empty file | ||
.map{it.toList() + [file(it[0].singler_model_file ?: empty_file)]} |
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.
Ah I see, so we have the null
s back above, and this file-ifies.
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.
Yes, and the reason for this is that we don't want to store file
objects in the metadata: just strings.
tuple val(meta), path(processed_rds), | ||
path(cellassign_reference_file), val(cellassign_reference_name), | ||
path(singler_dir) | ||
tuple val(meta.library_id), path(singler_dir) |
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.
🎉 for cleaner joining!
So here is an option to make the inputs to the singler step a bit simpler.
I also simplified the outputs to just the library id and the output directory, because I realized if we do them right the join at the end for the final annotation step could be pretty easy, and I included an example of how that would look.
If we follow that patter, we could actually make the cellassign step fully separate, rather than passing in the outputs from singleR. I don't think it matters much: but it might be a bit simpler and a tiny bit more efficient.
I also commented out the final output chunk because I was getting some odd and intermittent errors there that I couldn't figure out... something about concurrent modifications, but the fact that it was intermittent (though never in CI) was making me crazy.