{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/sortmerna/pulls/comments/53518245","id":53518245,"diff_hunk":"@@ -0,0 +1,135 @@\n+/*\n+ * @file kseq_load.cpp\n+ * @brief Load input reads directly into RAM (FASTA, FASTQ and compressed formats)\n+ * @parblock\n+ * SortMeRNA - next-generation reads filter for metatranscriptomic or total RNA\n+ * @copyright 2012-16 Bonsai Bioinformatics Research Group\n+ * @copyright 2014-16 Knight Lab, Department of Pediatrics, UCSD, La Jolla\n+ *\n+ * This file is part of SortMeRNA.\n+ *\n+ * SortMeRNA is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Lesser General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * SortMeRNA is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with SortMeRNA.  If not, see <http://www.gnu.org/licenses/>.\n+ *\n+ * @authors jenya.kopylov@gmail.com\n+ *          laurent.noe@lifl.fr\n+ *          helene.touzet@lifl.fr\n+ *          pierre.pericard@lifl.fr\n+ *          mikael.salson@lifl.fr\n+ *          robknight@ucsd.edu\n+ */\n+\n+#include \"../include/kseq_load.hpp\"\n+\n+\n+/*\n+ *\n+ * FUNCTION : load_reads()\n+ * PURPOSE  : load reads using generic buffer\n+ * OUTPUT   : double pointer array to sequences in buffer\n+ * See complete documentation in include/mmap.hpp\n+ *\n+ *******************************************************/\n+char**\n+load_reads(char* inputreads,\n+           char* raw,\n+           uint64_t number_total_read,\n+           off_t full_file_size,\n+           char*& finalnt)\n+{\n+  raw = new char[full_file_size]();\n+  if ( raw == NULL )\n+  {\n+    fprintf(stderr,\"    %sERROR%s: [Line %d: %s] could not allocate memory for reference sequence buffer\\n\",\n+                   \"\\033[0;31m\",\"\\033[0m\", __LINE__, __FILE__);\n+    exit(EXIT_FAILURE);\n+  }\n+  // 2 pointers per entry (1 for label + 1 for sequence)\n+  char** reads = new char*[number_total_read*2]();\n+  if ( reads == NULL )\n+  {\n+    fprintf(stderr,\"\\n  %sERROR%s: [Line %d: %s] cannot allocate memory for reads\\n\\n\",\n+                   \"\\033[0;31m\",\"\\033[0m\", __LINE__, __FILE__);\n+    exit(EXIT_FAILURE);\n+  }\n+#ifdef HAVE_LIBZ\n+  // Count total number of reads and their combined length","path":"src/kseq_load.cpp","position":66,"original_position":66,"commit_id":"ba773b3fcff842e4c21c55c590739d1b38307017","original_commit_id":"ba773b3fcff842e4c21c55c590739d1b38307017","user":{"login":"ekopylova","id":6933444,"avatar_url":"https://avatars.githubusercontent.com/u/6933444?v=3","gravatar_id":"","url":"https://api.github.com/users/ekopylova","html_url":"https://github.com/ekopylova","followers_url":"https://api.github.com/users/ekopylova/followers","following_url":"https://api.github.com/users/ekopylova/following{/other_user}","gists_url":"https://api.github.com/users/ekopylova/gists{/gist_id}","starred_url":"https://api.github.com/users/ekopylova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekopylova/subscriptions","organizations_url":"https://api.github.com/users/ekopylova/orgs","repos_url":"https://api.github.com/users/ekopylova/repos","events_url":"https://api.github.com/users/ekopylova/events{/privacy}","received_events_url":"https://api.github.com/users/ekopylova/received_events","type":"User","site_admin":false},"body":"Comment should be removed (same for one below). This computation is performed earlier now in ```compute_read_stats()``` from paralleltrfaversal.cpp","created_at":"2016-02-19T21:07:30Z","updated_at":"2016-02-19T21:07:30Z","html_url":"https://github.com/biocore/sortmerna/pull/111#discussion_r53518245","pull_request_url":"https://api.github.com/repos/biocore/sortmerna/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/comments/53518245"},"html":{"href":"https://github.com/biocore/sortmerna/pull/111#discussion_r53518245"},"pull_request":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/sortmerna/pulls/111","id":59682815,"html_url":"https://github.com/biocore/sortmerna/pull/111","diff_url":"https://github.com/biocore/sortmerna/pull/111.diff","patch_url":"https://github.com/biocore/sortmerna/pull/111.patch","issue_url":"https://api.github.com/repos/biocore/sortmerna/issues/111","number":111,"state":"open","locked":false,"title":"Add ZLIB support","user":{"login":"ekopylova","id":6933444,"avatar_url":"https://avatars.githubusercontent.com/u/6933444?v=3","gravatar_id":"","url":"https://api.github.com/users/ekopylova","html_url":"https://github.com/ekopylova","followers_url":"https://api.github.com/users/ekopylova/followers","following_url":"https://api.github.com/users/ekopylova/following{/other_user}","gists_url":"https://api.github.com/users/ekopylova/gists{/gist_id}","starred_url":"https://api.github.com/users/ekopylova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekopylova/subscriptions","organizations_url":"https://api.github.com/users/ekopylova/orgs","repos_url":"https://api.github.com/users/ekopylova/repos","events_url":"https://api.github.com/users/ekopylova/events{/privacy}","received_events_url":"https://api.github.com/users/ekopylova/received_events","type":"User","site_admin":false},"body":"This major update includes:\r\n- [KSEQ](http://lh3lh3.users.sourceforge.net/parsefastq.shtml) library, allow compressed reads input (gzip) [resolves issue #94 and #71]\r\n- support both mmap and generic buffer input\r\n- clean up compiler warnings","created_at":"2016-02-17T17:56:32Z","updated_at":"2016-02-19T21:07:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45a187a5e4d9086d01c26a1453e692a1645c1e8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/sortmerna/pulls/111/commits","review_comments_url":"https://api.github.com/repos/biocore/sortmerna/pulls/111/comments","review_comment_url":"https://api.github.com/repos/biocore/sortmerna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/sortmerna/issues/111/comments","statuses_url":"https://api.github.com/repos/biocore/sortmerna/statuses/ba773b3fcff842e4c21c55c590739d1b38307017","head":{"label":"ekopylova:add_zlib","ref":"add_zlib","sha":"ba773b3fcff842e4c21c55c590739d1b38307017","user":{"login":"ekopylova","id":6933444,"avatar_url":"https://avatars.githubusercontent.com/u/6933444?v=3","gravatar_id":"","url":"https://api.github.com/users/ekopylova","html_url":"https://github.com/ekopylova","followers_url":"https://api.github.com/users/ekopylova/followers","following_url":"https://api.github.com/users/ekopylova/following{/other_user}","gists_url":"https://api.github.com/users/ekopylova/gists{/gist_id}","starred_url":"https://api.github.com/users/ekopylova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekopylova/subscriptions","organizations_url":"https://api.github.com/users/ekopylova/orgs","repos_url":"https://api.github.com/users/ekopylova/repos","events_url":"https://api.github.com/users/ekopylova/events{/privacy}","received_events_url":"https://api.github.com/users/ekopylova/received_events","type":"User","site_admin":false},"repo":{"id":21182075,"name":"sortmerna","full_name":"ekopylova/sortmerna","owner":{"login":"ekopylova","id":6933444,"avatar_url":"https://avatars.githubusercontent.com/u/6933444?v=3","gravatar_id":"","url":"https://api.github.com/users/ekopylova","html_url":"https://github.com/ekopylova","followers_url":"https://api.github.com/users/ekopylova/followers","following_url":"https://api.github.com/users/ekopylova/following{/other_user}","gists_url":"https://api.github.com/users/ekopylova/gists{/gist_id}","starred_url":"https://api.github.com/users/ekopylova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekopylova/subscriptions","organizations_url":"https://api.github.com/users/ekopylova/orgs","repos_url":"https://api.github.com/users/ekopylova/repos","events_url":"https://api.github.com/users/ekopylova/events{/privacy}","received_events_url":"https://api.github.com/users/ekopylova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ekopylova/sortmerna","description":"This is ongoing development of SortMeRNA. For the latest release, see http://bioinfo.lifl.fr/RNA/sortmerna/.","fork":true,"url":"https://api.github.com/repos/ekopylova/sortmerna","forks_url":"https://api.github.com/repos/ekopylova/sortmerna/forks","keys_url":"https://api.github.com/repos/ekopylova/sortmerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ekopylova/sortmerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ekopylova/sortmerna/teams","hooks_url":"https://api.github.com/repos/ekopylova/sortmerna/hooks","issue_events_url":"https://api.github.com/repos/ekopylova/sortmerna/issues/events{/number}","events_url":"https://api.github.com/repos/ekopylova/sortmerna/events","assignees_url":"https://api.github.com/repos/ekopylova/sortmerna/assignees{/user}","branches_url":"https://api.github.com/repos/ekopylova/sortmerna/branches{/branch}","tags_url":"https://api.github.com/repos/ekopylova/sortmerna/tags","blobs_url":"https://api.github.com/repos/ekopylova/sortmerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ekopylova/sortmerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ekopylova/sortmerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/ekopylova/sortmerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ekopylova/sortmerna/statuses/{sha}","languages_url":"https://api.github.com/repos/ekopylova/sortmerna/languages","stargazers_url":"https://api.github.com/repos/ekopylova/sortmerna/stargazers","contributors_url":"https://api.github.com/repos/ekopylova/sortmerna/contributors","subscribers_url":"https://api.github.com/repos/ekopylova/sortmerna/subscribers","subscription_url":"https://api.github.com/repos/ekopylova/sortmerna/subscription","commits_url":"https://api.github.com/repos/ekopylova/sortmerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/ekopylova/sortmerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/ekopylova/sortmerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/ekopylova/sortmerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/ekopylova/sortmerna/contents/{+path}","compare_url":"https://api.github.com/repos/ekopylova/sortmerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ekopylova/sortmerna/merges","archive_url":"https://api.github.com/repos/ekopylova/sortmerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ekopylova/sortmerna/downloads","issues_url":"https://api.github.com/repos/ekopylova/sortmerna/issues{/number}","pulls_url":"https://api.github.com/repos/ekopylova/sortmerna/pulls{/number}","milestones_url":"https://api.github.com/repos/ekopylova/sortmerna/milestones{/number}","notifications_url":"https://api.github.com/repos/ekopylova/sortmerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ekopylova/sortmerna/labels{/name}","releases_url":"https://api.github.com/repos/ekopylova/sortmerna/releases{/id}","deployments_url":"https://api.github.com/repos/ekopylova/sortmerna/deployments","created_at":"2014-06-24T21:53:45Z","updated_at":"2016-02-01T21:13:37Z","pushed_at":"2016-02-19T17:22:45Z","git_url":"git://github.com/ekopylova/sortmerna.git","ssh_url":"git@github.com:ekopylova/sortmerna.git","clone_url":"https://github.com/ekopylova/sortmerna.git","svn_url":"https://github.com/ekopylova/sortmerna","homepage":"","size":82103,"stargazers_count":3,"watchers_count":3,"language":"C++","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":3,"default_branch":"master"}},"base":{"label":"biocore:master","ref":"master","sha":"6d46ca471a8ff548c11d1103431ad0a4f3490f67","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":17751144,"name":"sortmerna","full_name":"biocore/sortmerna","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/sortmerna","description":"SortMeRNA: a sequence analysis tool for filtering, mapping and OTU-picking NGS reads.","fork":false,"url":"https://api.github.com/repos/biocore/sortmerna","forks_url":"https://api.github.com/repos/biocore/sortmerna/forks","keys_url":"https://api.github.com/repos/biocore/sortmerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/sortmerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/sortmerna/teams","hooks_url":"https://api.github.com/repos/biocore/sortmerna/hooks","issue_events_url":"https://api.github.com/repos/biocore/sortmerna/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/sortmerna/events","assignees_url":"https://api.github.com/repos/biocore/sortmerna/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/sortmerna/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/sortmerna/tags","blobs_url":"https://api.github.com/repos/biocore/sortmerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/sortmerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/sortmerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/sortmerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/sortmerna/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/sortmerna/languages","stargazers_url":"https://api.github.com/repos/biocore/sortmerna/stargazers","contributors_url":"https://api.github.com/repos/biocore/sortmerna/contributors","subscribers_url":"https://api.github.com/repos/biocore/sortmerna/subscribers","subscription_url":"https://api.github.com/repos/biocore/sortmerna/subscription","commits_url":"https://api.github.com/repos/biocore/sortmerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/sortmerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/sortmerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/sortmerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/sortmerna/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/sortmerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/sortmerna/merges","archive_url":"https://api.github.com/repos/biocore/sortmerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/sortmerna/downloads","issues_url":"https://api.github.com/repos/biocore/sortmerna/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/sortmerna/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/sortmerna/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/sortmerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/sortmerna/labels{/name}","releases_url":"https://api.github.com/repos/biocore/sortmerna/releases{/id}","deployments_url":"https://api.github.com/repos/biocore/sortmerna/deployments","created_at":"2014-03-14T15:42:40Z","updated_at":"2016-02-18T18:59:43Z","pushed_at":"2016-02-19T17:22:45Z","git_url":"git://github.com/biocore/sortmerna.git","ssh_url":"git@github.com:biocore/sortmerna.git","clone_url":"https://github.com/biocore/sortmerna.git","svn_url":"https://github.com/biocore/sortmerna","homepage":"","size":82987,"stargazers_count":18,"watchers_count":18,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":13,"forks":3,"open_issues":13,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/111"},"html":{"href":"https://github.com/biocore/sortmerna/pull/111"},"issue":{"href":"https://api.github.com/repos/biocore/sortmerna/issues/111"},"comments":{"href":"https://api.github.com/repos/biocore/sortmerna/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/sortmerna/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/sortmerna/statuses/ba773b3fcff842e4c21c55c590739d1b38307017"}}}}