{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/biom-format/pulls/comments/42642964","id":42642964,"diff_hunk":"@@ -0,0 +1,86 @@\n+# ----------------------------------------------------------------------------\n+# Copyright (c) 2011-2013, The BIOM Format Development Team.\n+#\n+# Distributed under the terms of the Modified BSD License.\n+#\n+# The full license is in the file COPYING.txt, distributed with this software.\n+# ----------------------------------------------------------------------------\n+\n+from __future__ import division\n+\n+import click\n+\n+from biom.cli import cli\n+from biom.cli.util import write_biom_table\n+from biom.parse import parse_uc\n+from biom.exception import TableException\n+\n+\n+@cli.command('from-uc')\n+@click.option('-i', '--input-fp', required=True,\n+              type=click.Path(exists=True, dir_okay=False),\n+              help='The input uc filepath.')\n+@click.option('-o', '--output-fp', default=None,\n+              type=click.Path(writable=True),\n+              help='The output BIOM filepath', required=False)\n+@click.option('--rep-set-fp', type=click.Path(exists=True, dir_okay=False),\n+              help=\"Fasta file containing representative sequences with \"\n+                   \"where sequences are labeled with OTU identifiers, and \"\n+                   \"description fields contain original sequence identifiers. \"\n+                   \"This output is created, for example, by vsearch with the \"\n+                   \"--relabel_sha1 --relabel_keep options.\",\n+              required=False)\n+def from_uc(input_fp, output_fp, rep_set_fp):\n+    \"\"\"Create a BIOM table from a vsearch/uclust/usearch BIOM file.\n+\n+    Example usage:\n+\n+    Simple BIOM creation:\n+\n+    $ biom from-uc -i in.uc -o out.biom\n+\n+    BIOM creation with OTU re-naming:\n+\n+    $ biom from-uc -i in.uc -o out.biom --rep-set-fp rep-set.fna\n+\n+    \"\"\"\n+    input_f = open(input_fp, 'U')\n+    if rep_set_fp is not None:\n+        rep_set_f = open(rep_set_fp, 'U')\n+    else:\n+        rep_set_f = None\n+    table = _from_uc(input_f, rep_set_f)\n+    write_biom_table(table, 'hdf5', output_fp)","path":"biom/cli/uc_processor.py","position":53,"original_position":53,"commit_id":"6a365ca2b375dea997a32aa8c92a257387f7109d","original_commit_id":"e8daa0ce7f1700fffa1949f1300875955f52f3db","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"body":"only biom 2.x supported?","created_at":"2015-10-21T15:54:58Z","updated_at":"2015-10-21T15:54:58Z","html_url":"https://github.com/biocore/biom-format/pull/674#discussion_r42642964","pull_request_url":"https://api.github.com/repos/biocore/biom-format/pulls/674","_links":{"self":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/comments/42642964"},"html":{"href":"https://github.com/biocore/biom-format/pull/674#discussion_r42642964"},"pull_request":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/674"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/biom-format/pulls/674","id":48326539,"html_url":"https://github.com/biocore/biom-format/pull/674","diff_url":"https://github.com/biocore/biom-format/pull/674.diff","patch_url":"https://github.com/biocore/biom-format/pull/674.patch","issue_url":"https://api.github.com/repos/biocore/biom-format/issues/674","number":674,"state":"open","locked":false,"title":"added from_uc script","user":{"login":"gregcaporaso","id":192372,"avatar_url":"https://avatars.githubusercontent.com/u/192372?v=3","gravatar_id":"","url":"https://api.github.com/users/gregcaporaso","html_url":"https://github.com/gregcaporaso","followers_url":"https://api.github.com/users/gregcaporaso/followers","following_url":"https://api.github.com/users/gregcaporaso/following{/other_user}","gists_url":"https://api.github.com/users/gregcaporaso/gists{/gist_id}","starred_url":"https://api.github.com/users/gregcaporaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregcaporaso/subscriptions","organizations_url":"https://api.github.com/users/gregcaporaso/orgs","repos_url":"https://api.github.com/users/gregcaporaso/repos","events_url":"https://api.github.com/users/gregcaporaso/events{/privacy}","received_events_url":"https://api.github.com/users/gregcaporaso/received_events","type":"User","site_admin":false},"body":"~~**NOT READY FOR MERGE**~~\r\n\r\nbasic unit tests added, more extensive tests already exist for the parser that contains most of the functionality. ","created_at":"2015-10-21T12:50:49Z","updated_at":"2015-10-21T15:54:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2b871addada9ee3b14bd349c43720ae2948297c","assignee":null,"milestone":{"url":"https://api.github.com/repos/biocore/biom-format/milestones/10","html_url":"https://github.com/biocore/biom-format/milestones/2.1.5:%20py2/3%20compatibility","labels_url":"https://api.github.com/repos/biocore/biom-format/milestones/10/labels","id":1356232,"number":10,"title":"2.1.5: py2/3 compatibility","description":"","creator":{"login":"gregcaporaso","id":192372,"avatar_url":"https://avatars.githubusercontent.com/u/192372?v=3","gravatar_id":"","url":"https://api.github.com/users/gregcaporaso","html_url":"https://github.com/gregcaporaso","followers_url":"https://api.github.com/users/gregcaporaso/followers","following_url":"https://api.github.com/users/gregcaporaso/following{/other_user}","gists_url":"https://api.github.com/users/gregcaporaso/gists{/gist_id}","starred_url":"https://api.github.com/users/gregcaporaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregcaporaso/subscriptions","organizations_url":"https://api.github.com/users/gregcaporaso/orgs","repos_url":"https://api.github.com/users/gregcaporaso/repos","events_url":"https://api.github.com/users/gregcaporaso/events{/privacy}","received_events_url":"https://api.github.com/users/gregcaporaso/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":26,"state":"open","created_at":"2015-10-14T21:31:43Z","updated_at":"2015-10-21T12:50:56Z","due_on":"2015-10-20T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/biocore/biom-format/pulls/674/commits","review_comments_url":"https://api.github.com/repos/biocore/biom-format/pulls/674/comments","review_comment_url":"https://api.github.com/repos/biocore/biom-format/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/biom-format/issues/674/comments","statuses_url":"https://api.github.com/repos/biocore/biom-format/statuses/6a365ca2b375dea997a32aa8c92a257387f7109d","head":{"label":"gregcaporaso:issue-648","ref":"issue-648","sha":"6a365ca2b375dea997a32aa8c92a257387f7109d","user":{"login":"gregcaporaso","id":192372,"avatar_url":"https://avatars.githubusercontent.com/u/192372?v=3","gravatar_id":"","url":"https://api.github.com/users/gregcaporaso","html_url":"https://github.com/gregcaporaso","followers_url":"https://api.github.com/users/gregcaporaso/followers","following_url":"https://api.github.com/users/gregcaporaso/following{/other_user}","gists_url":"https://api.github.com/users/gregcaporaso/gists{/gist_id}","starred_url":"https://api.github.com/users/gregcaporaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregcaporaso/subscriptions","organizations_url":"https://api.github.com/users/gregcaporaso/orgs","repos_url":"https://api.github.com/users/gregcaporaso/repos","events_url":"https://api.github.com/users/gregcaporaso/events{/privacy}","received_events_url":"https://api.github.com/users/gregcaporaso/received_events","type":"User","site_admin":false},"repo":{"id":7094690,"name":"biom-format","full_name":"gregcaporaso/biom-format","owner":{"login":"gregcaporaso","id":192372,"avatar_url":"https://avatars.githubusercontent.com/u/192372?v=3","gravatar_id":"","url":"https://api.github.com/users/gregcaporaso","html_url":"https://github.com/gregcaporaso","followers_url":"https://api.github.com/users/gregcaporaso/followers","following_url":"https://api.github.com/users/gregcaporaso/following{/other_user}","gists_url":"https://api.github.com/users/gregcaporaso/gists{/gist_id}","starred_url":"https://api.github.com/users/gregcaporaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregcaporaso/subscriptions","organizations_url":"https://api.github.com/users/gregcaporaso/orgs","repos_url":"https://api.github.com/users/gregcaporaso/repos","events_url":"https://api.github.com/users/gregcaporaso/events{/privacy}","received_events_url":"https://api.github.com/users/gregcaporaso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gregcaporaso/biom-format","description":"The Biological Observation Matrix (BIOM) Format Project","fork":true,"url":"https://api.github.com/repos/gregcaporaso/biom-format","forks_url":"https://api.github.com/repos/gregcaporaso/biom-format/forks","keys_url":"https://api.github.com/repos/gregcaporaso/biom-format/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gregcaporaso/biom-format/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gregcaporaso/biom-format/teams","hooks_url":"https://api.github.com/repos/gregcaporaso/biom-format/hooks","issue_events_url":"https://api.github.com/repos/gregcaporaso/biom-format/issues/events{/number}","events_url":"https://api.github.com/repos/gregcaporaso/biom-format/events","assignees_url":"https://api.github.com/repos/gregcaporaso/biom-format/assignees{/user}","branches_url":"https://api.github.com/repos/gregcaporaso/biom-format/branches{/branch}","tags_url":"https://api.github.com/repos/gregcaporaso/biom-format/tags","blobs_url":"https://api.github.com/repos/gregcaporaso/biom-format/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gregcaporaso/biom-format/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gregcaporaso/biom-format/git/refs{/sha}","trees_url":"https://api.github.com/repos/gregcaporaso/biom-format/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gregcaporaso/biom-format/statuses/{sha}","languages_url":"https://api.github.com/repos/gregcaporaso/biom-format/languages","stargazers_url":"https://api.github.com/repos/gregcaporaso/biom-format/stargazers","contributors_url":"https://api.github.com/repos/gregcaporaso/biom-format/contributors","subscribers_url":"https://api.github.com/repos/gregcaporaso/biom-format/subscribers","subscription_url":"https://api.github.com/repos/gregcaporaso/biom-format/subscription","commits_url":"https://api.github.com/repos/gregcaporaso/biom-format/commits{/sha}","git_commits_url":"https://api.github.com/repos/gregcaporaso/biom-format/git/commits{/sha}","comments_url":"https://api.github.com/repos/gregcaporaso/biom-format/comments{/number}","issue_comment_url":"https://api.github.com/repos/gregcaporaso/biom-format/issues/comments{/number}","contents_url":"https://api.github.com/repos/gregcaporaso/biom-format/contents/{+path}","compare_url":"https://api.github.com/repos/gregcaporaso/biom-format/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gregcaporaso/biom-format/merges","archive_url":"https://api.github.com/repos/gregcaporaso/biom-format/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gregcaporaso/biom-format/downloads","issues_url":"https://api.github.com/repos/gregcaporaso/biom-format/issues{/number}","pulls_url":"https://api.github.com/repos/gregcaporaso/biom-format/pulls{/number}","milestones_url":"https://api.github.com/repos/gregcaporaso/biom-format/milestones{/number}","notifications_url":"https://api.github.com/repos/gregcaporaso/biom-format/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gregcaporaso/biom-format/labels{/name}","releases_url":"https://api.github.com/repos/gregcaporaso/biom-format/releases{/id}","created_at":"2012-12-10T14:27:53Z","updated_at":"2015-10-19T18:11:53Z","pushed_at":"2015-10-21T15:53:49Z","git_url":"git://github.com/gregcaporaso/biom-format.git","ssh_url":"git@github.com:gregcaporaso/biom-format.git","clone_url":"https://github.com/gregcaporaso/biom-format.git","svn_url":"https://github.com/gregcaporaso/biom-format","homepage":"http://biom-format.org","size":19275,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"biocore:master","ref":"master","sha":"2c0f8d97e9bfe907864b13a9e69ce246c10e8436","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":3999367,"name":"biom-format","full_name":"biocore/biom-format","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/biom-format","description":"The Biological Observation Matrix (BIOM) Format Project","fork":false,"url":"https://api.github.com/repos/biocore/biom-format","forks_url":"https://api.github.com/repos/biocore/biom-format/forks","keys_url":"https://api.github.com/repos/biocore/biom-format/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/biom-format/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/biom-format/teams","hooks_url":"https://api.github.com/repos/biocore/biom-format/hooks","issue_events_url":"https://api.github.com/repos/biocore/biom-format/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/biom-format/events","assignees_url":"https://api.github.com/repos/biocore/biom-format/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/biom-format/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/biom-format/tags","blobs_url":"https://api.github.com/repos/biocore/biom-format/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/biom-format/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/biom-format/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/biom-format/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/biom-format/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/biom-format/languages","stargazers_url":"https://api.github.com/repos/biocore/biom-format/stargazers","contributors_url":"https://api.github.com/repos/biocore/biom-format/contributors","subscribers_url":"https://api.github.com/repos/biocore/biom-format/subscribers","subscription_url":"https://api.github.com/repos/biocore/biom-format/subscription","commits_url":"https://api.github.com/repos/biocore/biom-format/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/biom-format/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/biom-format/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/biom-format/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/biom-format/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/biom-format/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/biom-format/merges","archive_url":"https://api.github.com/repos/biocore/biom-format/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/biom-format/downloads","issues_url":"https://api.github.com/repos/biocore/biom-format/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/biom-format/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/biom-format/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/biom-format/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/biom-format/labels{/name}","releases_url":"https://api.github.com/repos/biocore/biom-format/releases{/id}","created_at":"2012-04-11T23:10:28Z","updated_at":"2015-07-03T05:41:53Z","pushed_at":"2015-10-21T15:50:28Z","git_url":"git://github.com/biocore/biom-format.git","ssh_url":"git@github.com:biocore/biom-format.git","clone_url":"https://github.com/biocore/biom-format.git","svn_url":"https://github.com/biocore/biom-format","homepage":"http://biom-format.org","size":21726,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":46,"forks":37,"open_issues":46,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/674"},"html":{"href":"https://github.com/biocore/biom-format/pull/674"},"issue":{"href":"https://api.github.com/repos/biocore/biom-format/issues/674"},"comments":{"href":"https://api.github.com/repos/biocore/biom-format/issues/674/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/674/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/biom-format/pulls/674/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/biom-format/statuses/6a365ca2b375dea997a32aa8c92a257387f7109d"}}}}