{"action":"created","comment":{"url":"https://api.github.com/repos/hammerlab/cohorts/pulls/comments/80930911","pull_request_review_id":1948760,"id":80930911,"diff_hunk":"@@ -1014,15 +1034,8 @@ def plot_boolean(self,\n         (Test statistic, p-value): (float, float)\n \n         \"\"\"\n-        cols, df = self.as_dataframe(on, col, **kwargs)\n-        if type(cols) == str:\n-            if plot_col is not None:\n-                raise ValueError(\"plot_col is specified when it isn't ndeeded.\")\n-            plot_col = cols\n-        elif type(cols) == list:\n-            if plot_col is None:\n-                raise ValueError(\"plot_col must be specified when multiple `on`s are present.\")\n-\n+        cols, df = self.as_dataframe(on, return_cols=True, **kwargs)\n+        plot_col = self.plot_col_from_cols(cols=cols, plot_col=plot_col)","path":"cohorts/cohort.py","position":255,"original_position":255,"commit_id":"7d52e4d93e7e2cd670236bc895773f292acbaa5c","original_commit_id":"7d52e4d93e7e2cd670236bc895773f292acbaa5c","user":{"login":"arahuja","id":455755,"avatar_url":"https://avatars.githubusercontent.com/u/455755?v=3","gravatar_id":"","url":"https://api.github.com/users/arahuja","html_url":"https://github.com/arahuja","followers_url":"https://api.github.com/users/arahuja/followers","following_url":"https://api.github.com/users/arahuja/following{/other_user}","gists_url":"https://api.github.com/users/arahuja/gists{/gist_id}","starred_url":"https://api.github.com/users/arahuja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arahuja/subscriptions","organizations_url":"https://api.github.com/users/arahuja/orgs","repos_url":"https://api.github.com/users/arahuja/repos","events_url":"https://api.github.com/users/arahuja/events{/privacy}","received_events_url":"https://api.github.com/users/arahuja/received_events","type":"User","site_admin":false},"body":"No need to take plot_col as an argument then? It is always overridden?","created_at":"2016-09-28T14:33:28Z","updated_at":"2016-09-28T14:39:10Z","html_url":"https://github.com/hammerlab/cohorts/pull/150#discussion_r80930911","pull_request_url":"https://api.github.com/repos/hammerlab/cohorts/pulls/150","_links":{"self":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/comments/80930911"},"html":{"href":"https://github.com/hammerlab/cohorts/pull/150#discussion_r80930911"},"pull_request":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/150"}}},"pull_request":{"url":"https://api.github.com/repos/hammerlab/cohorts/pulls/150","id":87046166,"html_url":"https://github.com/hammerlab/cohorts/pull/150","diff_url":"https://github.com/hammerlab/cohorts/pull/150.diff","patch_url":"https://github.com/hammerlab/cohorts/pull/150.patch","issue_url":"https://api.github.com/repos/hammerlab/cohorts/issues/150","number":150,"state":"open","locked":false,"title":"Make API more consistent","user":{"login":"tavinathanson","id":322932,"avatar_url":"https://avatars.githubusercontent.com/u/322932?v=3","gravatar_id":"","url":"https://api.github.com/users/tavinathanson","html_url":"https://github.com/tavinathanson","followers_url":"https://api.github.com/users/tavinathanson/followers","following_url":"https://api.github.com/users/tavinathanson/following{/other_user}","gists_url":"https://api.github.com/users/tavinathanson/gists{/gist_id}","starred_url":"https://api.github.com/users/tavinathanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavinathanson/subscriptions","organizations_url":"https://api.github.com/users/tavinathanson/orgs","repos_url":"https://api.github.com/users/tavinathanson/repos","events_url":"https://api.github.com/users/tavinathanson/events{/privacy}","received_events_url":"https://api.github.com/users/tavinathanson/received_events","type":"User","site_admin":false},"body":"In this PR:\r\n\r\n* The default for `as_dataframe` is to always return just the `DataFrame`, unless `return_cols` is `True`. I use a `DataFrameHolder` `namedtuple` that's generally invisible to the user, in order to pass `return_cols` around and return the right thing.\r\n* `col` is removed from `plot_benefit`, `plot_survival`, etc.\r\n* The `on` API is standardized as `str`/function/list of `str`s or functions/dict of `str`s to `str`s or functions; `plot_benefit`, `plot_survival`, `plot_correlation`, etc. obey this.\r\n* `plot_joint` is now removed in favor of `plot_correlation`. `plot_correlation` uses the `on` API to specify two variables rather than `on_two`.\r\n* Added `coxph`, `bootstrap_auc` and `mean_bootstrap` AUC to the `cohorts` object, and they use the same `on` API.\r\n\r\nExamples of the new API in action:\r\n\r\n```\r\ndf = cohort.as_dataframe(on=missense_snv_count)\r\ncols, df = cohort.as_dataframe(on={\"aa\": \"2-factor score\", \"bb\": missense_snv_count}, return_cols=True)\r\ndf = cohort.as_dataframe({\"hello\": \"2-factor score\", \"goodbye\": missense_snv_count})\r\ncohort.plot_correlation(on={\"aa\": \"2-factor score\", \"bb\": missense_snv_count})\r\ncohort.plot_correlation(on=[\"2-factor score\", missense_snv_count])\r\ncohort.mean_bootstrap_auc(on=\"Age\")\r\ncohort.mean_bootstrap_auc(on=missense_snv_count)\r\n`cohort.coxph(on=[missense_snv_count, \"Age\"])`\r\n```\r\n\r\nHopefully we can get this in before we acquire any new users. I figure this'll be `0.4.0`.\r\n\r\n@arahuja cc @jburos ","created_at":"2016-09-28T02:44:17Z","updated_at":"2016-09-28T14:39:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"541b3d840405f3a42d53299149df654fd71ea9aa","assignee":{"login":"arahuja","id":455755,"avatar_url":"https://avatars.githubusercontent.com/u/455755?v=3","gravatar_id":"","url":"https://api.github.com/users/arahuja","html_url":"https://github.com/arahuja","followers_url":"https://api.github.com/users/arahuja/followers","following_url":"https://api.github.com/users/arahuja/following{/other_user}","gists_url":"https://api.github.com/users/arahuja/gists{/gist_id}","starred_url":"https://api.github.com/users/arahuja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arahuja/subscriptions","organizations_url":"https://api.github.com/users/arahuja/orgs","repos_url":"https://api.github.com/users/arahuja/repos","events_url":"https://api.github.com/users/arahuja/events{/privacy}","received_events_url":"https://api.github.com/users/arahuja/received_events","type":"User","site_admin":false},"assignees":[{"login":"arahuja","id":455755,"avatar_url":"https://avatars.githubusercontent.com/u/455755?v=3","gravatar_id":"","url":"https://api.github.com/users/arahuja","html_url":"https://github.com/arahuja","followers_url":"https://api.github.com/users/arahuja/followers","following_url":"https://api.github.com/users/arahuja/following{/other_user}","gists_url":"https://api.github.com/users/arahuja/gists{/gist_id}","starred_url":"https://api.github.com/users/arahuja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arahuja/subscriptions","organizations_url":"https://api.github.com/users/arahuja/orgs","repos_url":"https://api.github.com/users/arahuja/repos","events_url":"https://api.github.com/users/arahuja/events{/privacy}","received_events_url":"https://api.github.com/users/arahuja/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hammerlab/cohorts/pulls/150/commits","review_comments_url":"https://api.github.com/repos/hammerlab/cohorts/pulls/150/comments","review_comment_url":"https://api.github.com/repos/hammerlab/cohorts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hammerlab/cohorts/issues/150/comments","statuses_url":"https://api.github.com/repos/hammerlab/cohorts/statuses/7d52e4d93e7e2cd670236bc895773f292acbaa5c","head":{"label":"hammerlab:api_updates","ref":"api_updates","sha":"7d52e4d93e7e2cd670236bc895773f292acbaa5c","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":53869966,"name":"cohorts","full_name":"hammerlab/cohorts","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/cohorts","description":"Utilities for analyzing mutations and neoepitopes in patient cohorts","fork":false,"url":"https://api.github.com/repos/hammerlab/cohorts","forks_url":"https://api.github.com/repos/hammerlab/cohorts/forks","keys_url":"https://api.github.com/repos/hammerlab/cohorts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/cohorts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/cohorts/teams","hooks_url":"https://api.github.com/repos/hammerlab/cohorts/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/cohorts/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/cohorts/events","assignees_url":"https://api.github.com/repos/hammerlab/cohorts/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/cohorts/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/cohorts/tags","blobs_url":"https://api.github.com/repos/hammerlab/cohorts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/cohorts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/cohorts/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/cohorts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/cohorts/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/cohorts/languages","stargazers_url":"https://api.github.com/repos/hammerlab/cohorts/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/cohorts/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/cohorts/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/cohorts/subscription","commits_url":"https://api.github.com/repos/hammerlab/cohorts/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/cohorts/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/cohorts/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/cohorts/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/cohorts/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/cohorts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/cohorts/merges","archive_url":"https://api.github.com/repos/hammerlab/cohorts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/cohorts/downloads","issues_url":"https://api.github.com/repos/hammerlab/cohorts/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/cohorts/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/cohorts/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/cohorts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/cohorts/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/cohorts/releases{/id}","deployments_url":"https://api.github.com/repos/hammerlab/cohorts/deployments","created_at":"2016-03-14T15:52:59Z","updated_at":"2016-09-27T15:56:06Z","pushed_at":"2016-09-28T13:24:34Z","git_url":"git://github.com/hammerlab/cohorts.git","ssh_url":"git@github.com:hammerlab/cohorts.git","clone_url":"https://github.com/hammerlab/cohorts.git","svn_url":"https://github.com/hammerlab/cohorts","homepage":null,"size":429,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":3,"default_branch":"master"}},"base":{"label":"hammerlab:master","ref":"master","sha":"c45de626734a0db3ad6da4ecd6a862c99569acba","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":53869966,"name":"cohorts","full_name":"hammerlab/cohorts","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/cohorts","description":"Utilities for analyzing mutations and neoepitopes in patient cohorts","fork":false,"url":"https://api.github.com/repos/hammerlab/cohorts","forks_url":"https://api.github.com/repos/hammerlab/cohorts/forks","keys_url":"https://api.github.com/repos/hammerlab/cohorts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/cohorts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/cohorts/teams","hooks_url":"https://api.github.com/repos/hammerlab/cohorts/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/cohorts/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/cohorts/events","assignees_url":"https://api.github.com/repos/hammerlab/cohorts/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/cohorts/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/cohorts/tags","blobs_url":"https://api.github.com/repos/hammerlab/cohorts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/cohorts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/cohorts/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/cohorts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/cohorts/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/cohorts/languages","stargazers_url":"https://api.github.com/repos/hammerlab/cohorts/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/cohorts/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/cohorts/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/cohorts/subscription","commits_url":"https://api.github.com/repos/hammerlab/cohorts/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/cohorts/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/cohorts/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/cohorts/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/cohorts/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/cohorts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/cohorts/merges","archive_url":"https://api.github.com/repos/hammerlab/cohorts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/cohorts/downloads","issues_url":"https://api.github.com/repos/hammerlab/cohorts/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/cohorts/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/cohorts/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/cohorts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/cohorts/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/cohorts/releases{/id}","deployments_url":"https://api.github.com/repos/hammerlab/cohorts/deployments","created_at":"2016-03-14T15:52:59Z","updated_at":"2016-09-27T15:56:06Z","pushed_at":"2016-09-28T13:24:34Z","git_url":"git://github.com/hammerlab/cohorts.git","ssh_url":"git@github.com:hammerlab/cohorts.git","clone_url":"https://github.com/hammerlab/cohorts.git","svn_url":"https://github.com/hammerlab/cohorts","homepage":null,"size":429,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/150"},"html":{"href":"https://github.com/hammerlab/cohorts/pull/150"},"issue":{"href":"https://api.github.com/repos/hammerlab/cohorts/issues/150"},"comments":{"href":"https://api.github.com/repos/hammerlab/cohorts/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hammerlab/cohorts/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/hammerlab/cohorts/statuses/7d52e4d93e7e2cd670236bc895773f292acbaa5c"}}}}
{"actor":{"display_login":"arahuja"}}