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

Sort Richness Plots by Observed count #343

Merged
merged 2 commits into from
May 23, 2014

Conversation

zachcp
Copy link
Contributor

@zachcp zachcp commented May 14, 2014

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.

add an argument and the code to allow sorting by observed counts in the
richness plots
@zachcp
Copy link
Contributor Author

zachcp commented May 14, 2014

Example plot on my data with and without sorting:

image

image

@joey711
Copy link
Owner

joey711 commented May 14, 2014

Thanks! I love pull requests. I'll check it out.

}else{
# Make the ggplot.
p <- ggplot(mdf, richness_map) + geom_point(na.rm=TRUE)
}
Copy link
Owner

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...

@zachcp
Copy link
Contributor Author

zachcp commented May 16, 2014

Hi Joey711,

thanks for taking a look. I'll try porting to a general version using sortby and we can take it fomr there.

zach cp

Use a generic sortby that can sort using sample_data or measurements.
Add a unit test to test each of those.
@zachcp
Copy link
Contributor Author

zachcp commented May 21, 2014

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.
zach cp

@joey711
Copy link
Owner

joey711 commented May 22, 2014

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!

@joey711
Copy link
Owner

joey711 commented May 22, 2014

Yep, I'm working on it. See https://github.com/joey711/phyloseq/tree/pr/343

joey711 added a commit that referenced this pull request May 22, 2014
CHANGES IN VERSION 1.9.6
-------------------------

USER-VISIBLE CHANGES

	- New `sortby` argument in `plot_richness` function.

	- Sort discrete x by one or more alpha-diversity measures

	- Solves [Issue 342](#342)

	- Resolves/merges [Pull
343](#343)
@joey711 joey711 merged commit b497653 into joey711:master May 23, 2014
joey711 added a commit that referenced this pull request May 23, 2014
1.9.6 New sortby argument in plot_richness function

CHANGES IN VERSION 1.9.6

USER-VISIBLE CHANGES

- New `sortby` argument in `plot_richness` function.

- Sort discrete x by one or more alpha-diversity measures

- Solves [Issue 342](#342)

- Resolves/merges [Pull 343](#343)
@zachcp zachcp deleted the orderrichnessplot branch May 23, 2014 00:41
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.

None yet

2 participants