{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/27498285","id":27498285,"diff_hunk":"@@ -0,0 +1,384 @@\n+r\"\"\"\n+Composition Statistics (:mod:`skbio.stats.composition`)\n+=======================================================\n+\n+.. currentmodule:: skbio.stats.composition\n+\n+This module provides functions for compositional data analysis.\n+\n+Many 'omics datasets are inherently compositional - meaning that they\n+are best interpreted as proportions or percentages rather than\n+absolute counts.\n+\n+Formally, :math:`x` is a composition if :math:`\\sum_{i=0}^D x_{i} = c`\n+and :math:`x_{i} > 0`, :math:`1 \\leq i \\leq D` and :math:`c` is a real\n+valued constant and there are :math:`D` components for each\n+composition. In this module :math:`c=1`. Compositional data can be\n+analyzed using Aitchison geometry. [1]_\n+\n+However, in this framework, standard real Euclidean operations such as\n+addition and multiplication no longer apply. Only operations such as\n+perturbation and power can be used to manipulate this data. [1]_\n+\n+This module allows two styles of manipulation of compositional data.\n+Compositional data can be analyzed using perturbation and power\n+operations, which can be useful for simulation studies. The\n+alternative strategy is to transform compositional data into the real\n+space.  Right now, the centre log ratio transform (clr) [1]_ can be\n+used to accomplish this.  This transform can be useful for performing\n+standard statistical tools such as parametric hypothesis testing,\n+regressions and more.\n+\n+The major caveat of using this framework is dealing with zeros.  In\n+the Aitchison geometry, only compositions with nonzero components can\n+be considered. The multiplicative replacement technique [2]_ can be\n+used to substitute these zeros with small pseudocounts without\n+introducing major distortions to the data.\n+\n+Functions\n+---------\n+\n+.. autosummary::\n+   :toctree: generated/\n+\n+   closure\n+   multiplicative_replacement\n+   perturb\n+   perturb_inv\n+   power\n+   clr\n+   centralize\n+\n+Examples\n+--------\n+\n+>>> import numpy as np\n+\n+Consider a very simple environment with only 3 species. The species\n+in the environment are equally distributed and their proportions are\n+equilvalent:","path":"skbio/stats/composition.py","position":59,"original_position":59,"commit_id":"875ff3c64b51191c84c1b6200c5157ad076dddca","original_commit_id":"875ff3c64b51191c84c1b6200c5157ad076dddca","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":"equilvalent -> equivalent","created_at":"2015-03-31T16:52:12Z","updated_at":"2015-03-31T16:52:12Z","html_url":"https://github.com/biocore/scikit-bio/pull/860#discussion_r27498285","pull_request_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/860","_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/27498285"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/860#discussion_r27498285"},"pull_request":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/860"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/860","id":29784050,"html_url":"https://github.com/biocore/scikit-bio/pull/860","diff_url":"https://github.com/biocore/scikit-bio/pull/860.diff","patch_url":"https://github.com/biocore/scikit-bio/pull/860.patch","issue_url":"https://api.github.com/repos/biocore/scikit-bio/issues/860","number":860,"state":"open","locked":false,"title":"Composition Analysis methods","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":"This is continuing the discussion from https://github.com/biocore/scikit-bio/issues/835\r\n\r\nThis methods are the barebones required to construct a compositional biplot\r\n\r\nThe math is a bit funky, so don't hesitate to ask questions - I know that it took me a while to understand it.\r\n\r\n@Jorge-C @ElDeveloper @antgonza are you still willing to look over this PR?","created_at":"2015-02-23T03:16:02Z","updated_at":"2015-03-31T16:52:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"789a685510c8c468e176254eb0a4b26f8a0eab65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/860/commits","review_comments_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/860/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/860/comments","statuses_url":"https://api.github.com/repos/biocore/scikit-bio/statuses/875ff3c64b51191c84c1b6200c5157ad076dddca","head":{"label":"mortonjt:master","ref":"master","sha":"875ff3c64b51191c84c1b6200c5157ad076dddca","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-03-30T20:01:33Z","pushed_at":"2015-03-30T20:01:33Z","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":30277,"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":"79b8eda5bf608d74d636b3913382e0bebea36f30","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":"Core objects, functions and statistics for working with biological data in Python.","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-03-30T17:20:36Z","pushed_at":"2015-03-31T06:14:15Z","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":36701,"stargazers_count":111,"watchers_count":111,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":59,"mirror_url":null,"open_issues_count":118,"forks":59,"open_issues":118,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/860"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/860"},"issue":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/860"},"comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/860/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/860/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/860/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/scikit-bio/statuses/875ff3c64b51191c84c1b6200c5157ad076dddca"}}}}