{"action":"created","comment":{"url":"https://api.github.com/repos/Ensembl/ensembl/pulls/comments/39021188","id":39021188,"diff_hunk":"@@ -0,0 +1,469 @@\n+=head1 LICENSE\n+\n+Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+     http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+\n+=head1 CONTACT\n+\n+  Please email comments or questions to the public Ensembl\n+  developers list at <dev@ensembl.org>.\n+\n+  Questions may also be sent to the Ensembl help desk at\n+  <helpdesk@ensembl.org>.\n+\n+=cut\n+\n+=head1 NAME\n+\n+Bio::EnsEMBL::Utils::IO::FileFaidx\n+\n+=head1 DESCRIPTION\n+\n+This object provides an implementation of the .fai index lookup as defined by samtools. \n+This format assumes that all lines in a FASTA file are the same length (bytes and bases) \n+and this information is held in a file called .fai (held in the same directory\n+as the FASTA file). The format is tab delimited like so:\n+\n+    RecordID    RecordLength(bp)   File offset (bytes)       bp per line      bytes per line\n+\n+For example:\n+\n+    MT    16571   6       50      51\n+    1    247249719       16915   50      51\n+\n+The columns are sequence ID, sequence length, offset in file, bases per line \n+and bytes per line. This module will read this format (if the file is available)\n+or will generate it from a FASTA file. It is recommnded that you pre-generate this\n+by using this module with the C<write_index_to_disk()> flag on or by using the\n+samtools faidx binary.\n+\n+Please note that we do not handle RAZF compressed indexes or FASTA files.\n+\n+We recommend you use this adaptor with the fully assembled chromsome files available from \n+our FTP site (primary assembly).\n+\n+=cut\n+\n+package Bio::EnsEMBL::Utils::IO::FileFaidx;\n+\n+use strict;\n+use warnings;\n+\n+use Bio::EnsEMBL::Utils::Exception qw/throw warning/;\n+use Bio::EnsEMBL::Utils::IO qw/iterate_lines work_with_file slurp/;\n+use English qw/-no_match_vars/;\n+require bytes;\n+\n+=head2 new\n+  \n+  Arg [1]     : String; $file. Path to the FASTA file\n+  Arg [2]     : Boolean; $write_index_to_disk. Write the index to disk\n+  Arg [3]     : Boolean; $persist_fh. Persist the file handle between requests for sequence\n+  Arg [4]     : Boolean; $no_generation. Stop index generation and force the reading of an index from disk\n+  Arg [5]     : Boolean; $uppercase_sequence. Uppercase sequence returned from the code. Defaults to true\n+  Description : Builds an instance of the FaidxFasta object\n+\n+=cut\n+\n+sub new {\n+  my ($class, $fasta_file, $write_index_to_disk, $persist_fh, $no_generation, $uppercase_sequence) = @_;\n+  throw 'No file given; cannot continue without one' unless $fasta_file;\n+  $uppercase_sequence //= 1;\n+  my $self = bless({}, ref($class)||$class);\n+  $self->file($fasta_file);\n+  $self->write_index_to_disk($write_index_to_disk);\n+  $self->persist_fh($persist_fh);\n+  $self->no_generation($no_generation);\n+  $self->uppercase_sequence($uppercase_sequence);\n+  return $self;\n+}\n+\n+=head2 can_access_id\n+\n+  Description : Checks the lookup to see if we have access to the id\n+\n+=cut\n+\n+sub can_access_id {\n+  my ($self, $id) = @_;\n+  return exists $self->lookup()->{$id} ? 1 : 0;\n+}\n+\n+=head2 file\n+  \n+  Arg [1]     : String; $file. Path to the FASTA file\n+  Description : Location of the FASTA file\n+  Exception   : Thrown if the file cannot be found\n+\n+=cut\n+\n+sub file {\n+  my ($self, $file) = @_;\n+  if(defined $file) {\n+    throw \"No file found at '${file}'\" unless -f $file;\n+    $self->{'file'} = $file;\n+  }\n+  return $self->{'file'};\n+}\n+\n+=head2 store","path":"modules/Bio/EnsEMBL/Utils/IO/FileFaidx.pm","position":120,"original_position":120,"commit_id":"5ac07070dee39632762943a26b66a657f863e9c9","original_commit_id":"5ac07070dee39632762943a26b66a657f863e9c9","user":{"login":"avullo","id":6085263,"avatar_url":"https://avatars.githubusercontent.com/u/6085263?v=3","gravatar_id":"","url":"https://api.github.com/users/avullo","html_url":"https://github.com/avullo","followers_url":"https://api.github.com/users/avullo/followers","following_url":"https://api.github.com/users/avullo/following{/other_user}","gists_url":"https://api.github.com/users/avullo/gists{/gist_id}","starred_url":"https://api.github.com/users/avullo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avullo/subscriptions","organizations_url":"https://api.github.com/users/avullo/orgs","repos_url":"https://api.github.com/users/avullo/repos","events_url":"https://api.github.com/users/avullo/events{/privacy}","received_events_url":"https://api.github.com/users/avullo/received_events","type":"User","site_admin":false},"body":"should be 'write_index_to_disk","created_at":"2015-09-09T09:07:42Z","updated_at":"2015-09-09T09:07:42Z","html_url":"https://github.com/Ensembl/ensembl/pull/86#discussion_r39021188","pull_request_url":"https://api.github.com/repos/Ensembl/ensembl/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/comments/39021188"},"html":{"href":"https://github.com/Ensembl/ensembl/pull/86#discussion_r39021188"},"pull_request":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/Ensembl/ensembl/pulls/86","id":44231983,"html_url":"https://github.com/Ensembl/ensembl/pull/86","diff_url":"https://github.com/Ensembl/ensembl/pull/86.diff","patch_url":"https://github.com/Ensembl/ensembl/pull/86.patch","issue_url":"https://api.github.com/repos/Ensembl/ensembl/issues/86","number":86,"state":"open","locked":false,"title":"Experimental/merged alternative sequence store","user":{"login":"magaliruffier","id":6097225,"avatar_url":"https://avatars.githubusercontent.com/u/6097225?v=3","gravatar_id":"","url":"https://api.github.com/users/magaliruffier","html_url":"https://github.com/magaliruffier","followers_url":"https://api.github.com/users/magaliruffier/followers","following_url":"https://api.github.com/users/magaliruffier/following{/other_user}","gists_url":"https://api.github.com/users/magaliruffier/gists{/gist_id}","starred_url":"https://api.github.com/users/magaliruffier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magaliruffier/subscriptions","organizations_url":"https://api.github.com/users/magaliruffier/orgs","repos_url":"https://api.github.com/users/magaliruffier/repos","events_url":"https://api.github.com/users/magaliruffier/events{/privacy}","received_events_url":"https://api.github.com/users/magaliruffier/received_events","type":"User","site_admin":false},"body":"the alternative_sequence_store branch has been successfully tested with the fasta dumping pipeline and the xref pipeline, the updated clear_cache method seems to behave\r\nI now need a sanity check that reverting the revert commit does the right thing and we have not lost anything","created_at":"2015-09-04T15:42:03Z","updated_at":"2015-09-09T09:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29ee4f4e4f3f67576c1835da7941b49e6beefb45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ensembl/ensembl/pulls/86/commits","review_comments_url":"https://api.github.com/repos/Ensembl/ensembl/pulls/86/comments","review_comment_url":"https://api.github.com/repos/Ensembl/ensembl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ensembl/ensembl/issues/86/comments","statuses_url":"https://api.github.com/repos/Ensembl/ensembl/statuses/5ac07070dee39632762943a26b66a657f863e9c9","head":{"label":"Ensembl:experimental/merged_alternative_sequence_store","ref":"experimental/merged_alternative_sequence_store","sha":"5ac07070dee39632762943a26b66a657f863e9c9","user":{"login":"Ensembl","id":5832463,"avatar_url":"https://avatars.githubusercontent.com/u/5832463?v=3","gravatar_id":"","url":"https://api.github.com/users/Ensembl","html_url":"https://github.com/Ensembl","followers_url":"https://api.github.com/users/Ensembl/followers","following_url":"https://api.github.com/users/Ensembl/following{/other_user}","gists_url":"https://api.github.com/users/Ensembl/gists{/gist_id}","starred_url":"https://api.github.com/users/Ensembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ensembl/subscriptions","organizations_url":"https://api.github.com/users/Ensembl/orgs","repos_url":"https://api.github.com/users/Ensembl/repos","events_url":"https://api.github.com/users/Ensembl/events{/privacy}","received_events_url":"https://api.github.com/users/Ensembl/received_events","type":"Organization","site_admin":false},"repo":{"id":15257669,"name":"ensembl","full_name":"Ensembl/ensembl","owner":{"login":"Ensembl","id":5832463,"avatar_url":"https://avatars.githubusercontent.com/u/5832463?v=3","gravatar_id":"","url":"https://api.github.com/users/Ensembl","html_url":"https://github.com/Ensembl","followers_url":"https://api.github.com/users/Ensembl/followers","following_url":"https://api.github.com/users/Ensembl/following{/other_user}","gists_url":"https://api.github.com/users/Ensembl/gists{/gist_id}","starred_url":"https://api.github.com/users/Ensembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ensembl/subscriptions","organizations_url":"https://api.github.com/users/Ensembl/orgs","repos_url":"https://api.github.com/users/Ensembl/repos","events_url":"https://api.github.com/users/Ensembl/events{/privacy}","received_events_url":"https://api.github.com/users/Ensembl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ensembl/ensembl","description":"The Ensembl Core Perl API and SQL schema","fork":false,"url":"https://api.github.com/repos/Ensembl/ensembl","forks_url":"https://api.github.com/repos/Ensembl/ensembl/forks","keys_url":"https://api.github.com/repos/Ensembl/ensembl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ensembl/ensembl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ensembl/ensembl/teams","hooks_url":"https://api.github.com/repos/Ensembl/ensembl/hooks","issue_events_url":"https://api.github.com/repos/Ensembl/ensembl/issues/events{/number}","events_url":"https://api.github.com/repos/Ensembl/ensembl/events","assignees_url":"https://api.github.com/repos/Ensembl/ensembl/assignees{/user}","branches_url":"https://api.github.com/repos/Ensembl/ensembl/branches{/branch}","tags_url":"https://api.github.com/repos/Ensembl/ensembl/tags","blobs_url":"https://api.github.com/repos/Ensembl/ensembl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ensembl/ensembl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ensembl/ensembl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ensembl/ensembl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ensembl/ensembl/statuses/{sha}","languages_url":"https://api.github.com/repos/Ensembl/ensembl/languages","stargazers_url":"https://api.github.com/repos/Ensembl/ensembl/stargazers","contributors_url":"https://api.github.com/repos/Ensembl/ensembl/contributors","subscribers_url":"https://api.github.com/repos/Ensembl/ensembl/subscribers","subscription_url":"https://api.github.com/repos/Ensembl/ensembl/subscription","commits_url":"https://api.github.com/repos/Ensembl/ensembl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ensembl/ensembl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ensembl/ensembl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ensembl/ensembl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ensembl/ensembl/contents/{+path}","compare_url":"https://api.github.com/repos/Ensembl/ensembl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ensembl/ensembl/merges","archive_url":"https://api.github.com/repos/Ensembl/ensembl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ensembl/ensembl/downloads","issues_url":"https://api.github.com/repos/Ensembl/ensembl/issues{/number}","pulls_url":"https://api.github.com/repos/Ensembl/ensembl/pulls{/number}","milestones_url":"https://api.github.com/repos/Ensembl/ensembl/milestones{/number}","notifications_url":"https://api.github.com/repos/Ensembl/ensembl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ensembl/ensembl/labels{/name}","releases_url":"https://api.github.com/repos/Ensembl/ensembl/releases{/id}","created_at":"2013-12-17T15:11:49Z","updated_at":"2015-04-09T16:01:18Z","pushed_at":"2015-09-09T08:18:38Z","git_url":"git://github.com/Ensembl/ensembl.git","ssh_url":"git@github.com:Ensembl/ensembl.git","clone_url":"https://github.com/Ensembl/ensembl.git","svn_url":"https://github.com/Ensembl/ensembl","homepage":"http://www.ensembl.org","size":43615,"stargazers_count":18,"watchers_count":18,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":2,"forks":33,"open_issues":2,"watchers":18,"default_branch":"release/81"}},"base":{"label":"Ensembl:master","ref":"master","sha":"78c9983c3c0f5eeb507db95e057eef444dde90a3","user":{"login":"Ensembl","id":5832463,"avatar_url":"https://avatars.githubusercontent.com/u/5832463?v=3","gravatar_id":"","url":"https://api.github.com/users/Ensembl","html_url":"https://github.com/Ensembl","followers_url":"https://api.github.com/users/Ensembl/followers","following_url":"https://api.github.com/users/Ensembl/following{/other_user}","gists_url":"https://api.github.com/users/Ensembl/gists{/gist_id}","starred_url":"https://api.github.com/users/Ensembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ensembl/subscriptions","organizations_url":"https://api.github.com/users/Ensembl/orgs","repos_url":"https://api.github.com/users/Ensembl/repos","events_url":"https://api.github.com/users/Ensembl/events{/privacy}","received_events_url":"https://api.github.com/users/Ensembl/received_events","type":"Organization","site_admin":false},"repo":{"id":15257669,"name":"ensembl","full_name":"Ensembl/ensembl","owner":{"login":"Ensembl","id":5832463,"avatar_url":"https://avatars.githubusercontent.com/u/5832463?v=3","gravatar_id":"","url":"https://api.github.com/users/Ensembl","html_url":"https://github.com/Ensembl","followers_url":"https://api.github.com/users/Ensembl/followers","following_url":"https://api.github.com/users/Ensembl/following{/other_user}","gists_url":"https://api.github.com/users/Ensembl/gists{/gist_id}","starred_url":"https://api.github.com/users/Ensembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ensembl/subscriptions","organizations_url":"https://api.github.com/users/Ensembl/orgs","repos_url":"https://api.github.com/users/Ensembl/repos","events_url":"https://api.github.com/users/Ensembl/events{/privacy}","received_events_url":"https://api.github.com/users/Ensembl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ensembl/ensembl","description":"The Ensembl Core Perl API and SQL schema","fork":false,"url":"https://api.github.com/repos/Ensembl/ensembl","forks_url":"https://api.github.com/repos/Ensembl/ensembl/forks","keys_url":"https://api.github.com/repos/Ensembl/ensembl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ensembl/ensembl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ensembl/ensembl/teams","hooks_url":"https://api.github.com/repos/Ensembl/ensembl/hooks","issue_events_url":"https://api.github.com/repos/Ensembl/ensembl/issues/events{/number}","events_url":"https://api.github.com/repos/Ensembl/ensembl/events","assignees_url":"https://api.github.com/repos/Ensembl/ensembl/assignees{/user}","branches_url":"https://api.github.com/repos/Ensembl/ensembl/branches{/branch}","tags_url":"https://api.github.com/repos/Ensembl/ensembl/tags","blobs_url":"https://api.github.com/repos/Ensembl/ensembl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ensembl/ensembl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ensembl/ensembl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ensembl/ensembl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ensembl/ensembl/statuses/{sha}","languages_url":"https://api.github.com/repos/Ensembl/ensembl/languages","stargazers_url":"https://api.github.com/repos/Ensembl/ensembl/stargazers","contributors_url":"https://api.github.com/repos/Ensembl/ensembl/contributors","subscribers_url":"https://api.github.com/repos/Ensembl/ensembl/subscribers","subscription_url":"https://api.github.com/repos/Ensembl/ensembl/subscription","commits_url":"https://api.github.com/repos/Ensembl/ensembl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ensembl/ensembl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ensembl/ensembl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ensembl/ensembl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ensembl/ensembl/contents/{+path}","compare_url":"https://api.github.com/repos/Ensembl/ensembl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ensembl/ensembl/merges","archive_url":"https://api.github.com/repos/Ensembl/ensembl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ensembl/ensembl/downloads","issues_url":"https://api.github.com/repos/Ensembl/ensembl/issues{/number}","pulls_url":"https://api.github.com/repos/Ensembl/ensembl/pulls{/number}","milestones_url":"https://api.github.com/repos/Ensembl/ensembl/milestones{/number}","notifications_url":"https://api.github.com/repos/Ensembl/ensembl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ensembl/ensembl/labels{/name}","releases_url":"https://api.github.com/repos/Ensembl/ensembl/releases{/id}","created_at":"2013-12-17T15:11:49Z","updated_at":"2015-04-09T16:01:18Z","pushed_at":"2015-09-09T08:18:38Z","git_url":"git://github.com/Ensembl/ensembl.git","ssh_url":"git@github.com:Ensembl/ensembl.git","clone_url":"https://github.com/Ensembl/ensembl.git","svn_url":"https://github.com/Ensembl/ensembl","homepage":"http://www.ensembl.org","size":43615,"stargazers_count":18,"watchers_count":18,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":2,"forks":33,"open_issues":2,"watchers":18,"default_branch":"release/81"}},"_links":{"self":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/86"},"html":{"href":"https://github.com/Ensembl/ensembl/pull/86"},"issue":{"href":"https://api.github.com/repos/Ensembl/ensembl/issues/86"},"comments":{"href":"https://api.github.com/repos/Ensembl/ensembl/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ensembl/ensembl/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/Ensembl/ensembl/statuses/5ac07070dee39632762943a26b66a657f863e9c9"}}}}