{"action":"created","comment":{"url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/comments/56047607","id":56047607,"diff_hunk":"@@ -0,0 +1,103 @@\n+#!/usr/bin/env python2.7\n+\n+import argparse\n+import multiprocessing\n+import os\n+import subprocess\n+\n+from toil.job import Job\n+\n+from toil_scripts import download_from_s3_url\n+from toil_scripts.batch_alignment.bwa_alignment import upload_to_s3, docker_call\n+\n+def build_parser():\n+    parser = argparse.ArgumentParser()\n+    parser.add_argument('-r', '--reference', required=True, help=\"Reference Genome URL\")\n+    parser.add_argument('-i', '--reference_index', required=True, help=\"Reference Genome index (.fai) URL\")\n+    parser.add_argument('-e', '--eval_vcf', required=True, help=\"VCF file URL to evaluate\")\n+    parser.add_argument('-c', '--comp_vcf', required=True, help=\"VCF file URL to compare against\")\n+    parser.add_argument('-o', '--output_dir', required=True, help=\"Output directory S3 URL\")\n+    return parser\n+\n+\n+# copied from germline.py\n+def download_url_c(job, url, filename):\n+    work_dir = job.fileStore.getLocalTempDir()\n+    file_path = os.path.join(work_dir, filename)\n+    if not os.path.exists(file_path):\n+        if url.startswith('s3:'):\n+            download_from_s3_url(file_path, url)\n+        else:\n+            try:\n+                subprocess.check_call(['curl', '-fs', '--retry', '5', '--create-dir', url, '-o', file_path])\n+            except subprocess.CalledProcessError as cpe:\n+                raise RuntimeError(\n+                    '\\nNecessary file could not be acquired: %s. Got error \"%s\". Check input URL' % (url, cpe))\n+            except OSError:\n+                raise RuntimeError('Failed to find \"curl\". Install via \"apt-get install curl\"')\n+    assert os.path.exists(file_path)\n+    return job.fileStore.writeGlobalFile(file_path)\n+\n+\n+# copied from germline.py\n+def read_from_filestore_c(job, work_dir, ids, *filenames):\n+    for filename in filenames:\n+        if not os.path.exists(os.path.join(work_dir, filename)):\n+            job.fileStore.readGlobalFile(ids[filename], os.path.join(work_dir, filename))\n+\n+\n+def batch_start(job, input_args):\n+    shared_files = ['ref.fa', 'ref.fa.fai', 'eval.vcf', 'comp.vcf']\n+    shared_ids = {}\n+    for file_name in shared_files:\n+        url = input_args[file_name]\n+        shared_ids[file_name] = job.addChildJobFn(download_url_c, url, file_name).rv()\n+    job.addFollowOnJobFn(concordance, shared_ids, input_args)\n+    \n+\n+def concordance(job, shared_ids, input_args):\n+    \"\"\"\n+    Evaluate concordance between two VCFs with GATK.\n+    \"\"\"\n+    work_dir = job.fileStore.getLocalTempDir()\n+    input_files = ['ref.fa', 'ref.fa.fai', 'eval.vcf', 'comp.vcf']\n+    read_from_filestore_c(job, work_dir, shared_ids, *input_files)\n+\n+    eval_name = input_args['eval.vcf'].split('/')[-1]\n+    comp_name = input_args['comp.vcf'].split('/')[-1]\n+    output = '%s_vs_%s.concordance' % (eval_name, comp_name)\n+    command = ['-T', 'GenotypeConcordance',\n+               '-R', 'ref.fa',\n+               '--eval', 'eval.vcf',\n+               '--comp', 'comp.vcf',\n+               '-o', output","path":"src/toil_scripts/gatk_concordance/gatk_concordance.py","position":73,"original_position":73,"commit_id":"bfcd4afaf3b9aeb538e5e713cb52df6ba0348270","original_commit_id":"bfcd4afaf3b9aeb538e5e713cb52df6ba0348270","user":{"login":"fnothaft","id":3752466,"avatar_url":"https://avatars.githubusercontent.com/u/3752466?v=3","gravatar_id":"","url":"https://api.github.com/users/fnothaft","html_url":"https://github.com/fnothaft","followers_url":"https://api.github.com/users/fnothaft/followers","following_url":"https://api.github.com/users/fnothaft/following{/other_user}","gists_url":"https://api.github.com/users/fnothaft/gists{/gist_id}","starred_url":"https://api.github.com/users/fnothaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnothaft/subscriptions","organizations_url":"https://api.github.com/users/fnothaft/orgs","repos_url":"https://api.github.com/users/fnothaft/repos","events_url":"https://api.github.com/users/fnothaft/events{/privacy}","received_events_url":"https://api.github.com/users/fnothaft/received_events","type":"User","site_admin":false},"body":"Weird hanging `]` here.","created_at":"2016-03-14T18:07:42Z","updated_at":"2016-03-14T18:07:42Z","html_url":"https://github.com/BD2KGenomics/toil-scripts/pull/173#discussion_r56047607","pull_request_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/comments/56047607"},"html":{"href":"https://github.com/BD2KGenomics/toil-scripts/pull/173#discussion_r56047607"},"pull_request":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173","id":62784255,"html_url":"https://github.com/BD2KGenomics/toil-scripts/pull/173","diff_url":"https://github.com/BD2KGenomics/toil-scripts/pull/173.diff","patch_url":"https://github.com/BD2KGenomics/toil-scripts/pull/173.patch","issue_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/173","number":173,"state":"open","locked":false,"title":"Adding GATK concordance script (resolves #167)","user":{"login":"heuermh","id":35293,"avatar_url":"https://avatars.githubusercontent.com/u/35293?v=3","gravatar_id":"","url":"https://api.github.com/users/heuermh","html_url":"https://github.com/heuermh","followers_url":"https://api.github.com/users/heuermh/followers","following_url":"https://api.github.com/users/heuermh/following{/other_user}","gists_url":"https://api.github.com/users/heuermh/gists{/gist_id}","starred_url":"https://api.github.com/users/heuermh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heuermh/subscriptions","organizations_url":"https://api.github.com/users/heuermh/orgs","repos_url":"https://api.github.com/users/heuermh/repos","events_url":"https://api.github.com/users/heuermh/events{/privacy}","received_events_url":"https://api.github.com/users/heuermh/received_events","type":"User","site_admin":false},"body":"Work towards #167, still needs to be tested.","created_at":"2016-03-14T17:17:24Z","updated_at":"2016-03-14T18:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6183e9213f1ac100d7c4b0c41298d1543144e44","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173/commits","review_comments_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173/comments","review_comment_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/173/comments","statuses_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/statuses/bfcd4afaf3b9aeb538e5e713cb52df6ba0348270","head":{"label":"heuermh:concordance","ref":"concordance","sha":"bfcd4afaf3b9aeb538e5e713cb52df6ba0348270","user":{"login":"heuermh","id":35293,"avatar_url":"https://avatars.githubusercontent.com/u/35293?v=3","gravatar_id":"","url":"https://api.github.com/users/heuermh","html_url":"https://github.com/heuermh","followers_url":"https://api.github.com/users/heuermh/followers","following_url":"https://api.github.com/users/heuermh/following{/other_user}","gists_url":"https://api.github.com/users/heuermh/gists{/gist_id}","starred_url":"https://api.github.com/users/heuermh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heuermh/subscriptions","organizations_url":"https://api.github.com/users/heuermh/orgs","repos_url":"https://api.github.com/users/heuermh/repos","events_url":"https://api.github.com/users/heuermh/events{/privacy}","received_events_url":"https://api.github.com/users/heuermh/received_events","type":"User","site_admin":false},"repo":{"id":49468484,"name":"toil-scripts","full_name":"heuermh/toil-scripts","owner":{"login":"heuermh","id":35293,"avatar_url":"https://avatars.githubusercontent.com/u/35293?v=3","gravatar_id":"","url":"https://api.github.com/users/heuermh","html_url":"https://github.com/heuermh","followers_url":"https://api.github.com/users/heuermh/followers","following_url":"https://api.github.com/users/heuermh/following{/other_user}","gists_url":"https://api.github.com/users/heuermh/gists{/gist_id}","starred_url":"https://api.github.com/users/heuermh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heuermh/subscriptions","organizations_url":"https://api.github.com/users/heuermh/orgs","repos_url":"https://api.github.com/users/heuermh/repos","events_url":"https://api.github.com/users/heuermh/events{/privacy}","received_events_url":"https://api.github.com/users/heuermh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heuermh/toil-scripts","description":"A collection of scripts that use Toil to implement genomics pipelines","fork":true,"url":"https://api.github.com/repos/heuermh/toil-scripts","forks_url":"https://api.github.com/repos/heuermh/toil-scripts/forks","keys_url":"https://api.github.com/repos/heuermh/toil-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heuermh/toil-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heuermh/toil-scripts/teams","hooks_url":"https://api.github.com/repos/heuermh/toil-scripts/hooks","issue_events_url":"https://api.github.com/repos/heuermh/toil-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/heuermh/toil-scripts/events","assignees_url":"https://api.github.com/repos/heuermh/toil-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/heuermh/toil-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/heuermh/toil-scripts/tags","blobs_url":"https://api.github.com/repos/heuermh/toil-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heuermh/toil-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heuermh/toil-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/heuermh/toil-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heuermh/toil-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/heuermh/toil-scripts/languages","stargazers_url":"https://api.github.com/repos/heuermh/toil-scripts/stargazers","contributors_url":"https://api.github.com/repos/heuermh/toil-scripts/contributors","subscribers_url":"https://api.github.com/repos/heuermh/toil-scripts/subscribers","subscription_url":"https://api.github.com/repos/heuermh/toil-scripts/subscription","commits_url":"https://api.github.com/repos/heuermh/toil-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/heuermh/toil-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/heuermh/toil-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/heuermh/toil-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/heuermh/toil-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/heuermh/toil-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heuermh/toil-scripts/merges","archive_url":"https://api.github.com/repos/heuermh/toil-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heuermh/toil-scripts/downloads","issues_url":"https://api.github.com/repos/heuermh/toil-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/heuermh/toil-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/heuermh/toil-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/heuermh/toil-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heuermh/toil-scripts/labels{/name}","releases_url":"https://api.github.com/repos/heuermh/toil-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/heuermh/toil-scripts/deployments","created_at":"2016-01-12T02:14:49Z","updated_at":"2016-01-12T02:14:50Z","pushed_at":"2016-03-14T17:13:08Z","git_url":"git://github.com/heuermh/toil-scripts.git","ssh_url":"git@github.com:heuermh/toil-scripts.git","clone_url":"https://github.com/heuermh/toil-scripts.git","svn_url":"https://github.com/heuermh/toil-scripts","homepage":"","size":464,"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":"BD2KGenomics:master","ref":"master","sha":"8ebc2bfa20ca7444a3fd3578b40266d4a00f1e21","user":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":39923176,"name":"toil-scripts","full_name":"BD2KGenomics/toil-scripts","owner":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BD2KGenomics/toil-scripts","description":"A collection of scripts that use Toil to implement genomics pipelines","fork":false,"url":"https://api.github.com/repos/BD2KGenomics/toil-scripts","forks_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/forks","keys_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/teams","hooks_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/hooks","issue_events_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/events","assignees_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/tags","blobs_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/languages","stargazers_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/stargazers","contributors_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/contributors","subscribers_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/subscribers","subscription_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/subscription","commits_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/merges","archive_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/downloads","issues_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/labels{/name}","releases_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/BD2KGenomics/toil-scripts/deployments","created_at":"2015-07-30T00:42:23Z","updated_at":"2016-02-03T15:09:01Z","pushed_at":"2016-03-14T17:57:23Z","git_url":"git://github.com/BD2KGenomics/toil-scripts.git","ssh_url":"git@github.com:BD2KGenomics/toil-scripts.git","clone_url":"https://github.com/BD2KGenomics/toil-scripts.git","svn_url":"https://github.com/BD2KGenomics/toil-scripts","homepage":"","size":529,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":54,"forks":7,"open_issues":54,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173"},"html":{"href":"https://github.com/BD2KGenomics/toil-scripts/pull/173"},"issue":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/173"},"comments":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/BD2KGenomics/toil-scripts/statuses/bfcd4afaf3b9aeb538e5e713cb52df6ba0348270"}}}}