Pass all channel-related aesthetics to fortify #92
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, this PR implements my proposed fixes for #91.
Currently, only the xy parameters are exposed to
ggplot
through the variousfortify
methods - attached asdims
attribute to theflowSet
. I have expanded thisdims
attribute to capture all top level channel-related aesthetics so that they can be exposed toggplot
along with the x-y channels. With these updates, the following code now works as CD44 is extracted along with CD4 and CD8:You will notice that the points are also sorted based on CD44 intensity for better visualisation. I added support for this by passing the
dims
attribute to.fr2dt()
to allow sorting of rows in the extractedexprs
matrix. At the moment, I have only added support for sorting bysize
,colour
andfill
aesthetics but this can be easily updated in the future.I also made sure that we can still specify
pData()
variables through theaes
as well as per current behaviour with or withoutinteraction()
:It is also not currently possible to display the colour scale legend on these plot above as they have been completely turned off here:
ggcyto/R/ggcyto_flowSet.R
Line 61 in 95559e8
I think that line of code should be removed if possible to allow more control over the legend, it should be perfectly fine to display counts for downsampled data in the legend (this is what CytoExploreR does too). I did have a go at removing this line but a lot of tests fail just because all the hexbin plots gain count legends - I don't see this as an issue and the plots actually look better with the legends included. I have left this line untouched for now until I receive confirmation from you that it is OK to remove it.
I ran all the tests locally for changes included in this PR and all test have passed with the exception of a couple of plots where the ellipses had shifted slightly due to the
lymphGate
gating method.I have also re-rendered all the vignettes which remained unchanged with this PR.