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

bug in observation_metadata_correlation.py #2009

Closed
wdwvt1 opened this issue May 15, 2015 · 2 comments
Closed

bug in observation_metadata_correlation.py #2009

wdwvt1 opened this issue May 15, 2015 · 2 comments
Assignees
Milestone

Comments

@wdwvt1
Copy link
Contributor

wdwvt1 commented May 15, 2015

observation_metadata_correlation.py has a show-stopping bug that causes the script to return incorrect values for any set of mapping file, biom file where the order of the samples returned by iterating over the dictionary representation of the mapping file doesn't end up being the same as the order of the samples in the biom table (I would guess these almost never line up).

Line 202 of scripts/observation_metadata_correlation.py is where the error is. It is simple:

# sort the biom table so that feature values are retrieved in the same
# order as the metadata in the samples they correspond to
bt.sort(sort_f = lambda _: samples_to_correlate, axis='sample')

.sort doesn't work in place, so the sorted biom table is not returned. Simply changing this to return a new biom table object solves the problem.

See here for the user first reporting this issue.

@wdwvt1
Copy link
Contributor Author

wdwvt1 commented May 15, 2015

The reason that QIIME was not catching this bug is because the error was in the script rather than the library file. A refactor of this script would be nice to move the offending functionality to library code.

wdwvt1 added a commit to wdwvt1/qiime that referenced this issue May 15, 2015
wdwvt1 added a commit to wdwvt1/qiime that referenced this issue May 15, 2015
wdwvt1 added a commit to wdwvt1/qiime that referenced this issue May 15, 2015
@jairideout jairideout added this to the QIIME 1.9.1 milestone May 15, 2015
@jairideout
Copy link
Member

Fixed in #2027.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants