Closed gregcaporaso closed 11 years ago
Here's what a matplotlib boxplot looks like with a single-value distribution (with a value of 2). This was generated with generate_box_plots()
as follows:
>>> from qiime.pycogent_backports.distribution_plots import generate_box_plots
>>> fig = generate_box_plots([[1, 2, 3, 4], [2]])
>>> fig.savefig('foo.png')
OK - that's what I was guessing. It's a little bit of a hack, but I'd be OK going with this as a first pass.
What about axis labels?
On Dec 4, 2012, at 15:54, Jai Ram Rideout notifications@github.com wrote:
Here's https://dl.dropbox.com/u/43778879/foo.png what a matplotlib boxplot looks like with a single-value distribution (with a value of 2). This was generated with generate_box_plots() as follows:
from qiime.pycogent_backports.distribution_plots import generate_box_plots fig = generate_box_plots([[1, 2, 3, 4], [2]]) fig.savefig('foo.png')
— Reply to this email directly or view it on GitHubhttps://github.com/qiime/personal-microbiome-delivery/issues/7#issuecomment-11019590.
Yes, with labels of course (see help(generate_box_plots)
for how to set those). I meant that a plot that looks like this will work for the first pass and we can improve from there as necessary.
We'll generate these plots from the collated alpha data (same input as to make_rarefaction_plots.py
). To get that data for a single rarefaction depth, you can do the following:
from qiime.parse import parse_rarefaction
from qiime.compare_alpha_diversity import extract_rarefaction_scores_at_depth
extract_rarefaction_scores_at_depth(10,parse_rarefaction(open('alpha_div_collated/observed_species.txt','U')))
For the first-delivery milestone, we'll generate these data at 10k sequences/sample, but this value should be a parameter to the command line script.
Looking at this now- wouldn't there be distributions for both self and other, since there are multiple iterations and samples at a particular body site? Or am I misunderstanding what you're wanting to be plotted?
From what I can tell from the description, we're needing a figure for each body site, with two boxplots per figure (one for self, one for other), with each distribution made up of the alpha diversity metric values. Is that right?
You're right - we will have a distribution for each (I realized that after this conversation and forgot to follow up). I'd actually like to have all of these in a single box plot so it's easy to tell which sites are most/least diverse relative to each other.
Great, thanks for explaining. Will put all body sites in a single plot.
A boxplot would probably be good here showing, on a per-body-site basis, other (in a box) with self as a single point next to the box. This might involve some custom code, but @jrrideout is the box-plot-master, so best to check with him on that (e.g., it might be possible to hack using the existing code by just providing each self value as a "single value distribution" which might then only plot the median of that "distribution").