Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

compare_alpha_diversities.py should have a default depth #711

Closed
gregcaporaso opened this issue Feb 28, 2013 · 5 comments
Closed

compare_alpha_diversities.py should have a default depth #711

gregcaporaso opened this issue Feb 28, 2013 · 5 comments
Labels
Milestone

Comments

@gregcaporaso
Copy link
Contributor

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 and qiime.compare_alpha_diversity.compare_alpha_diversities. If the latter gets depth=None then it uses the highest rarefaction depth in rarefaction_lines. This will work well as in a lot of cases the max depth used in alpha_rarefaction.py is the same as the even sampling depth used in beta_diversity.py, so we know we're willing to ignore samples without that many sequences.

@wdwvt1
Copy link
Contributor

wdwvt1 commented Mar 1, 2013

yes - i will handle this (tonight hopefully).

@gregcaporaso
Copy link
Contributor Author

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

@gregcaporaso
Copy link
Contributor Author

@wdwvt1, have you had a chance to check into this?

@wdwvt1
Copy link
Contributor

wdwvt1 commented Mar 8, 2013

@caporaso I haven't forgotten -- just been hyper busy with this
correlations project. I anticipate freedom to solve this next week as well
as another feature request Luke made.

On Thu, Mar 7, 2013 at 7:45 PM, Greg Caporaso notifications@github.comwrote:

@wdwvt1 https://github.com/wdwvt1, have you had a chance to check into
this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/711#issuecomment-14599926
.

@gregcaporaso
Copy link
Contributor Author

OK, thanks! Good luck with the correlations project - looks cool from what I saw in your email about code review.

wdwvt1 added a commit to wdwvt1/qiime that referenced this issue Mar 11, 2013
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.
gregcaporaso added a commit that referenced this issue Mar 12, 2013
gregcaporaso added a commit to gregcaporaso/qiime that referenced this issue Mar 18, 2013
this is the second half of addressing biocore#711 (where the first half was completed in biocore#741)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants