{"action":"created","comment":{"url":"https://api.github.com/repos/dib-lab/khmer/pulls/comments/32996071","id":32996071,"diff_hunk":"@@ -0,0 +1,140 @@\n+#! /usr/bin/env python2\n+#\n+# This file is part of khmer, http://github.com/ged-lab/khmer/, and is\n+# Copyright (C) Michigan State University, 2009-2015. It is licensed under\n+# the three-clause BSD license; see doc/LICENSE.txt.\n+# Contact: khmer-project@idyll.org\n+#\n+# pylint: disable=invalid-name,missing-docstring\n+\"\"\"\n+Estimate optimal arguments using HLL couter.\n+\n+% python sandbox/optimal_args_HLL.py [ -k <k size> ] [ -e <ERROR_RATE> ] <data1> <data2> ...\n+Use '-h' for parameter help.\n+\"\"\"\n+\n+from __future__ import print_function\n+\n+import argparse\n+import os\n+import sys\n+import textwrap\n+import math\n+import khmer\n+from khmer.khmer_args import DEFAULT_K, info, ComboFormatter\n+from khmer import __version__\n+\n+\n+def get_parser():\n+    descr = \"Estimate optimal arguments using HLL couter., with precision <= ERROR_RATE.\"\n+    epilog = (\"\"\"\n+    A HyperLogLog counter is used to do cardinality estimation. Since this counter\n+    is based on a tradeoff between precision and memory consumption,\n+    :option:`-e`/:option:`--error-rate` can be used to control how much\n+    memory will be used. In practice the memory footprint is small even\n+    at low error rates (< 0.01).\n+    :option:`-k`/:option:`--ksize` should be set to the desired k-mer size.\n+    Output is sent to STDOUT, but a report file can be generated with\n+    :option:`-R`/:option:`--report`.\n+    Example::\n+        optimal_args_HLL.py -k 17 tests/test-data/test-abund-read{,-2,-3}.fa\n+    Example::\n+\"\"\" \"    optimal_args_HLL.py.py -R optimal_args -k 30 tests/test-data/test-abund-read-paired.fa\")  # noqa\n+    parser = argparse.ArgumentParser(\n+        description=descr, epilog=textwrap.dedent(epilog),\n+        formatter_class=ComboFormatter)\n+\n+    env_ksize = os.environ.get('KHMER_KSIZE', DEFAULT_K)\n+\n+    parser.add_argument('--version', action='version',\n+                        version='khmer {v}'.format(v=__version__))\n+    parser.add_argument('-q', '--quiet', dest='quiet', default=False,\n+                        action='store_true')\n+\n+    parser.add_argument('--ksize', '-k', type=int, default=env_ksize,\n+                        help='k-mer size to use')\n+\n+    parser.add_argument('--error-rate', '-e', type=float, default=0.01,\n+                        help='Acceptable error rate')\n+\n+    parser.add_argument('-R', '--report',\n+                        metavar='filename', type=argparse.FileType('w'))\n+\n+    parser.add_argument('input_filenames', metavar='input_sequence_filename',\n+                        help='Input FAST[AQ] sequence filename.', nargs='+')\n+\n+\n+    return parser\n+\n+def estimate_optimal_with_N_and_M(N,M):","path":"sandbox/optimal_args_HLL.py","position":69,"original_position":69,"commit_id":"8f30b748767e29963ced0bcbd2734dbed4a252ef","original_commit_id":"8f30b748767e29963ced0bcbd2734dbed4a252ef","user":{"login":"luizirber","id":6642,"avatar_url":"https://avatars.githubusercontent.com/u/6642?v=3","gravatar_id":"","url":"https://api.github.com/users/luizirber","html_url":"https://github.com/luizirber","followers_url":"https://api.github.com/users/luizirber/followers","following_url":"https://api.github.com/users/luizirber/following{/other_user}","gists_url":"https://api.github.com/users/luizirber/gists{/gist_id}","starred_url":"https://api.github.com/users/luizirber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luizirber/subscriptions","organizations_url":"https://api.github.com/users/luizirber/orgs","repos_url":"https://api.github.com/users/luizirber/repos","events_url":"https://api.github.com/users/luizirber/events{/privacy}","received_events_url":"https://api.github.com/users/luizirber/received_events","type":"User","site_admin":false},"body":"this can be imported from `oxli.functions` now.","created_at":"2015-06-22T23:31:03Z","updated_at":"2015-06-22T23:31:03Z","html_url":"https://github.com/dib-lab/khmer/pull/1106#discussion_r32996071","pull_request_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1106","_links":{"self":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/comments/32996071"},"html":{"href":"https://github.com/dib-lab/khmer/pull/1106#discussion_r32996071"},"pull_request":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1106"}}},"pull_request":{"url":"https://api.github.com/repos/dib-lab/khmer/pulls/1106","id":38125236,"html_url":"https://github.com/dib-lab/khmer/pull/1106","diff_url":"https://github.com/dib-lab/khmer/pull/1106.diff","patch_url":"https://github.com/dib-lab/khmer/pull/1106.patch","issue_url":"https://api.github.com/repos/dib-lab/khmer/issues/1106","number":1106,"state":"open","locked":false,"title":"Vulture of #621: \"add estimate_optimal_hash.py\"","user":{"login":"bocajnotnef","id":2142082,"avatar_url":"https://avatars.githubusercontent.com/u/2142082?v=3","gravatar_id":"","url":"https://api.github.com/users/bocajnotnef","html_url":"https://github.com/bocajnotnef","followers_url":"https://api.github.com/users/bocajnotnef/followers","following_url":"https://api.github.com/users/bocajnotnef/following{/other_user}","gists_url":"https://api.github.com/users/bocajnotnef/gists{/gist_id}","starred_url":"https://api.github.com/users/bocajnotnef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bocajnotnef/subscriptions","organizations_url":"https://api.github.com/users/bocajnotnef/orgs","repos_url":"https://api.github.com/users/bocajnotnef/repos","events_url":"https://api.github.com/users/bocajnotnef/events{/privacy}","received_events_url":"https://api.github.com/users/bocajnotnef/received_events","type":"User","site_admin":false},"body":"Copied from #621, addresses #390(ish)","created_at":"2015-06-19T16:36:09Z","updated_at":"2015-06-22T23:31:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53c0f544e9503f3cb072c99bd87c63dc75c704e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1106/commits","review_comments_url":"https://api.github.com/repos/dib-lab/khmer/pulls/1106/comments","review_comment_url":"https://api.github.com/repos/dib-lab/khmer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dib-lab/khmer/issues/1106/comments","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/8f30b748767e29963ced0bcbd2734dbed4a252ef","head":{"label":"dib-lab:fix/390","ref":"fix/390","sha":"8f30b748767e29963ced0bcbd2734dbed4a252ef","user":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"repo":{"id":4331833,"name":"khmer","full_name":"dib-lab/khmer","owner":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dib-lab/khmer","description":"In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more","fork":false,"url":"https://api.github.com/repos/dib-lab/khmer","forks_url":"https://api.github.com/repos/dib-lab/khmer/forks","keys_url":"https://api.github.com/repos/dib-lab/khmer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dib-lab/khmer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dib-lab/khmer/teams","hooks_url":"https://api.github.com/repos/dib-lab/khmer/hooks","issue_events_url":"https://api.github.com/repos/dib-lab/khmer/issues/events{/number}","events_url":"https://api.github.com/repos/dib-lab/khmer/events","assignees_url":"https://api.github.com/repos/dib-lab/khmer/assignees{/user}","branches_url":"https://api.github.com/repos/dib-lab/khmer/branches{/branch}","tags_url":"https://api.github.com/repos/dib-lab/khmer/tags","blobs_url":"https://api.github.com/repos/dib-lab/khmer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dib-lab/khmer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dib-lab/khmer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dib-lab/khmer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/{sha}","languages_url":"https://api.github.com/repos/dib-lab/khmer/languages","stargazers_url":"https://api.github.com/repos/dib-lab/khmer/stargazers","contributors_url":"https://api.github.com/repos/dib-lab/khmer/contributors","subscribers_url":"https://api.github.com/repos/dib-lab/khmer/subscribers","subscription_url":"https://api.github.com/repos/dib-lab/khmer/subscription","commits_url":"https://api.github.com/repos/dib-lab/khmer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dib-lab/khmer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dib-lab/khmer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dib-lab/khmer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dib-lab/khmer/contents/{+path}","compare_url":"https://api.github.com/repos/dib-lab/khmer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dib-lab/khmer/merges","archive_url":"https://api.github.com/repos/dib-lab/khmer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dib-lab/khmer/downloads","issues_url":"https://api.github.com/repos/dib-lab/khmer/issues{/number}","pulls_url":"https://api.github.com/repos/dib-lab/khmer/pulls{/number}","milestones_url":"https://api.github.com/repos/dib-lab/khmer/milestones{/number}","notifications_url":"https://api.github.com/repos/dib-lab/khmer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dib-lab/khmer/labels{/name}","releases_url":"https://api.github.com/repos/dib-lab/khmer/releases{/id}","created_at":"2012-05-15T03:52:53Z","updated_at":"2015-06-19T23:55:43Z","pushed_at":"2015-06-22T22:13:06Z","git_url":"git://github.com/dib-lab/khmer.git","ssh_url":"git@github.com:dib-lab/khmer.git","clone_url":"https://github.com/dib-lab/khmer.git","svn_url":"https://github.com/dib-lab/khmer","homepage":"http://khmer.readthedocs.org/","size":164609,"stargazers_count":238,"watchers_count":238,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":266,"forks":194,"open_issues":266,"watchers":238,"default_branch":"master"}},"base":{"label":"dib-lab:master","ref":"master","sha":"75f6fbfacb41bb4d751527d3cc8c3f03439f27e3","user":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"repo":{"id":4331833,"name":"khmer","full_name":"dib-lab/khmer","owner":{"login":"dib-lab","id":1740697,"avatar_url":"https://avatars.githubusercontent.com/u/1740697?v=3","gravatar_id":"","url":"https://api.github.com/users/dib-lab","html_url":"https://github.com/dib-lab","followers_url":"https://api.github.com/users/dib-lab/followers","following_url":"https://api.github.com/users/dib-lab/following{/other_user}","gists_url":"https://api.github.com/users/dib-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/dib-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dib-lab/subscriptions","organizations_url":"https://api.github.com/users/dib-lab/orgs","repos_url":"https://api.github.com/users/dib-lab/repos","events_url":"https://api.github.com/users/dib-lab/events{/privacy}","received_events_url":"https://api.github.com/users/dib-lab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dib-lab/khmer","description":"In-memory nucleotide sequence k-mer counting, filtering, graph traversal and more","fork":false,"url":"https://api.github.com/repos/dib-lab/khmer","forks_url":"https://api.github.com/repos/dib-lab/khmer/forks","keys_url":"https://api.github.com/repos/dib-lab/khmer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dib-lab/khmer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dib-lab/khmer/teams","hooks_url":"https://api.github.com/repos/dib-lab/khmer/hooks","issue_events_url":"https://api.github.com/repos/dib-lab/khmer/issues/events{/number}","events_url":"https://api.github.com/repos/dib-lab/khmer/events","assignees_url":"https://api.github.com/repos/dib-lab/khmer/assignees{/user}","branches_url":"https://api.github.com/repos/dib-lab/khmer/branches{/branch}","tags_url":"https://api.github.com/repos/dib-lab/khmer/tags","blobs_url":"https://api.github.com/repos/dib-lab/khmer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dib-lab/khmer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dib-lab/khmer/git/refs{/sha}","trees_url":"https://api.github.com/repos/dib-lab/khmer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dib-lab/khmer/statuses/{sha}","languages_url":"https://api.github.com/repos/dib-lab/khmer/languages","stargazers_url":"https://api.github.com/repos/dib-lab/khmer/stargazers","contributors_url":"https://api.github.com/repos/dib-lab/khmer/contributors","subscribers_url":"https://api.github.com/repos/dib-lab/khmer/subscribers","subscription_url":"https://api.github.com/repos/dib-lab/khmer/subscription","commits_url":"https://api.github.com/repos/dib-lab/khmer/commits{/sha}","git_commits_url":"https://api.github.com/repos/dib-lab/khmer/git/commits{/sha}","comments_url":"https://api.github.com/repos/dib-lab/khmer/comments{/number}","issue_comment_url":"https://api.github.com/repos/dib-lab/khmer/issues/comments{/number}","contents_url":"https://api.github.com/repos/dib-lab/khmer/contents/{+path}","compare_url":"https://api.github.com/repos/dib-lab/khmer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dib-lab/khmer/merges","archive_url":"https://api.github.com/repos/dib-lab/khmer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dib-lab/khmer/downloads","issues_url":"https://api.github.com/repos/dib-lab/khmer/issues{/number}","pulls_url":"https://api.github.com/repos/dib-lab/khmer/pulls{/number}","milestones_url":"https://api.github.com/repos/dib-lab/khmer/milestones{/number}","notifications_url":"https://api.github.com/repos/dib-lab/khmer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dib-lab/khmer/labels{/name}","releases_url":"https://api.github.com/repos/dib-lab/khmer/releases{/id}","created_at":"2012-05-15T03:52:53Z","updated_at":"2015-06-19T23:55:43Z","pushed_at":"2015-06-22T22:13:06Z","git_url":"git://github.com/dib-lab/khmer.git","ssh_url":"git@github.com:dib-lab/khmer.git","clone_url":"https://github.com/dib-lab/khmer.git","svn_url":"https://github.com/dib-lab/khmer","homepage":"http://khmer.readthedocs.org/","size":164609,"stargazers_count":238,"watchers_count":238,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":266,"forks":194,"open_issues":266,"watchers":238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1106"},"html":{"href":"https://github.com/dib-lab/khmer/pull/1106"},"issue":{"href":"https://api.github.com/repos/dib-lab/khmer/issues/1106"},"comments":{"href":"https://api.github.com/repos/dib-lab/khmer/issues/1106/comments"},"review_comments":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1106/comments"},"review_comment":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dib-lab/khmer/pulls/1106/commits"},"statuses":{"href":"https://api.github.com/repos/dib-lab/khmer/statuses/8f30b748767e29963ced0bcbd2734dbed4a252ef"}}}}