-
Notifications
You must be signed in to change notification settings - Fork 187
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
Sort Richness Plots by Observed count #343
Conversation
add an argument and the code to allow sorting by observed counts in the richness plots
Thanks! I love pull requests. I'll check it out. |
}else{ | ||
# Make the ggplot. | ||
p <- ggplot(mdf, richness_map) + geom_point(na.rm=TRUE) | ||
} |
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.
I think I'd prefer this to be a more general sortby
argument, where the sortby
can be any of the measures
or sample_variables
. There is analogous sorting support in the plot_heatmap
function for sorting either the OTU or sample indices (or both) by a specified variable. In this way, "Observed"
would just be one possible argument of many. If more general I think this argument would be worth supporting and I would merge.
Thanks! And let me know if you're willing to mock-up the more general case. I don't want to merge as-is because I don't want to temporarily add an argument I'm soon going to replace with something else...
Hi Joey711, thanks for taking a look. I'll try porting to a general version using zach cp |
Use a generic sortby that can sort using sample_data or measurements. Add a unit test to test each of those.
HI Joey711, Sorry it took me a while to get to this but I've put together a simple function that can sort on any column in the master DF (sample_data and richness measurement). I put a simple unittest and example parameter but am happy to change those. I can also sqush the commits into a single commit to make the history cleaner. thanks again for your patience and your great software package. |
Thanks @zachcp ! I'll need to take a look, and run tests, but don't worry abut condensing the commits. I'll most likely pull this into a separate branch, and add any necessary tests/changes on top. Thanks for the contribution! |
Yep, I'm working on it. See https://github.com/joey711/phyloseq/tree/pr/343 |
As a followup to #342 I put together a working solution. I don't know if/how you would want this feature but I put together a working version for you to look at.