{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/43188478","id":43188478,"diff_hunk":"@@ -608,10 +611,329 @@ def centralize(mat):\n \n     \"\"\"\n     mat = closure(mat)\n-    cen = ss.gmean(mat, axis=0)\n+    cen = scipy.stats.gmean(mat, axis=0)\n     return perturb_inv(mat, cen)\n \n \n+@experimental(as_of=\"0.4.0-dev\")\n+def ancom(table, grouping,\n+          alpha=0.05,\n+          tau=0.02,\n+          theta=0.1,\n+          multiple_comparisons_correction=None,\n+          significance_test=None):\n+    r\"\"\" Performs a differential abundance test using ANCOM\n+\n+    This is done by calculating pairwise log ratios between all features\n+    and performing a significance test to determine if there is a significant\n+    difference in feature ratios with respect to the variable of interest.\n+\n+    In an experiment with only two treatments, this test tests the following\n+    hypothesis for feature :math:`i`\n+\n+    .. math::\n+\n+        H_{0i}: \\mathbb{E}[\\ln(u_i^{(1)})] = \\mathbb{E}[\\ln(u_i^{(2)})]\n+\n+    where :math:`u_i^{(1)}` is the mean abundance for feature :math:`i` in the\n+    first group and :math:`u_i^{(2)}` is the mean abundance for feature\n+    :math:`i` in the second group.\n+\n+    Parameters\n+    ----------\n+    table : pd.DataFrame\n+       A 2D matrix of counts or proportions where the rows correspond to\n+       samples and the columns correspond to features\n+    grouping : pd.Series\n+       Vector of group categories\n+    alpha : float, optional\n+       Significance level for each of the statistical tests\n+    tau : float, optional\n+       A constant used to determine an appropriate cutoff.\n+       A value close to zero indicates a conservative cutoff\n+       This can can be anywhere between 0 and 1 exclusive.\n+    theta : float, optional\n+       Lower bound for the proportion for the W-statistic.\n+       If all W-statistics are lower than theta, then no features\n+       will be detected to be differientially significant\n+       This can can be anywhere between 0 and 1 exclusive.\n+    multiple_comparisons_correction : {None, 'holm-bonferroni'}, optional\n+       The multiple comparison correction procedure to run.  By default\n+       `scipy.stats.f_oneway` is used.\n+    significance_test : function, optional\n+       A statistical significance function to test for significance between\n+       classes.\n+\n+    Returns\n+    -------\n+    pd.DataFrame\n+        A table of features, their W-statistics and whether the null hypothesis\n+        is rejected.\n+\n+        `\"W\"` is the W-statistic, or number of features that a single feature\n+        is tested to be significantly different against.\n+\n+        `\"reject\"` indicates if feature is significantly different or not\n+\n+    See Also\n+    --------\n+    multiplicative_replacement\n+    scipy.stats.ttest_ind\n+    scipy.stats.f_oneway\n+    scipy.stats.wilcoxon\n+    scipy.stats.kruskal\n+\n+    Notes\n+    -----\n+    The developers of this method recommend the following significance tests\n+    ([1]_, Supplementary File 1, top of page 11): the standard parametric\n+    t-test (``scipy.stats.ttest_ind``) or one-way ANOVA\n+    (``scipy.stats.f_oneway``) if the number of groups is greater\n+    than 2, or  non-parametric variants such as Wilcoxon rank sum\n+    (``scipy.stats.wilcoxon``) or Kruskal-Wallis (``scipy.stats.kruskal``)\n+    if the number of groups is greater than 2. Because one-way ANOVA is\n+    equivalent to the standard t-test when the number of groups is two,\n+    we default to ``scipy.stats.f_oneway`` here, which can be used when\n+    there are two or more groups. Users should refer to the documentation\n+    of these tests in SciPy to understand the assumptions made by each test.\n+\n+    This method cannot handle any zero counts as input, since the logarithm\n+    of zero cannot be computed.  While this is an unsolved problem, many\n+    studies have shown promising results by replacing the zeros with pseudo\n+    counts.  This can be also be done via the multiplicative_replacement method","path":"skbio/stats/composition.py","position":130,"original_position":130,"commit_id":"558f177c6f292de4248a0b7f7f70417cb570ff95","original_commit_id":"558f177c6f292de4248a0b7f7f70417cb570ff95","user":{"login":"jairideout","id":1847232,"avatar_url":"https://avatars.githubusercontent.com/u/1847232?v=3","gravatar_id":"","url":"https://api.github.com/users/jairideout","html_url":"https://github.com/jairideout","followers_url":"https://api.github.com/users/jairideout/followers","following_url":"https://api.github.com/users/jairideout/following{/other_user}","gists_url":"https://api.github.com/users/jairideout/gists{/gist_id}","starred_url":"https://api.github.com/users/jairideout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jairideout/subscriptions","organizations_url":"https://api.github.com/users/jairideout/orgs","repos_url":"https://api.github.com/users/jairideout/repos","events_url":"https://api.github.com/users/jairideout/events{/privacy}","received_events_url":"https://api.github.com/users/jairideout/received_events","type":"User","site_admin":false},"body":"backtick multiplicative_replacement and end sentence with period","created_at":"2015-10-27T21:15:15Z","updated_at":"2015-10-27T21:15:15Z","html_url":"https://github.com/biocore/scikit-bio/pull/1114#discussion_r43188478","pull_request_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114","_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/43188478"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/1114#discussion_r43188478"},"pull_request":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114","id":44265665,"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","issue_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114","number":1114,"state":"open","locked":false,"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},"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","created_at":"2015-09-04T22:01:31Z","updated_at":"2015-10-27T21:15:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdf115433ae361b1267caab66f4bc0b1b82e7682","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114/commits","review_comments_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114/comments","review_comment_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1114/comments","statuses_url":"https://api.github.com/repos/biocore/scikit-bio/statuses/558f177c6f292de4248a0b7f7f70417cb570ff95","head":{"label":"mortonjt:ancom","ref":"ancom","sha":"558f177c6f292de4248a0b7f7f70417cb570ff95","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},"repo":{"id":23898042,"name":"scikit-bio","full_name":"mortonjt/scikit-bio","owner":{"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},"private":false,"html_url":"https://github.com/mortonjt/scikit-bio","description":"Core objects, functions and statistics for working with biological data in Python.","fork":true,"url":"https://api.github.com/repos/mortonjt/scikit-bio","forks_url":"https://api.github.com/repos/mortonjt/scikit-bio/forks","keys_url":"https://api.github.com/repos/mortonjt/scikit-bio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mortonjt/scikit-bio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mortonjt/scikit-bio/teams","hooks_url":"https://api.github.com/repos/mortonjt/scikit-bio/hooks","issue_events_url":"https://api.github.com/repos/mortonjt/scikit-bio/issues/events{/number}","events_url":"https://api.github.com/repos/mortonjt/scikit-bio/events","assignees_url":"https://api.github.com/repos/mortonjt/scikit-bio/assignees{/user}","branches_url":"https://api.github.com/repos/mortonjt/scikit-bio/branches{/branch}","tags_url":"https://api.github.com/repos/mortonjt/scikit-bio/tags","blobs_url":"https://api.github.com/repos/mortonjt/scikit-bio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mortonjt/scikit-bio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mortonjt/scikit-bio/git/refs{/sha}","trees_url":"https://api.github.com/repos/mortonjt/scikit-bio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mortonjt/scikit-bio/statuses/{sha}","languages_url":"https://api.github.com/repos/mortonjt/scikit-bio/languages","stargazers_url":"https://api.github.com/repos/mortonjt/scikit-bio/stargazers","contributors_url":"https://api.github.com/repos/mortonjt/scikit-bio/contributors","subscribers_url":"https://api.github.com/repos/mortonjt/scikit-bio/subscribers","subscription_url":"https://api.github.com/repos/mortonjt/scikit-bio/subscription","commits_url":"https://api.github.com/repos/mortonjt/scikit-bio/commits{/sha}","git_commits_url":"https://api.github.com/repos/mortonjt/scikit-bio/git/commits{/sha}","comments_url":"https://api.github.com/repos/mortonjt/scikit-bio/comments{/number}","issue_comment_url":"https://api.github.com/repos/mortonjt/scikit-bio/issues/comments{/number}","contents_url":"https://api.github.com/repos/mortonjt/scikit-bio/contents/{+path}","compare_url":"https://api.github.com/repos/mortonjt/scikit-bio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mortonjt/scikit-bio/merges","archive_url":"https://api.github.com/repos/mortonjt/scikit-bio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mortonjt/scikit-bio/downloads","issues_url":"https://api.github.com/repos/mortonjt/scikit-bio/issues{/number}","pulls_url":"https://api.github.com/repos/mortonjt/scikit-bio/pulls{/number}","milestones_url":"https://api.github.com/repos/mortonjt/scikit-bio/milestones{/number}","notifications_url":"https://api.github.com/repos/mortonjt/scikit-bio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mortonjt/scikit-bio/labels{/name}","releases_url":"https://api.github.com/repos/mortonjt/scikit-bio/releases{/id}","created_at":"2014-09-11T00:39:57Z","updated_at":"2015-04-15T23:45:33Z","pushed_at":"2015-10-24T06:21:57Z","git_url":"git://github.com/mortonjt/scikit-bio.git","ssh_url":"git@github.com:mortonjt/scikit-bio.git","clone_url":"https://github.com/mortonjt/scikit-bio.git","svn_url":"https://github.com/mortonjt/scikit-bio","homepage":"http://scikit-bio.org","size":34614,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"biocore:master","ref":"master","sha":"81a1ce5acb434603c537f832caee64a76db19190","user":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"repo":{"id":15168264,"name":"scikit-bio","full_name":"biocore/scikit-bio","owner":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biocore/scikit-bio","description":"scikit-bio is an open-source, BSD-licensed, Python package providing data structures, algorithms, and educational resources for bioinformatics.","fork":false,"url":"https://api.github.com/repos/biocore/scikit-bio","forks_url":"https://api.github.com/repos/biocore/scikit-bio/forks","keys_url":"https://api.github.com/repos/biocore/scikit-bio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/scikit-bio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/scikit-bio/teams","hooks_url":"https://api.github.com/repos/biocore/scikit-bio/hooks","issue_events_url":"https://api.github.com/repos/biocore/scikit-bio/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/scikit-bio/events","assignees_url":"https://api.github.com/repos/biocore/scikit-bio/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/scikit-bio/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/scikit-bio/tags","blobs_url":"https://api.github.com/repos/biocore/scikit-bio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/scikit-bio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/scikit-bio/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/scikit-bio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/scikit-bio/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/scikit-bio/languages","stargazers_url":"https://api.github.com/repos/biocore/scikit-bio/stargazers","contributors_url":"https://api.github.com/repos/biocore/scikit-bio/contributors","subscribers_url":"https://api.github.com/repos/biocore/scikit-bio/subscribers","subscription_url":"https://api.github.com/repos/biocore/scikit-bio/subscription","commits_url":"https://api.github.com/repos/biocore/scikit-bio/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/scikit-bio/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/scikit-bio/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/scikit-bio/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/scikit-bio/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/scikit-bio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/scikit-bio/merges","archive_url":"https://api.github.com/repos/biocore/scikit-bio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/scikit-bio/downloads","issues_url":"https://api.github.com/repos/biocore/scikit-bio/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/scikit-bio/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/scikit-bio/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/scikit-bio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/scikit-bio/labels{/name}","releases_url":"https://api.github.com/repos/biocore/scikit-bio/releases{/id}","created_at":"2013-12-13T16:24:41Z","updated_at":"2015-10-27T13:03:36Z","pushed_at":"2015-10-27T17:41:17Z","git_url":"git://github.com/biocore/scikit-bio.git","ssh_url":"git@github.com:biocore/scikit-bio.git","clone_url":"https://github.com/biocore/scikit-bio.git","svn_url":"https://github.com/biocore/scikit-bio","homepage":"http://scikit-bio.org","size":42253,"stargazers_count":167,"watchers_count":167,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":90,"mirror_url":null,"open_issues_count":162,"forks":90,"open_issues":162,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/1114"},"issue":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/1114"},"comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/1114/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1114/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/scikit-bio/statuses/558f177c6f292de4248a0b7f7f70417cb570ff95"}}}}