{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/37097793","id":37097793,"diff_hunk":"@@ -0,0 +1,669 @@\n+\"\"\"\n+Genbank format (:mod:`skbio.io.format.genbank`)\n+===============================================\n+\n+.. currentmodule:: skbio.io.format.genbank\n+\n+Format Support\n+--------------\n+**Has Sniffer: Yes**\n+\n++------+------+---------------------------------------------------------------+\n+|Reader|Writer|                          Object Class                         |\n++======+======+===============================================================+\n+|Yes   |Yes   |:mod:`skbio.sequence.Sequence`                                 |\n++------+------+---------------------------------------------------------------+\n+|Yes   |Yes   |:mod:`skbio.sequence.DNA`                                      |\n++------+------+---------------------------------------------------------------+\n+|Yes   |Yes   |:mod:`skbio.sequence.RNA`                                      |\n++------+------+---------------------------------------------------------------+\n+|Yes   |Yes   |:mod:`skbio.sequence.Protein`                                  |\n++------+------+---------------------------------------------------------------+\n+\n+Format Specification\n+--------------------\n+The following sections define the genbank formats.\n+\n+<http://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html>\n+\n+Feature Table Documentation:\n+http://www.insdc.org/files/feature_table.html\n+ftp://ftp.ncbi.nih.gov/genbank/docs/FTv10_3.html\n+\n+    The International Nucleotide Sequence Database Collaboration (INSDC)\n+    between the DDBJ, EMBL, and GenBank.  These organisations all use the\n+    same \"Feature Table\" layout in their plain text flat file formats.\n+\n+    However, the header and sequence sections of an EMBL file are very\n+    different in layout to those produced by GenBank/DDBJ.\n+\n+Examples\n+--------\n+\n+\"\"\"\n+# ----------------------------------------------------------------------------\n+# Copyright (c) 2013--, scikit-bio 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 (absolute_import, division, print_function,\n+                        unicode_literals)\n+from future.builtins import range, zip\n+\n+import re\n+import textwrap\n+\n+import numpy as np\n+import pandas as pd\n+from datetime import datetime\n+from functools import partial\n+\n+from skbio.io import create_format, GenbankFormatError\n+from skbio.io.format._base import (\n+    _get_nth_sequence, _line_generator, _too_many_blanks)\n+from skbio.util._misc import chunk_str\n+from skbio.sequence import Sequence, DNA, RNA, Protein\n+\n+\n+genbank = create_format('genbank')\n+\n+# date format in locus line of genbank record\n+_TIME_FORMAT = '%d-%b-%Y'\n+# This list is ordered\n+# used to read and write genbank file.\n+_HEADERS = ['LOCUS',\n+            'DEFINITION',\n+            'ACCESSION',\n+            'VERSION',\n+            'DBSOURCE',\n+            'DBLINK',\n+            'KEYWORDS',\n+            'SOURCE',\n+            'REFERENCE',\n+            'COMMENT',\n+            'FEATURES',\n+            'ORIGIN']\n+\n+\n+@genbank.sniffer()\n+def _genbank_sniffer(fh):\n+    # check the 1st real line is a valid LOCUS line\n+    if _too_many_blanks(fh, 5):\n+        return False, {}\n+    try:\n+        line = next(_line_generator(fh, skip_blanks=True, strip=False))\n+    except StopIteration:\n+        return False, {}\n+\n+    try:\n+        _parse_locus([line])","path":"skbio/io/format/genbank.py","position":102,"original_position":102,"commit_id":"a4aac83909106fb6888b4206cf3dcca7785187a7","original_commit_id":"a4aac83909106fb6888b4206cf3dcca7785187a7","user":{"login":"ebolyen","id":3976804,"avatar_url":"https://avatars.githubusercontent.com/u/3976804?v=3","gravatar_id":"","url":"https://api.github.com/users/ebolyen","html_url":"https://github.com/ebolyen","followers_url":"https://api.github.com/users/ebolyen/followers","following_url":"https://api.github.com/users/ebolyen/following{/other_user}","gists_url":"https://api.github.com/users/ebolyen/gists{/gist_id}","starred_url":"https://api.github.com/users/ebolyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebolyen/subscriptions","organizations_url":"https://api.github.com/users/ebolyen/orgs","repos_url":"https://api.github.com/users/ebolyen/repos","events_url":"https://api.github.com/users/ebolyen/events{/privacy}","received_events_url":"https://api.github.com/users/ebolyen/received_events","type":"User","site_admin":false},"body":":+1:","created_at":"2015-08-14T17:20:39Z","updated_at":"2015-08-14T17:20:39Z","html_url":"https://github.com/biocore/scikit-bio/pull/1023#discussion_r37097793","pull_request_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023","_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/comments/37097793"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/1023#discussion_r37097793"},"pull_request":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023","id":41396624,"html_url":"https://github.com/biocore/scikit-bio/pull/1023","diff_url":"https://github.com/biocore/scikit-bio/pull/1023.diff","patch_url":"https://github.com/biocore/scikit-bio/pull/1023.patch","issue_url":"https://api.github.com/repos/biocore/scikit-bio/issues/1023","number":1023,"state":"open","locked":false,"title":"add skeleton for genbank support","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":"This is to fix #986. not for merge for the time being. Just for code review and feedback. Will be constantly updated.","created_at":"2015-08-01T05:11:06Z","updated_at":"2015-08-14T17:20:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4dbf0103f983b32f59e2316f1ffb0ac4df89241","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023/commits","review_comments_url":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023/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/1023/comments","statuses_url":"https://api.github.com/repos/biocore/scikit-bio/statuses/a4aac83909106fb6888b4206cf3dcca7785187a7","head":{"label":"RNAer:genbank","ref":"genbank","sha":"a4aac83909106fb6888b4206cf3dcca7785187a7","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":20581004,"name":"scikit-bio","full_name":"RNAer/scikit-bio","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/scikit-bio","description":"Core objects, functions and statistics for working with biological data in Python.","fork":true,"url":"https://api.github.com/repos/RNAer/scikit-bio","forks_url":"https://api.github.com/repos/RNAer/scikit-bio/forks","keys_url":"https://api.github.com/repos/RNAer/scikit-bio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RNAer/scikit-bio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RNAer/scikit-bio/teams","hooks_url":"https://api.github.com/repos/RNAer/scikit-bio/hooks","issue_events_url":"https://api.github.com/repos/RNAer/scikit-bio/issues/events{/number}","events_url":"https://api.github.com/repos/RNAer/scikit-bio/events","assignees_url":"https://api.github.com/repos/RNAer/scikit-bio/assignees{/user}","branches_url":"https://api.github.com/repos/RNAer/scikit-bio/branches{/branch}","tags_url":"https://api.github.com/repos/RNAer/scikit-bio/tags","blobs_url":"https://api.github.com/repos/RNAer/scikit-bio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RNAer/scikit-bio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RNAer/scikit-bio/git/refs{/sha}","trees_url":"https://api.github.com/repos/RNAer/scikit-bio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RNAer/scikit-bio/statuses/{sha}","languages_url":"https://api.github.com/repos/RNAer/scikit-bio/languages","stargazers_url":"https://api.github.com/repos/RNAer/scikit-bio/stargazers","contributors_url":"https://api.github.com/repos/RNAer/scikit-bio/contributors","subscribers_url":"https://api.github.com/repos/RNAer/scikit-bio/subscribers","subscription_url":"https://api.github.com/repos/RNAer/scikit-bio/subscription","commits_url":"https://api.github.com/repos/RNAer/scikit-bio/commits{/sha}","git_commits_url":"https://api.github.com/repos/RNAer/scikit-bio/git/commits{/sha}","comments_url":"https://api.github.com/repos/RNAer/scikit-bio/comments{/number}","issue_comment_url":"https://api.github.com/repos/RNAer/scikit-bio/issues/comments{/number}","contents_url":"https://api.github.com/repos/RNAer/scikit-bio/contents/{+path}","compare_url":"https://api.github.com/repos/RNAer/scikit-bio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RNAer/scikit-bio/merges","archive_url":"https://api.github.com/repos/RNAer/scikit-bio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RNAer/scikit-bio/downloads","issues_url":"https://api.github.com/repos/RNAer/scikit-bio/issues{/number}","pulls_url":"https://api.github.com/repos/RNAer/scikit-bio/pulls{/number}","milestones_url":"https://api.github.com/repos/RNAer/scikit-bio/milestones{/number}","notifications_url":"https://api.github.com/repos/RNAer/scikit-bio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RNAer/scikit-bio/labels{/name}","releases_url":"https://api.github.com/repos/RNAer/scikit-bio/releases{/id}","created_at":"2014-06-06T23:24:15Z","updated_at":"2014-06-12T16:54:55Z","pushed_at":"2015-08-13T03:11:56Z","git_url":"git://github.com/RNAer/scikit-bio.git","ssh_url":"git@github.com:RNAer/scikit-bio.git","clone_url":"https://github.com/RNAer/scikit-bio.git","svn_url":"https://github.com/RNAer/scikit-bio","homepage":"http://scikit-bio.org","size":21513,"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":"ab75197ad6f1f2a03d6adff1e233fc231fd4583c","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":"scikit-bio is an open-source, BSD-licensed, Python package providing data structures, algorithms, and educational resources for bioinformatics.","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-08-13T13:47:16Z","pushed_at":"2015-08-14T05:55:46Z","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":41098,"stargazers_count":149,"watchers_count":149,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":82,"mirror_url":null,"open_issues_count":126,"forks":82,"open_issues":126,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023"},"html":{"href":"https://github.com/biocore/scikit-bio/pull/1023"},"issue":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/1023"},"comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/issues/1023/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/scikit-bio/pulls/1023/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/1023/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/scikit-bio/statuses/a4aac83909106fb6888b4206cf3dcca7785187a7"}}}}