{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/micronota/pulls/comments/52782126","id":52782126,"diff_hunk":"@@ -0,0 +1,210 @@\n+r'''\n+UniRef\n+======\n+\n+.. currentmodule:: micronota.db.uniref\n+\n+This module create databases from UniRef for micronota usage. Using UniRef\n+for functional assignment of coding genes, we can get the clustering of\n+the annotated proteins for free. Using UniRef100 as the reference database,\n+we can easily collapse the clusters down to the similarity levels\n+of 90% or 50%. For those UniRef records from UniProKB, we also transfer\n+the metadata associated with those UniProKB records.\n+\n+UniProtKB (UniProt Knowledgebase) [#]_ contains two parts, UniProtKB/Swiss-Prot\n+and UniProtKB/TrEMBL. The first part contains protein records that are\n+manually annotated and reviewed while the second part is done computationally\n+and not manually reviewed.\n+\n+UniParc (UniProt Archive) [#]_ is also part of UniProt project. It is a\n+is a comprehensive and non-redundant database that contains most of the\n+publicly available protein sequences in the world.\n+\n+The UniProt Reference Clusters (UniRef) [#]_ provide clustered sets (UniRef100,\n+UniRef90 and UniRef50 clusters) of sequences from the UniProtKB\n+and selected UniParc records, in order to obtain complete coverage of sequence\n+space at several resolutions (100%, >90% and >50%) while hiding redundant\n+sequences (but not their descriptions) from view.\n+\n+Release\n+-------\n+:version: 2016_01\n+:date:    01/20/2016\n+:link:    ftp://ftp.uniprot.org/pub/databases/uniprot/relnotes.txt\n+\n+Files\n+-----\n+* UniRef files\n+\n+  UniRef fasta files clustered at the similarity levels of 50, 90 or 100.\n+  The UniRef100 identifier is generated by placing \"UniRef100_\" prefix\n+  before the UniProtKB accession number or UniParc identifier of the\n+  representative UniProtKB or UniParc entry. It is similarly done for\n+  UniRef50 or UniRef90.\n+\n+  * uniref50.fasta.gz [#]_\n+\n+  * uniref90.fasta.gz [#]_\n+\n+  * uniref100.fasta.gz [#]_\n+\n+* UniProtKB files\n+\n+  The .dat.gz files contain the UniProtKB records in variant format of EMBL.\n+  The records are divided into taxa groups [#]_.\n+\n+  * uniprot_sprot.dat.gz\n+\n+  * uniprot_trembl.dat.gz\n+\n+Reference\n+---------\n+.. [#] http://www.uniprot.org/help/uniparc\n+.. [#] http://www.uniprot.org/help/uniprotkb\n+.. [#] http://www.ncbi.nlm.nih.gov/pubmed/17379688\n+.. [#] ftp://ftp.uniprot.org/pub/databases/uniprot/uniref/uniref50/README\n+.. [#] ftp://ftp.uniprot.org/pub/databases/uniprot/uniref/uniref90/README\n+.. [#] ftp://ftp.uniprot.org/pub/databases/uniprot/uniref/uniref100/README\n+.. [#] ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/README\n+'''\n+\n+# ----------------------------------------------------------------------------\n+# Copyright (c) 2015--, micronota 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 os.path import join, expanduser\n+from sqlite3 import connect\n+import shutil\n+\n+from skbio import read, Sequence\n+\n+from ..util import _overwrite\n+\n+\n+def prepare_db(out_d, prefix='uniref100', force=False,\n+               server='ftp.uniprot.org',\n+               path='pub/databases/uniprot/uniref/uniref100',\n+               fasta='uniref100.fasta.gz'):\n+    '''Prepare reference database for UniRef.\n+\n+    Notes\n+    -----\n+    This function creates the following files:\n+\n+    * ``uniref100_sprot_archaea.dmnd``\n+    * ``uniref100_sprot_bacteria.dmnd``\n+    * ``uniref100_sprot_viruses.dmnd``\n+    * ``uniref100_sprot_other.dmnd``\n+    * ``uniref100_trembl_archaea.dmnd``\n+    * ``uniref100_trembl_bacteria.dmnd``\n+    * ``uniref100_trembl_viruses.dmnd``\n+    * ``uniref100_trembl_other.dmnd``\n+    * ``uniref100_other.dmnd``\n+\n+    * ``uniprotkb.db``\n+    * ``uniref_100_90_50.db``: the map between UniRef100, UniRef90, and UniRef50.\n+    '''\n+\n+    prepare_metadata(join(expanduser('~'), 'uniref', 'uniprot_sprot.dat.gz'),","path":"micronota/db/uniref.py","position":112,"original_position":112,"commit_id":"fb57a49e0aaf5c91d776275ef797c9193cecdef5","original_commit_id":"fb57a49e0aaf5c91d776275ef797c9193cecdef5","user":{"login":"RNAer","id":1000056,"avatar_url":"https://avatars.githubusercontent.com/u/1000056?v=3","gravatar_id":"","url":"https://api.github.com/users/RNAer","html_url":"https://github.com/RNAer","followers_url":"https://api.github.com/users/RNAer/followers","following_url":"https://api.github.com/users/RNAer/following{/other_user}","gists_url":"https://api.github.com/users/RNAer/gists{/gist_id}","starred_url":"https://api.github.com/users/RNAer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RNAer/subscriptions","organizations_url":"https://api.github.com/users/RNAer/orgs","repos_url":"https://api.github.com/users/RNAer/repos","events_url":"https://api.github.com/users/RNAer/events{/privacy}","received_events_url":"https://api.github.com/users/RNAer/received_events","type":"User","site_admin":false},"body":"that's a testing. not finished yet. will do it right.","created_at":"2016-02-12T18:55:27Z","updated_at":"2016-02-12T18:55:27Z","html_url":"https://github.com/biocore/micronota/pull/43#discussion_r52782126","pull_request_url":"https://api.github.com/repos/biocore/micronota/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/biocore/micronota/pulls/comments/52782126"},"html":{"href":"https://github.com/biocore/micronota/pull/43#discussion_r52782126"},"pull_request":{"href":"https://api.github.com/repos/biocore/micronota/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/micronota/pulls/43","id":59137005,"html_url":"https://github.com/biocore/micronota/pull/43","diff_url":"https://github.com/biocore/micronota/pull/43.diff","patch_url":"https://github.com/biocore/micronota/pull/43.patch","issue_url":"https://api.github.com/repos/biocore/micronota/issues/43","number":43,"state":"open","locked":false,"title":"WIP: big change","user":{"login":"RNAer","id":1000056,"avatar_url":"https://avatars.githubusercontent.com/u/1000056?v=3","gravatar_id":"","url":"https://api.github.com/users/RNAer","html_url":"https://github.com/RNAer","followers_url":"https://api.github.com/users/RNAer/followers","following_url":"https://api.github.com/users/RNAer/following{/other_user}","gists_url":"https://api.github.com/users/RNAer/gists{/gist_id}","starred_url":"https://api.github.com/users/RNAer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RNAer/subscriptions","organizations_url":"https://api.github.com/users/RNAer/orgs","repos_url":"https://api.github.com/users/RNAer/repos","events_url":"https://api.github.com/users/RNAer/events{/privacy}","received_events_url":"https://api.github.com/users/RNAer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-12T06:11:21Z","updated_at":"2016-02-12T18:55:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91694c99d1b1a217b958726c9fae4f860fd9d152","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/micronota/pulls/43/commits","review_comments_url":"https://api.github.com/repos/biocore/micronota/pulls/43/comments","review_comment_url":"https://api.github.com/repos/biocore/micronota/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/micronota/issues/43/comments","statuses_url":"https://api.github.com/repos/biocore/micronota/statuses/fb57a49e0aaf5c91d776275ef797c9193cecdef5","head":{"label":"RNAer:db","ref":"db","sha":"fb57a49e0aaf5c91d776275ef797c9193cecdef5","user":{"login":"RNAer","id":1000056,"avatar_url":"https://avatars.githubusercontent.com/u/1000056?v=3","gravatar_id":"","url":"https://api.github.com/users/RNAer","html_url":"https://github.com/RNAer","followers_url":"https://api.github.com/users/RNAer/followers","following_url":"https://api.github.com/users/RNAer/following{/other_user}","gists_url":"https://api.github.com/users/RNAer/gists{/gist_id}","starred_url":"https://api.github.com/users/RNAer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RNAer/subscriptions","organizations_url":"https://api.github.com/users/RNAer/orgs","repos_url":"https://api.github.com/users/RNAer/repos","events_url":"https://api.github.com/users/RNAer/events{/privacy}","received_events_url":"https://api.github.com/users/RNAer/received_events","type":"User","site_admin":false},"repo":{"id":43989569,"name":"micronota","full_name":"RNAer/micronota","owner":{"login":"RNAer","id":1000056,"avatar_url":"https://avatars.githubusercontent.com/u/1000056?v=3","gravatar_id":"","url":"https://api.github.com/users/RNAer","html_url":"https://github.com/RNAer","followers_url":"https://api.github.com/users/RNAer/followers","following_url":"https://api.github.com/users/RNAer/following{/other_user}","gists_url":"https://api.github.com/users/RNAer/gists{/gist_id}","starred_url":"https://api.github.com/users/RNAer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RNAer/subscriptions","organizations_url":"https://api.github.com/users/RNAer/orgs","repos_url":"https://api.github.com/users/RNAer/repos","events_url":"https://api.github.com/users/RNAer/events{/privacy}","received_events_url":"https://api.github.com/users/RNAer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RNAer/micronota","description":"annotation pipeline for microbial genomes and metagenomes","fork":true,"url":"https://api.github.com/repos/RNAer/micronota","forks_url":"https://api.github.com/repos/RNAer/micronota/forks","keys_url":"https://api.github.com/repos/RNAer/micronota/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RNAer/micronota/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RNAer/micronota/teams","hooks_url":"https://api.github.com/repos/RNAer/micronota/hooks","issue_events_url":"https://api.github.com/repos/RNAer/micronota/issues/events{/number}","events_url":"https://api.github.com/repos/RNAer/micronota/events","assignees_url":"https://api.github.com/repos/RNAer/micronota/assignees{/user}","branches_url":"https://api.github.com/repos/RNAer/micronota/branches{/branch}","tags_url":"https://api.github.com/repos/RNAer/micronota/tags","blobs_url":"https://api.github.com/repos/RNAer/micronota/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RNAer/micronota/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RNAer/micronota/git/refs{/sha}","trees_url":"https://api.github.com/repos/RNAer/micronota/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RNAer/micronota/statuses/{sha}","languages_url":"https://api.github.com/repos/RNAer/micronota/languages","stargazers_url":"https://api.github.com/repos/RNAer/micronota/stargazers","contributors_url":"https://api.github.com/repos/RNAer/micronota/contributors","subscribers_url":"https://api.github.com/repos/RNAer/micronota/subscribers","subscription_url":"https://api.github.com/repos/RNAer/micronota/subscription","commits_url":"https://api.github.com/repos/RNAer/micronota/commits{/sha}","git_commits_url":"https://api.github.com/repos/RNAer/micronota/git/commits{/sha}","comments_url":"https://api.github.com/repos/RNAer/micronota/comments{/number}","issue_comment_url":"https://api.github.com/repos/RNAer/micronota/issues/comments{/number}","contents_url":"https://api.github.com/repos/RNAer/micronota/contents/{+path}","compare_url":"https://api.github.com/repos/RNAer/micronota/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RNAer/micronota/merges","archive_url":"https://api.github.com/repos/RNAer/micronota/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RNAer/micronota/downloads","issues_url":"https://api.github.com/repos/RNAer/micronota/issues{/number}","pulls_url":"https://api.github.com/repos/RNAer/micronota/pulls{/number}","milestones_url":"https://api.github.com/repos/RNAer/micronota/milestones{/number}","notifications_url":"https://api.github.com/repos/RNAer/micronota/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RNAer/micronota/labels{/name}","releases_url":"https://api.github.com/repos/RNAer/micronota/releases{/id}","deployments_url":"https://api.github.com/repos/RNAer/micronota/deployments","created_at":"2015-10-10T02:13:27Z","updated_at":"2016-01-12T22:32:28Z","pushed_at":"2016-02-12T06:10:36Z","git_url":"git://github.com/RNAer/micronota.git","ssh_url":"git@github.com:RNAer/micronota.git","clone_url":"https://github.com/RNAer/micronota.git","svn_url":"https://github.com/RNAer/micronota","homepage":null,"size":427,"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":"e435b70ab29f4b36684c94cf89f36ccd2058a1c8","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":43972497,"name":"micronota","full_name":"biocore/micronota","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/micronota","description":"annotation pipeline for microbial genomes and metagenomes","fork":false,"url":"https://api.github.com/repos/biocore/micronota","forks_url":"https://api.github.com/repos/biocore/micronota/forks","keys_url":"https://api.github.com/repos/biocore/micronota/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/micronota/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/micronota/teams","hooks_url":"https://api.github.com/repos/biocore/micronota/hooks","issue_events_url":"https://api.github.com/repos/biocore/micronota/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/micronota/events","assignees_url":"https://api.github.com/repos/biocore/micronota/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/micronota/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/micronota/tags","blobs_url":"https://api.github.com/repos/biocore/micronota/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/micronota/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/micronota/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/micronota/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/micronota/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/micronota/languages","stargazers_url":"https://api.github.com/repos/biocore/micronota/stargazers","contributors_url":"https://api.github.com/repos/biocore/micronota/contributors","subscribers_url":"https://api.github.com/repos/biocore/micronota/subscribers","subscription_url":"https://api.github.com/repos/biocore/micronota/subscription","commits_url":"https://api.github.com/repos/biocore/micronota/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/micronota/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/micronota/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/micronota/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/micronota/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/micronota/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/micronota/merges","archive_url":"https://api.github.com/repos/biocore/micronota/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/micronota/downloads","issues_url":"https://api.github.com/repos/biocore/micronota/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/micronota/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/micronota/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/micronota/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/micronota/labels{/name}","releases_url":"https://api.github.com/repos/biocore/micronota/releases{/id}","deployments_url":"https://api.github.com/repos/biocore/micronota/deployments","created_at":"2015-10-09T18:17:37Z","updated_at":"2016-02-04T18:32:46Z","pushed_at":"2016-02-12T06:11:21Z","git_url":"git://github.com/biocore/micronota.git","ssh_url":"git@github.com:biocore/micronota.git","clone_url":"https://github.com/biocore/micronota.git","svn_url":"https://github.com/biocore/micronota","homepage":null,"size":454,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":16,"forks":4,"open_issues":16,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/micronota/pulls/43"},"html":{"href":"https://github.com/biocore/micronota/pull/43"},"issue":{"href":"https://api.github.com/repos/biocore/micronota/issues/43"},"comments":{"href":"https://api.github.com/repos/biocore/micronota/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/micronota/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/micronota/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/micronota/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/micronota/statuses/fb57a49e0aaf5c91d776275ef797c9193cecdef5"}}}}