compare_alpha_diversities.py should have a default depth #711
Comments
yes - i will handle this (tonight hopefully). |
Thanks! I've run into this a few times over the last couple of days with a few different studies so I think it'll be important for using |
@wdwvt1, have you had a chance to check into this? |
@caporaso I haven't forgotten -- just been hyper busy with this On Thu, Mar 7, 2013 at 7:45 PM, Greg Caporaso notifications@github.comwrote:
|
OK, thanks! Good luck with the correlations project - looks cool from what I saw in your email about code review. |
Modifies the defaults as @gregcaporaso suggested so that if a depth is not passed it will use the deepest available. Updated the documentation in the script and library and added a test.
this is the second half of addressing biocore#711 (where the first half was completed in biocore#741)
By default this script should compare at the highest depth. It's not always easy to know what that will be (e.g., in
core_diversity_analyses.py
) so having a reasonable default in place would be useful. @wdwvt1, are you able to work on this?In this case the max rarefaction depth was set to 3138, but due to how the steps worked out the max depth in the collated alpha file was 3130. This causes the following failure from core_diversity_analyses.py:
Traceback (most recent call last): File "/home/ubuntu/qiime_software/qiime-1.6.0-repository-0db466de/bin/compare_alpha_diversity.py", line 173, in <module> main() File "/home/ubuntu/qiime_software/qiime-1.6.0-repository-0db466de/bin/compare_alpha_diversity.py", line 153, in main category, depth, opts.test_type, opts.num_permutations) File "/home/ubuntu/qiime_software/qiime-1.6.0-repository-0db466de/lib/qiime/compare_alpha_diversity.py", line 146, in compare_alpha_diversities rare_mat = (rare_mat.sum(0)/rare_mat.shape[0])[2:] #remove depth,iter cols IndexError: invalid index to scalar variable.
I think the way this should work would be that the value defaults to
None
in both the script interface andqiime.compare_alpha_diversity.compare_alpha_diversities
. If the latter getsdepth=None
then it uses the highest rarefaction depth inrarefaction_lines
. This will work well as in a lot of cases the max depth used inalpha_rarefaction.py
is the same as the even sampling depth used inbeta_diversity.py
, so we know we're willing to ignore samples without that many sequences.The text was updated successfully, but these errors were encountered: