{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/wdl/pulls/comments/78115742","id":78115742,"diff_hunk":"@@ -0,0 +1,210 @@\n+#!/bin/python\n+import json\n+import sys\n+import datetime\n+import os\n+\n+#The following python script is designed to take in a directory of json files containing GATK tools,\n+# and output a WDL task file for each one.\n+\n+def getWdlType(jsonType):\n+    if(jsonType.lower() == \"double\"):\n+        return \"Float\"\n+    elif(jsonType.lower() == \"integer\" or jsonType.lower() == \"int\"):\n+        return \"Int\"\n+    elif(jsonType.lower() == \"boolean\"):\n+        return \"Boolean\"\n+    elif(jsonType.lower() == \"file\"):\n+        return \"File\"\n+    elif(\"list\" in jsonType.lower()):\n+        substring = jsonType[jsonType.find(\"[\")+1:len(jsonType)-1]\n+        return \"Array[\" + getWdlType(substring) + \"]\"\n+    else:\n+        return \"String\"\n+\n+def getArgIndexByName(nameStr, args):\n+    for x in range(0,len(args)):\n+        if  args[x][\"name\"].lower() == nameStr.lower():\n+            return x\n+    return -1\n+\n+def checkName(nameStr):\n+    index = nameStr.find(\":\")\n+    if nameStr ==\"input\":\n+        return checkName(\"task_\" + nameStr)\n+    elif index>0:\n+        return checkName(nameStr[0:index] + nameStr[index+1:])\n+    else:\n+        return nameStr\n+\n+def checkQuotes(myStr):\n+    index = myStr.find(\"\\\"\")\n+    if index < 0:\n+        return myStr\n+    else:\n+        return checkQuotes(myStr[0:index]+myStr[index+1:])\n+        \n+#collect inputs\n+directory = sys.argv[1]\n+version = sys.argv[2]\n+\n+dirFiles = os.listdir(directory)\n+engineJson = directory + \"/engine_args_per_tool.json\"\n+cmdJson = directory + \"/org_broadinstitute_gatk_engine_CommandLineGATK.php.json\"\n+\n+#open files and grab data\n+with open(engineJson) as engineFile:\n+    engineData = json.load(engineFile)\n+with open(cmdJson) as cmdFile:\n+    cmdData = json.load(cmdFile)\n+\n+dirJsons = []\n+for a in range(0, len(dirFiles)):\n+    if \".json\" in dirFiles[a] and \"gatk_tools\" in dirFiles[a]:\n+        dirJsons.append(directory + \"/\" + dirFiles[a])\n+\n+#iterate over each file in the directory of jsons\n+#TODO: change 3 to len(dirJsons)\n+for a in range(0,len(dirJsons)):\n+    toolJson = dirJsons[a]\n+\n+    #open the tool file, and load the data\n+    with open(toolJson) as toolFile: \n+        toolData = json.load(toolFile)\n+\n+    #grab frequently used sections from toolData for easier access\n+    toolName = toolData[\"name\"]\n+    toolArgs = toolData[\"arguments\"]\n+    cmdArgs = cmdData[\"arguments\"]\n+\n+    if(\"Tools\" in toolData[\"group\"]):\n+        #open the output file\n+        filename = directory + \"/WDLTasks/\" + toolName + \"_\" + version + \".wdl\"\n+        wdlFile = open(filename, 'w')\n+\n+        #parse the summary text to cut after \\n\n+        cutIndex = toolData[\"summary\"].find(\"\\n\")\n+        if cutIndex > 0:\n+            toolSummary = toolData[\"summary\"][0:cutIndex]\n+        else:\n+            toolSummary = toolData[\"summary\"]\n+\n+        #Write header and declare task\n+        wdlFile.write(\"# --------------------------------------------------------------------------------------------\\n\" +\n+                      \"# The following \" + toolName + \" script was generated on \" + datetime.date.today().strftime(\"%m/%d/%y\") +","path":"scripts/wrappers/gatk/gatkToWdlWrapper.py","position":94,"original_position":94,"commit_id":"6e08e2af289b8254be23c8bcc119eb731c43b6fb","original_commit_id":"6e08e2af289b8254be23c8bcc119eb731c43b6fb","user":{"login":"vdauwera","id":2748435,"avatar_url":"https://avatars.githubusercontent.com/u/2748435?v=3","gravatar_id":"","url":"https://api.github.com/users/vdauwera","html_url":"https://github.com/vdauwera","followers_url":"https://api.github.com/users/vdauwera/followers","following_url":"https://api.github.com/users/vdauwera/following{/other_user}","gists_url":"https://api.github.com/users/vdauwera/gists{/gist_id}","starred_url":"https://api.github.com/users/vdauwera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdauwera/subscriptions","organizations_url":"https://api.github.com/users/vdauwera/orgs","repos_url":"https://api.github.com/users/vdauwera/repos","events_url":"https://api.github.com/users/vdauwera/events{/privacy}","received_events_url":"https://api.github.com/users/vdauwera/received_events","type":"User","site_admin":false},"body":"script -> wrapper here and on line 96","created_at":"2016-09-09T01:06:53Z","updated_at":"2016-09-09T01:06:53Z","html_url":"https://github.com/broadinstitute/wdl/pull/58#discussion_r78115742","pull_request_url":"https://api.github.com/repos/broadinstitute/wdl/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/comments/78115742"},"html":{"href":"https://github.com/broadinstitute/wdl/pull/58#discussion_r78115742"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/wdl/pulls/58","id":84485528,"html_url":"https://github.com/broadinstitute/wdl/pull/58","diff_url":"https://github.com/broadinstitute/wdl/pull/58.diff","patch_url":"https://github.com/broadinstitute/wdl/pull/58.patch","issue_url":"https://api.github.com/repos/broadinstitute/wdl/issues/58","number":58,"state":"open","locked":false,"title":"Add gatkToWdlWrapper","user":{"login":"knoblett","id":13629186,"avatar_url":"https://avatars.githubusercontent.com/u/13629186?v=3","gravatar_id":"","url":"https://api.github.com/users/knoblett","html_url":"https://github.com/knoblett","followers_url":"https://api.github.com/users/knoblett/followers","following_url":"https://api.github.com/users/knoblett/following{/other_user}","gists_url":"https://api.github.com/users/knoblett/gists{/gist_id}","starred_url":"https://api.github.com/users/knoblett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knoblett/subscriptions","organizations_url":"https://api.github.com/users/knoblett/orgs","repos_url":"https://api.github.com/users/knoblett/repos","events_url":"https://api.github.com/users/knoblett/events{/privacy}","received_events_url":"https://api.github.com/users/knoblett/received_events","type":"User","site_admin":false},"body":"Follows issue broadinstitute/dsde-docs#1223","created_at":"2016-09-08T14:13:47Z","updated_at":"2016-09-09T01:06:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08cb702c2d3951b6d87acaed6c15bebb33efaae3","assignee":{"login":"knoblett","id":13629186,"avatar_url":"https://avatars.githubusercontent.com/u/13629186?v=3","gravatar_id":"","url":"https://api.github.com/users/knoblett","html_url":"https://github.com/knoblett","followers_url":"https://api.github.com/users/knoblett/followers","following_url":"https://api.github.com/users/knoblett/following{/other_user}","gists_url":"https://api.github.com/users/knoblett/gists{/gist_id}","starred_url":"https://api.github.com/users/knoblett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knoblett/subscriptions","organizations_url":"https://api.github.com/users/knoblett/orgs","repos_url":"https://api.github.com/users/knoblett/repos","events_url":"https://api.github.com/users/knoblett/events{/privacy}","received_events_url":"https://api.github.com/users/knoblett/received_events","type":"User","site_admin":false},"assignees":[{"login":"knoblett","id":13629186,"avatar_url":"https://avatars.githubusercontent.com/u/13629186?v=3","gravatar_id":"","url":"https://api.github.com/users/knoblett","html_url":"https://github.com/knoblett","followers_url":"https://api.github.com/users/knoblett/followers","following_url":"https://api.github.com/users/knoblett/following{/other_user}","gists_url":"https://api.github.com/users/knoblett/gists{/gist_id}","starred_url":"https://api.github.com/users/knoblett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knoblett/subscriptions","organizations_url":"https://api.github.com/users/knoblett/orgs","repos_url":"https://api.github.com/users/knoblett/repos","events_url":"https://api.github.com/users/knoblett/events{/privacy}","received_events_url":"https://api.github.com/users/knoblett/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/wdl/pulls/58/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/wdl/pulls/58/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/wdl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/wdl/issues/58/comments","statuses_url":"https://api.github.com/repos/broadinstitute/wdl/statuses/6e08e2af289b8254be23c8bcc119eb731c43b6fb","head":{"label":"broadinstitute:knoblett-gatkWrapper","ref":"knoblett-gatkWrapper","sha":"6e08e2af289b8254be23c8bcc119eb731c43b6fb","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":5254429,"name":"wdl","full_name":"broadinstitute/wdl","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/wdl","description":"Workflow Description Language - Specification and Implementations","fork":false,"url":"https://api.github.com/repos/broadinstitute/wdl","forks_url":"https://api.github.com/repos/broadinstitute/wdl/forks","keys_url":"https://api.github.com/repos/broadinstitute/wdl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/wdl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/wdl/teams","hooks_url":"https://api.github.com/repos/broadinstitute/wdl/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/wdl/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/wdl/events","assignees_url":"https://api.github.com/repos/broadinstitute/wdl/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/wdl/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/wdl/tags","blobs_url":"https://api.github.com/repos/broadinstitute/wdl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/wdl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/wdl/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/wdl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/wdl/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/wdl/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/wdl/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/wdl/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/wdl/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/wdl/subscription","commits_url":"https://api.github.com/repos/broadinstitute/wdl/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/wdl/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/wdl/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/wdl/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/wdl/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/wdl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/wdl/merges","archive_url":"https://api.github.com/repos/broadinstitute/wdl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/wdl/downloads","issues_url":"https://api.github.com/repos/broadinstitute/wdl/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/wdl/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/wdl/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/wdl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/wdl/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/wdl/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/wdl/deployments","created_at":"2012-08-01T03:12:48Z","updated_at":"2016-09-04T16:05:01Z","pushed_at":"2016-09-08T19:37:54Z","git_url":"git://github.com/broadinstitute/wdl.git","ssh_url":"git@github.com:broadinstitute/wdl.git","clone_url":"https://github.com/broadinstitute/wdl.git","svn_url":"https://github.com/broadinstitute/wdl","homepage":"","size":2735,"stargazers_count":87,"watchers_count":87,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":11,"forks":15,"open_issues":11,"watchers":87,"default_branch":"develop"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"d8c12455251618e20328aa28a3ac60038db4dec3","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":5254429,"name":"wdl","full_name":"broadinstitute/wdl","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/wdl","description":"Workflow Description Language - Specification and Implementations","fork":false,"url":"https://api.github.com/repos/broadinstitute/wdl","forks_url":"https://api.github.com/repos/broadinstitute/wdl/forks","keys_url":"https://api.github.com/repos/broadinstitute/wdl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/wdl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/wdl/teams","hooks_url":"https://api.github.com/repos/broadinstitute/wdl/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/wdl/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/wdl/events","assignees_url":"https://api.github.com/repos/broadinstitute/wdl/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/wdl/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/wdl/tags","blobs_url":"https://api.github.com/repos/broadinstitute/wdl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/wdl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/wdl/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/wdl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/wdl/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/wdl/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/wdl/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/wdl/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/wdl/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/wdl/subscription","commits_url":"https://api.github.com/repos/broadinstitute/wdl/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/wdl/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/wdl/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/wdl/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/wdl/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/wdl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/wdl/merges","archive_url":"https://api.github.com/repos/broadinstitute/wdl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/wdl/downloads","issues_url":"https://api.github.com/repos/broadinstitute/wdl/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/wdl/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/wdl/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/wdl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/wdl/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/wdl/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/wdl/deployments","created_at":"2012-08-01T03:12:48Z","updated_at":"2016-09-04T16:05:01Z","pushed_at":"2016-09-08T19:37:54Z","git_url":"git://github.com/broadinstitute/wdl.git","ssh_url":"git@github.com:broadinstitute/wdl.git","clone_url":"https://github.com/broadinstitute/wdl.git","svn_url":"https://github.com/broadinstitute/wdl","homepage":"","size":2735,"stargazers_count":87,"watchers_count":87,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":11,"forks":15,"open_issues":11,"watchers":87,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/58"},"html":{"href":"https://github.com/broadinstitute/wdl/pull/58"},"issue":{"href":"https://api.github.com/repos/broadinstitute/wdl/issues/58"},"comments":{"href":"https://api.github.com/repos/broadinstitute/wdl/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/wdl/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/wdl/statuses/6e08e2af289b8254be23c8bcc119eb731c43b6fb"}}}}
{"actor":{"display_login":"vdauwera"}}