{"action":"created","comment":{"url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/comments/48043258","id":48043258,"diff_hunk":"@@ -0,0 +1,65 @@\n+\"\"\"\n+genetrack.py\n+\n+Input: either scidx or gff format of reads\n+Output: Called peaks in gff format\n+\"\"\"\n+import optparse\n+import csv\n+import os\n+import genetrack_util\n+\n+CHUNK_SIZE = 10000000\n+\n+\n+if __name__ == '__main__':\n+    parser = optparse.OptionParser()\n+    parser.add_option('-t', '--input_format', dest='input_format', type='string', help='Input format')\n+    parser.add_option('-i', '--input', dest='inputs', type='string', action='append', nargs=2, help='Input datasets')\n+    parser.add_option('-s', '--sigma', dest='sigma', type='int', default=5, help='Sigma.')\n+    parser.add_option('-e', '--exclusion', dest='exclusion', type='int', default=20, help='Exclusion zone.')\n+    parser.add_option('-u', '--up_width', dest='up_width', type='int', default=10, help='Upstream width of called peaks.')\n+    parser.add_option('-d', '--down_width', dest='down_width', type='int', default=10, help='Downstream width of called peaks.')\n+    parser.add_option('-f', '--filter', dest='filter', type='int', default=1, help='Absolute read filter.')\n+    options, args = parser.parse_args()\n+\n+    os.mkdir('output')\n+    for (dataset_path, hid) in options.inputs:\n+        if options.input_format == 'gff':\n+            # Make sure the reads for each chromosome are sorted by index.\n+            input_path = genetrack_util.sort_chromosome_reads_by_index(dataset_path)\n+        else:\n+            # We're processing scidx data.\n+            input_path = dataset_path\n+        output_name = 's%se%su%sd%sF%s_on_data_%s' % (str(options.sigma),\n+                                                      str(options.exclusion),\n+                                                      str(options.up_width),\n+                                                      str(options.down_width),\n+                                                      str(options.filter),\n+                                                      str(hid))\n+        output_path = os.path.join('output', output_name)\n+        reader = csv.reader(open(input_path, 'rU'), delimiter='\\t')\n+        writer = csv.writer(open(output_path, 'wt'), delimiter='\\t')\n+        width = options.sigma * 5","path":"tools/genetrack/genetrack.py","position":43,"original_position":43,"commit_id":"27abf224206bd2c4c67aadbf8a69a2aa01180da7","original_commit_id":"27abf224206bd2c4c67aadbf8a69a2aa01180da7","user":{"login":"gregvonkuster","id":6947053,"avatar_url":"https://avatars.githubusercontent.com/u/6947053?v=3","gravatar_id":"","url":"https://api.github.com/users/gregvonkuster","html_url":"https://github.com/gregvonkuster","followers_url":"https://api.github.com/users/gregvonkuster/followers","following_url":"https://api.github.com/users/gregvonkuster/following{/other_user}","gists_url":"https://api.github.com/users/gregvonkuster/gists{/gist_id}","starred_url":"https://api.github.com/users/gregvonkuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregvonkuster/subscriptions","organizations_url":"https://api.github.com/users/gregvonkuster/orgs","repos_url":"https://api.github.com/users/gregvonkuster/repos","events_url":"https://api.github.com/users/gregvonkuster/events{/privacy}","received_events_url":"https://api.github.com/users/gregvonkuster/received_events","type":"User","site_admin":false},"body":"@bgruening I'm not sure.  This is original code upon which I based this tool.","created_at":"2015-12-18T16:36:22Z","updated_at":"2015-12-18T16:36:22Z","html_url":"https://github.com/galaxyproject/tools-iuc/pull/490#discussion_r48043258","pull_request_url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490","_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/comments/48043258"},"html":{"href":"https://github.com/galaxyproject/tools-iuc/pull/490#discussion_r48043258"},"pull_request":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490"}}},"pull_request":{"url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490","id":54099223,"html_url":"https://github.com/galaxyproject/tools-iuc/pull/490","diff_url":"https://github.com/galaxyproject/tools-iuc/pull/490.diff","patch_url":"https://github.com/galaxyproject/tools-iuc/pull/490.patch","issue_url":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/490","number":490,"state":"open","locked":false,"title":"Add the GeneTrack tool","user":{"login":"gregvonkuster","id":6947053,"avatar_url":"https://avatars.githubusercontent.com/u/6947053?v=3","gravatar_id":"","url":"https://api.github.com/users/gregvonkuster","html_url":"https://github.com/gregvonkuster","followers_url":"https://api.github.com/users/gregvonkuster/followers","following_url":"https://api.github.com/users/gregvonkuster/following{/other_user}","gists_url":"https://api.github.com/users/gregvonkuster/gists{/gist_id}","starred_url":"https://api.github.com/users/gregvonkuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregvonkuster/subscriptions","organizations_url":"https://api.github.com/users/gregvonkuster/orgs","repos_url":"https://api.github.com/users/gregvonkuster/repos","events_url":"https://api.github.com/users/gregvonkuster/events{/privacy}","received_events_url":"https://api.github.com/users/gregvonkuster/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-18T12:53:30Z","updated_at":"2015-12-18T16:36:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd6573707061f5845f9e119ad992211e93fd6c89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490/commits","review_comments_url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490/comments","review_comment_url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/490/comments","statuses_url":"https://api.github.com/repos/galaxyproject/tools-iuc/statuses/27abf224206bd2c4c67aadbf8a69a2aa01180da7","head":{"label":"gregvonkuster:genetrack","ref":"genetrack","sha":"27abf224206bd2c4c67aadbf8a69a2aa01180da7","user":{"login":"gregvonkuster","id":6947053,"avatar_url":"https://avatars.githubusercontent.com/u/6947053?v=3","gravatar_id":"","url":"https://api.github.com/users/gregvonkuster","html_url":"https://github.com/gregvonkuster","followers_url":"https://api.github.com/users/gregvonkuster/followers","following_url":"https://api.github.com/users/gregvonkuster/following{/other_user}","gists_url":"https://api.github.com/users/gregvonkuster/gists{/gist_id}","starred_url":"https://api.github.com/users/gregvonkuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregvonkuster/subscriptions","organizations_url":"https://api.github.com/users/gregvonkuster/orgs","repos_url":"https://api.github.com/users/gregvonkuster/repos","events_url":"https://api.github.com/users/gregvonkuster/events{/privacy}","received_events_url":"https://api.github.com/users/gregvonkuster/received_events","type":"User","site_admin":false},"repo":{"id":33613378,"name":"tools-iuc","full_name":"gregvonkuster/tools-iuc","owner":{"login":"gregvonkuster","id":6947053,"avatar_url":"https://avatars.githubusercontent.com/u/6947053?v=3","gravatar_id":"","url":"https://api.github.com/users/gregvonkuster","html_url":"https://github.com/gregvonkuster","followers_url":"https://api.github.com/users/gregvonkuster/followers","following_url":"https://api.github.com/users/gregvonkuster/following{/other_user}","gists_url":"https://api.github.com/users/gregvonkuster/gists{/gist_id}","starred_url":"https://api.github.com/users/gregvonkuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregvonkuster/subscriptions","organizations_url":"https://api.github.com/users/gregvonkuster/orgs","repos_url":"https://api.github.com/users/gregvonkuster/repos","events_url":"https://api.github.com/users/gregvonkuster/events{/privacy}","received_events_url":"https://api.github.com/users/gregvonkuster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gregvonkuster/tools-iuc","description":"Tool Shed repositories maintained and developed by the Intergalactic Utilities Commission","fork":true,"url":"https://api.github.com/repos/gregvonkuster/tools-iuc","forks_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/forks","keys_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/teams","hooks_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/hooks","issue_events_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/issues/events{/number}","events_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/events","assignees_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/assignees{/user}","branches_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/branches{/branch}","tags_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/tags","blobs_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/git/refs{/sha}","trees_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/statuses/{sha}","languages_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/languages","stargazers_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/stargazers","contributors_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/contributors","subscribers_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/subscribers","subscription_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/subscription","commits_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/commits{/sha}","git_commits_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/git/commits{/sha}","comments_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/comments{/number}","issue_comment_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/issues/comments{/number}","contents_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/contents/{+path}","compare_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/merges","archive_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/downloads","issues_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/issues{/number}","pulls_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/pulls{/number}","milestones_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/milestones{/number}","notifications_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/labels{/name}","releases_url":"https://api.github.com/repos/gregvonkuster/tools-iuc/releases{/id}","created_at":"2015-04-08T14:53:04Z","updated_at":"2015-05-06T18:19:08Z","pushed_at":"2015-12-18T16:17:10Z","git_url":"git://github.com/gregvonkuster/tools-iuc.git","ssh_url":"git@github.com:gregvonkuster/tools-iuc.git","clone_url":"https://github.com/gregvonkuster/tools-iuc.git","svn_url":"https://github.com/gregvonkuster/tools-iuc","homepage":"https://wiki.galaxyproject.org/IUC","size":45196,"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":"galaxyproject:master","ref":"master","sha":"64c1c4c664c6a131d897f574dc849f5668fa97d2","user":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"repo":{"id":23992530,"name":"tools-iuc","full_name":"galaxyproject/tools-iuc","owner":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/galaxyproject/tools-iuc","description":"Tool Shed repositories maintained and developed by the Intergalactic Utilities Commission","fork":false,"url":"https://api.github.com/repos/galaxyproject/tools-iuc","forks_url":"https://api.github.com/repos/galaxyproject/tools-iuc/forks","keys_url":"https://api.github.com/repos/galaxyproject/tools-iuc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/galaxyproject/tools-iuc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/galaxyproject/tools-iuc/teams","hooks_url":"https://api.github.com/repos/galaxyproject/tools-iuc/hooks","issue_events_url":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/events{/number}","events_url":"https://api.github.com/repos/galaxyproject/tools-iuc/events","assignees_url":"https://api.github.com/repos/galaxyproject/tools-iuc/assignees{/user}","branches_url":"https://api.github.com/repos/galaxyproject/tools-iuc/branches{/branch}","tags_url":"https://api.github.com/repos/galaxyproject/tools-iuc/tags","blobs_url":"https://api.github.com/repos/galaxyproject/tools-iuc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/galaxyproject/tools-iuc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/galaxyproject/tools-iuc/git/refs{/sha}","trees_url":"https://api.github.com/repos/galaxyproject/tools-iuc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/galaxyproject/tools-iuc/statuses/{sha}","languages_url":"https://api.github.com/repos/galaxyproject/tools-iuc/languages","stargazers_url":"https://api.github.com/repos/galaxyproject/tools-iuc/stargazers","contributors_url":"https://api.github.com/repos/galaxyproject/tools-iuc/contributors","subscribers_url":"https://api.github.com/repos/galaxyproject/tools-iuc/subscribers","subscription_url":"https://api.github.com/repos/galaxyproject/tools-iuc/subscription","commits_url":"https://api.github.com/repos/galaxyproject/tools-iuc/commits{/sha}","git_commits_url":"https://api.github.com/repos/galaxyproject/tools-iuc/git/commits{/sha}","comments_url":"https://api.github.com/repos/galaxyproject/tools-iuc/comments{/number}","issue_comment_url":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/comments{/number}","contents_url":"https://api.github.com/repos/galaxyproject/tools-iuc/contents/{+path}","compare_url":"https://api.github.com/repos/galaxyproject/tools-iuc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/galaxyproject/tools-iuc/merges","archive_url":"https://api.github.com/repos/galaxyproject/tools-iuc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/galaxyproject/tools-iuc/downloads","issues_url":"https://api.github.com/repos/galaxyproject/tools-iuc/issues{/number}","pulls_url":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls{/number}","milestones_url":"https://api.github.com/repos/galaxyproject/tools-iuc/milestones{/number}","notifications_url":"https://api.github.com/repos/galaxyproject/tools-iuc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/galaxyproject/tools-iuc/labels{/name}","releases_url":"https://api.github.com/repos/galaxyproject/tools-iuc/releases{/id}","created_at":"2014-09-13T11:18:49Z","updated_at":"2015-11-28T12:31:54Z","pushed_at":"2015-12-18T16:17:10Z","git_url":"git://github.com/galaxyproject/tools-iuc.git","ssh_url":"git@github.com:galaxyproject/tools-iuc.git","clone_url":"https://github.com/galaxyproject/tools-iuc.git","svn_url":"https://github.com/galaxyproject/tools-iuc","homepage":"https://wiki.galaxyproject.org/IUC","size":119380,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":95,"forks":54,"open_issues":95,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490"},"html":{"href":"https://github.com/galaxyproject/tools-iuc/pull/490"},"issue":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/490"},"comments":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/issues/490/comments"},"review_comments":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490/comments"},"review_comment":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/pulls/490/commits"},"statuses":{"href":"https://api.github.com/repos/galaxyproject/tools-iuc/statuses/27abf224206bd2c4c67aadbf8a69a2aa01180da7"}}}}