{"action":"created","issue":{"url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114","labels_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114/labels{/name}","comments_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114/comments","events_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114/events","html_url":"https://github.com/biocore/scikit-bio/pull/1114","id":104977548,"number":1114,"title":"Ancom","user":{"login":"mortonjt","id":4184797,"avatar_url":"https://avatars.githubusercontent.com/u/4184797?v=3","gravatar_id":"","url":"https://api.github.com/users/mortonjt","html_url":"https://github.com/mortonjt","followers_url":"https://api.github.com/users/mortonjt/followers","following_url":"https://api.github.com/users/mortonjt/following{/other_user}","gists_url":"https://api.github.com/users/mortonjt/gists{/gist_id}","starred_url":"https://api.github.com/users/mortonjt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mortonjt/subscriptions","organizations_url":"https://api.github.com/users/mortonjt/orgs","repos_url":"https://api.github.com/users/mortonjt/repos","events_url":"https://api.github.com/users/mortonjt/events{/privacy}","received_events_url":"https://api.github.com/users/mortonjt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/biocore/scikit-bio/labels/API","name":"API","color":"c7def8"},{"url":"https://api.github.com/repos/biocore/scikit-bio/labels/enhancement","name":"enhancement","color":"006b75"},{"url":"https://api.github.com/repos/biocore/scikit-bio/labels/in%20progress","name":"in progress","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-09-04T22:01:31Z","updated_at":"2015-10-22T23:34:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114","html_url":"https://github.com/biocore/scikit-bio/pull/1114","diff_url":"https://github.com/biocore/scikit-bio/pull/1114.diff","patch_url":"https://github.com/biocore/scikit-bio/pull/1114.patch"},"body":"Here is the a PR for integrating ANCOM  this addresses #1054\r\n\r\nTo address @ebolyen 's concern, it is only a single function with a couple of helper functions.  If you guys think it is too beefy, let me know.\r\n\r\nAlso, there were some parameters in the most up to date version of ANCOM that didn't make complete sense to me.  @wdwvt1 , do you think you could address some of these parameters?  I highlighted them in the code.\r\n\r\nTodo:\r\n- [ ] squash commits"},"comment":{"url":"https://api.github.com/repos/biocore/scikit-bio/issues/comments/150385589","html_url":"https://github.com/biocore/scikit-bio/pull/1114#issuecomment-150385589","issue_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114","id":150385589,"user":{"login":"mortonjt","id":4184797,"avatar_url":"https://avatars.githubusercontent.com/u/4184797?v=3","gravatar_id":"","url":"https://api.github.com/users/mortonjt","html_url":"https://github.com/mortonjt","followers_url":"https://api.github.com/users/mortonjt/followers","following_url":"https://api.github.com/users/mortonjt/following{/other_user}","gists_url":"https://api.github.com/users/mortonjt/gists{/gist_id}","starred_url":"https://api.github.com/users/mortonjt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mortonjt/subscriptions","organizations_url":"https://api.github.com/users/mortonjt/orgs","repos_url":"https://api.github.com/users/mortonjt/repos","events_url":"https://api.github.com/users/mortonjt/events{/privacy}","received_events_url":"https://api.github.com/users/mortonjt/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T23:34:51Z","updated_at":"2015-10-22T23:34:51Z","body":"Yeah ...  The method itself can't handle zeros, since you can't take log of\nzero\n\nThere are a couple of solutions immediately available\n\n1. Run `multiplicative_replacement()`\n2. Replace all of the zeros with 1 (or some other pseudo count)\n\nThis is a thirty year old problem, and it isn't clear what the best\nsolution is.\nSo I think the best solution for the sake of this PR is let the user chose\ntheir favorite solution.\n\nOn Thu, Oct 22, 2015 at 4:31 PM, Greg Caporaso <notifications@github.com>\nwrote:\n\n> @mortonjt <https://github.com/mortonjt>, is it expected that the function\n> will fail if there are any zeros in table? See this example:\n>\n> from skbio.stats.composition import ancomimport pandas as pd#     Now lets load in a pandas dataframe with sample and feature ids for our data matrix\n> table = pd.DataFrame(\n>      [[0, 11., 10., 10., 10., 10., 10.],\n>       [10.5, 11.5, 10.5, 10.5, 10.5, 10.5, 10.5],\n>       [10., 11., 10., 10., 10., 10., 10.],\n>       [20., 21., 10., 10., 10., 10., 10.],\n>       [20.5, 21.5, 10.5, 10.5, 10.5, 10.5, 10.5],\n>       [20.3, 21.3, 10.2, 10.3, 10.1, 10.6, 10.4]],\n>      index=['s1','s2','s3','s4','s5','s6'],\n>      columns=['b1','b2','b3','b4','b5','b6','b7'])\n> cats = pd.Series(['control', 'control', 'control', 'treatment', 'treatment', 'treatment'],\n>                   index=['s1','s2','s3','s4','s5','s6'])\n> results = ancom(table, cats)\n> ---------------------------------------------------------------------------ValueError                                Traceback (most recent call last)<ipython-input-79-8d0a7f9be1ee> in <module>()\n>      13 cats = pd.Series(['control', 'control', 'control', 'treatment', 'treatment', 'treatment'],\n>      14                   index=['s1','s2','s3','s4','s5','s6'])---> 15 results = ancom(table, cats)\n>      16\n> /home/gregcaporaso/code/scikit-bio/skbio/stats/composition.py in ancom(table, groupings, alpha, tau, theta, multiple_comparisons_correction, significance_test)\n>     734                                   % multiple_comparisons_correction)\n>     735 --> 736     mat = _check_composition(table, ignore_zeros=False)\n>     737     cats = pd.Series(groupings)\n>     738\n> /home/gregcaporaso/code/scikit-bio/skbio/stats/composition.py in _check_composition(x, ignore_zeros)\n>     804         feat_labs = np.arange(c)\n>     805     if np.any(mat == 0) and not ignore_zeros:--> 806         raise ValueError('Cannot handle zeros in compositions. '\n>     807                          'Make sure to run a zero replacement method')\n>     808     return pd.DataFrame(mat, index=samp_labs, columns=feat_labs)\n> ValueError: Cannot handle zeros in compositions. Make sure to run a zero replacement method\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/biocore/scikit-bio/pull/1114#issuecomment-150383939>.\n>\n"}}