Skip to content
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

Merged

Conversation

jashapiro
Copy link
Member

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.

Also add in example of how to join in outputs at the end (enabling separation for cellassign)
Copy link
Member

@sjspielman sjspielman left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +117 to +124
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]
Copy link
Member

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]

Copy link
Member Author

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)]}
Copy link
Member

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 nulls back above, and this file-ifies.

Copy link
Member Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

🎉 for cleaner joining!

@jashapiro jashapiro merged commit 9d6c36c into jashapiro/singler-folder Oct 2, 2023
@jashapiro jashapiro deleted the jashapiro/simplify-singler-inputs branch October 2, 2023 16:10
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