Open
Conversation
Member
|
This is a bit too intrusive to ggcyto codebase just for supporting R factor-level for pdata |
Member
|
RGLab/flowWorkspace#406 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@mikejiang here is my attempt at adding support for custom plot ordering in
ggcytoto address the ordering issues raised here:flowWorkspace: Setting pData factor levels · Issue #297 · RGLab/flowWorkspace
ggcyto: Facet ordering in ggcyto · Issue #76 · RGLab/ggcyto
The proposed approach adds a new
pDataargument to flowSet and GatingSet methods ofggcytoandautoplotto allow users to manually supply metadata with appropriate formatting and ordering (i.e. factor levels). We make sure thatpDatahas exactly the same row and column names as the input cytoset or GatingSet.We simply inherit
pDatawhen fortifying using a data.table join on the rownames. The underlying pData in the cytoset or GatingSet remains unchanged.I've added a couple of tests to the test suite and confirmed that all other tests are passing locally.
Here is a quick demo where I indicate a specific
Treatementorder and reverse theOVAConcorder.Using this method users can automatically reorder by multiple variables without having to manually specify the order for every plot - simply pass the the ordered metadata to each ggcyto or autoplot call for consistent ordering.