GitHub PullRequestReviewCommentEvent at 2014-10-30 01:46:44
Repository: qiita
Actor: josenavas
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/biocore/qiita/pulls/comments/19584032","id":19584032,"diff_hunk":"@@ -1245,7 +1216,129 @@ def create(cls, md_template, raw_data, study):\n                                           ', '.join([\"%s\"] * len(headers))),\n             values)\n \n-        return cls(raw_data.id)\n+        return cls(prep_id)\n+\n+    @classmethod\n+    def _check_template_special_columns(cls, md_template, data_type):\n+        r\"\"\"Checks for special columns based on obj type\n+\n+        Parameters\n+        ----------\n+        md_template : DataFrame\n+            The metadata template file contents indexed by sample ids\n+        data_type : str\n+            The data_type of the template.\n+\n+        Returns\n+        -------\n+        set\n+            The set of missing columns\n+\n+        Notes\n+        -----\n+        Sometimes people use different names for the same columns. We just\n+        rename them to use the naming that we expect, so this is normalized\n+        across studies.\n+        \"\"\"\n+        # We only have column requirements if the data type of the raw data\n+        # is one of the target gene types\n+        missing_cols = set()\n+        if data_type in TARGET_GENE_DATA_TYPES:\n+            md_template.rename(columns=RENAME_COLS_DICT, inplace=True)\n+\n+            # Check for all required columns for target genes studies\n+            missing_cols = REQUIRED_TARGET_GENE_COLS.difference(\n+                md_template.columns)\n+\n+        return missing_cols\n+\n+    @classmethod\n+    def delete(cls, id_):\n+        r\"\"\"Deletes the table from the database\n+\n+        Parameters\n+        ----------\n+        id_ : obj\n+            The object identifier\n+\n+        Raises\n+        ------\n+        QiitaDBError\n+            If the prep template already has a preprocessed data\n+        QiitaDBUnknownIDError\n+            If no prep template with id = id_ exists\n+        \"\"\"\n+        table_name = cls._table_name(id_)\n+        conn_handler = SQLConnectionHandler()\n+\n+        if not cls.exists(id_):\n+            raise QiitaDBUnknownIDError(id_, cls.__name__)\n+\n+        preprocessed_data_exists = conn_handler.execute_fetchone(\n+            \"SELECT EXISTS(SELECT * FROM qiita.prep_template_preprocessed_data\"\n+            \" WHERE prep_template_id=%s)\", (id_,))[0]\n+\n+        if preprocessed_data_exists:\n+            raise QiitaDBError(\"Cannot remove prep template %d because a \"","path":"qiita_db/metadata_template.py","position":414,"original_position":414,"commit_id":"4539567e8480f23d95eb6f341023da1e54d1f674","original_commit_id":"d7bdf82b901e58327ec947efc23304a39068f36f","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=2","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"body":"ok...","created_at":"2014-10-30T01:46:44Z","updated_at":"2014-10-30T01:46:44Z","html_url":"https://github.com/biocore/qiita/pull/531#discussion_r19584032","pull_request_url":"https://api.github.com/repos/biocore/qiita/pulls/531","_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/19584032"},"html":{"href":"https://github.com/biocore/qiita/pull/531#discussion_r19584032"},"pull_request":{"href":"https://api.github.com/repos/biocore/qiita/pulls/531"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/qiita/pulls/531","id":23552381,"html_url":"https://github.com/biocore/qiita/pull/531","diff_url":"https://github.com/biocore/qiita/pull/531.diff","patch_url":"https://github.com/biocore/qiita/pull/531.patch","issue_url":"https://api.github.com/repos/biocore/qiita/issues/531","number":531,"state":"open","locked":false,"title":"BLOCKER: Allow multiple templates per raw data","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=2","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"body":"Multiple fixes in the PR:\r\n- Allows multiple prep templates per raw data\r\n- Preprocessed data is now linked with prep template rather than raw data\r\n- Fixes #326 \r\n- Changes on initialize.sql:\r\n  - SPECTRA removed\r\n  - SFF added\r\n  - FASTA -> FASTA-Sanger\r\n\r\nThis PR allows @antgonza to continue with his PR.","created_at":"2014-10-29T18:16:35Z","updated_at":"2014-10-30T01:46:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"702eb85addaa12a7b9f933aece1f388ed34151c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/qiita/pulls/531/commits","review_comments_url":"https://api.github.com/repos/biocore/qiita/pulls/531/comments","review_comment_url":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}","comments_url":"https://api.github.com/repos/biocore/qiita/issues/531/comments","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/4539567e8480f23d95eb6f341023da1e54d1f674","head":{"label":"josenavas:allow-multiple-templates-per-raw-data-hell","ref":"allow-multiple-templates-per-raw-data-hell","sha":"4539567e8480f23d95eb6f341023da1e54d1f674","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=2","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"repo":{"id":13527677,"name":"QiiTa","full_name":"josenavas/QiiTa","owner":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=2","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josenavas/QiiTa","description":"QiiTa databasing effort","fork":true,"url":"https://api.github.com/repos/josenavas/QiiTa","forks_url":"https://api.github.com/repos/josenavas/QiiTa/forks","keys_url":"https://api.github.com/repos/josenavas/QiiTa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josenavas/QiiTa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josenavas/QiiTa/teams","hooks_url":"https://api.github.com/repos/josenavas/QiiTa/hooks","issue_events_url":"https://api.github.com/repos/josenavas/QiiTa/issues/events{/number}","events_url":"https://api.github.com/repos/josenavas/QiiTa/events","assignees_url":"https://api.github.com/repos/josenavas/QiiTa/assignees{/user}","branches_url":"https://api.github.com/repos/josenavas/QiiTa/branches{/branch}","tags_url":"https://api.github.com/repos/josenavas/QiiTa/tags","blobs_url":"https://api.github.com/repos/josenavas/QiiTa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josenavas/QiiTa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josenavas/QiiTa/git/refs{/sha}","trees_url":"https://api.github.com/repos/josenavas/QiiTa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josenavas/QiiTa/statuses/{sha}","languages_url":"https://api.github.com/repos/josenavas/QiiTa/languages","stargazers_url":"https://api.github.com/repos/josenavas/QiiTa/stargazers","contributors_url":"https://api.github.com/repos/josenavas/QiiTa/contributors","subscribers_url":"https://api.github.com/repos/josenavas/QiiTa/subscribers","subscription_url":"https://api.github.com/repos/josenavas/QiiTa/subscription","commits_url":"https://api.github.com/repos/josenavas/QiiTa/commits{/sha}","git_commits_url":"https://api.github.com/repos/josenavas/QiiTa/git/commits{/sha}","comments_url":"https://api.github.com/repos/josenavas/QiiTa/comments{/number}","issue_comment_url":"https://api.github.com/repos/josenavas/QiiTa/issues/comments/{number}","contents_url":"https://api.github.com/repos/josenavas/QiiTa/contents/{+path}","compare_url":"https://api.github.com/repos/josenavas/QiiTa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josenavas/QiiTa/merges","archive_url":"https://api.github.com/repos/josenavas/QiiTa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josenavas/QiiTa/downloads","issues_url":"https://api.github.com/repos/josenavas/QiiTa/issues{/number}","pulls_url":"https://api.github.com/repos/josenavas/QiiTa/pulls{/number}","milestones_url":"https://api.github.com/repos/josenavas/QiiTa/milestones{/number}","notifications_url":"https://api.github.com/repos/josenavas/QiiTa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josenavas/QiiTa/labels{/name}","releases_url":"https://api.github.com/repos/josenavas/QiiTa/releases{/id}","created_at":"2013-10-12T19:29:32Z","updated_at":"2014-08-21T19:09:00Z","pushed_at":"2014-10-30T01:35:33Z","git_url":"git://github.com/josenavas/QiiTa.git","ssh_url":"git@github.com:josenavas/QiiTa.git","clone_url":"https://github.com/josenavas/QiiTa.git","svn_url":"https://github.com/josenavas/QiiTa","homepage":null,"size":110601,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"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":"761cd1fed1235a24b370b3949f32083c2b554adb","user":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=2","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":13131245,"name":"qiita","full_name":"biocore/qiita","owner":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=2","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/qiita","description":"Qiita - A QIIME databasing effort","fork":false,"url":"https://api.github.com/repos/biocore/qiita","forks_url":"https://api.github.com/repos/biocore/qiita/forks","keys_url":"https://api.github.com/repos/biocore/qiita/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/qiita/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/qiita/teams","hooks_url":"https://api.github.com/repos/biocore/qiita/hooks","issue_events_url":"https://api.github.com/repos/biocore/qiita/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/qiita/events","assignees_url":"https://api.github.com/repos/biocore/qiita/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/qiita/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/qiita/tags","blobs_url":"https://api.github.com/repos/biocore/qiita/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/qiita/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/qiita/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/qiita/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/qiita/languages","stargazers_url":"https://api.github.com/repos/biocore/qiita/stargazers","contributors_url":"https://api.github.com/repos/biocore/qiita/contributors","subscribers_url":"https://api.github.com/repos/biocore/qiita/subscribers","subscription_url":"https://api.github.com/repos/biocore/qiita/subscription","commits_url":"https://api.github.com/repos/biocore/qiita/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/qiita/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/qiita/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/qiita/issues/comments/{number}","contents_url":"https://api.github.com/repos/biocore/qiita/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/qiita/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/qiita/merges","archive_url":"https://api.github.com/repos/biocore/qiita/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/qiita/downloads","issues_url":"https://api.github.com/repos/biocore/qiita/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/qiita/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/qiita/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/qiita/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/qiita/labels{/name}","releases_url":"https://api.github.com/repos/biocore/qiita/releases{/id}","created_at":"2013-09-26T18:50:43Z","updated_at":"2014-09-17T04:17:42Z","pushed_at":"2014-10-29T20:07:58Z","git_url":"git://github.com/biocore/qiita.git","ssh_url":"git@github.com:biocore/qiita.git","clone_url":"https://github.com/biocore/qiita.git","svn_url":"https://github.com/biocore/qiita","homepage":"","size":114276,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":136,"forks":11,"open_issues":136,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/531"},"html":{"href":"https://github.com/biocore/qiita/pull/531"},"issue":{"href":"https://api.github.com/repos/biocore/qiita/issues/531"},"comments":{"href":"https://api.github.com/repos/biocore/qiita/issues/531/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/qiita/pulls/531/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/biocore/qiita/pulls/531/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/qiita/statuses/4539567e8480f23d95eb6f341023da1e54d1f674"}}}}