biocore / American-Gut

American Gut open-access data and IPython notebooks
Other
111 stars 81 forks source link

Per sample alpha plots #185

Closed jwdebelius closed 8 years ago

jwdebelius commented 8 years ago

Depends on #182 for add_alpha_diversity

Generates the per sample alpha diversity plots: shannon_1k_example

wasade commented 8 years ago

Executing as a function in 09 would save a lot of overhead On Dec 29, 2015 10:58 PM, "J W Debelius" notifications@github.com wrote:

Depends on #182 https://github.com/biocore/American-Gut/pull/182.

Given that the long term plan is to introduce a regression model and shading (if possible). This will require a helper function. It will be absolutely necessary to have tests in place for this function.

The current code is lightweight plotting code. I'm debating passing a debug flag to check that the early logic statements are returning correctly, but most are either core libraries or pandas IO.

I'm not sure if this is better to write as a click command, or as a straight python command that can be imported. I imagine a click command will have to be wrapped in per_sample.py, with something similar to the gradient_pcoa https://github.com/biocore/American-Gut/blob/master/americangut/per_sample.py#L368 function. My concern has to do with writing an appropriate test for the click command, although this can be pushed back. I'm not familiar with this framework, but that's not a good reason not to use it.

The alternative is to run it as a straight python command, and modifying the 09-per-participants-results https://github.com/biocore/American-Gut/blob/master/ipynb/primary-processing/09-per_participant_results.md

notebook.

You can view, comment on, or merge this pull request online at:

https://github.com/biocore/American-Gut/pull/185 Commit Summary

  • Code to create alpha diversity plots
  • Updates collapse to include alpha diversity
  • Adds click command to ag_alpha_plots
  • Removes the test file for a non-click command

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/biocore/American-Gut/pull/185.

jwdebelius commented 8 years ago

Okay, I'll go back to the function version. I think it's easier to test that way.

jwdebelius commented 8 years ago

After much work, I think I've gotten this to pass!

I had to drop the latex import, so its rendering in Ariel (example is Helvetica, but I don't think anyone will notice). Also, I ran into the import issue. With the new (I think) version of matplotlib, it's necessary to specify the backend. I may have been a bit over zealous with that.

@wasade, @squirrelo, @mortonjt, @EmbrietteH: Could you please review?

wasade commented 8 years ago

few small quick comments, :+1: otherwise

jwdebelius commented 8 years ago

Comments mostly addressed.

mortonjt commented 8 years ago

One more minor comment. Otherwise :+1: