{"action":"created","comment":{"url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/comments/203168775","pull_request_review_id":138006786,"id":203168775,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzE2ODc3NQ==","diff_hunk":"@@ -228,32 +246,78 @@ class JsonShell(object):\n     description == help\n     name == name\n     \"\"\"\n-    def __init__(self, filename, json_type, profile='17.09'):\n-        \"\"\"\n+    def __init__(self, filename, json_type, picard=True, profile='17.09'):\n+        \"\"\"\n+\n+        \"\"\"\n+        self.known_types = [ 'Boolean',\n+                             'boolean',\n+                             'Long',\n+                             'long',\n+                             'Integer',\n+                             'int',\n+                             'byte',\n+                             'Double',\n+                             'double',\n+                             'Float',\n+                             'float',\n+                             'String',\n+                             'Set[String]',\n+                             'Set[File]',\n+                             'File',\n+                             'List[File]',\n+                             'List[Double]',\n+                             'List[Integer]',\n+                             'List[String]',\n+                             'FeatureInput[VariantContext]',\n+                             'LogLevel',\n+                             'Implementation',\n+                             'IntervalMergingRule',\n+                             'IntervalSetRule',\n+                             'ValidationStringency',\n+                             'GenotypingOutputMode',\n+                             'OutputMode',\n+                             'PCRErrorModel',\n+                             'WriterType' ]\n \n-        \"\"\"\n         self.common = (\"--version\", \"--showHidden\", \"--help\", \"--arguments_file\", \"--VERBOSITY\",\n                        \"--VALIDATION_STRINGENCY\", \"--USE_JDK_INFLATER\", \"--USE_JDK_DEFLATER\", \"--TMP_DIR\", \"--QUIET\",\n                        \"--MAX_RECORDS_IN_RAM\", \"--GA4GH_CLIENT_SECRETS\", \"--CREATE_MD5_FILE\", \"--CREATE_INDEX\",\n                        \"--COMPRESSION_LEVEL\", \"--REFERENCE_SEQUENCE\", \"--OUTPUT\")\n         self.profile = profile\n+        self.picard = picard\n         self.xml_params = []\n         self.cheetah_params = []\n+        self.sectional_params = {'optional': [], 'advanced': []}\n         with open(filename, 'rU') as myfile:\n             self.json_file = json.load(myfile)\n             for entry in self.json_file['arguments']:\n-                if entry['name'] not in self.common:\n-                    self.xml_params.extend(JsonXml(entry, json_type).xml_param_out)\n-                    self.cheetah_params.append(JsonCheetah(entry).cheetah_template())\n+                if entry['type'] not in self.known_types:\n+                    print('Argument type %s not recognized, skipping.' % entry['type'])\n+                    continue\n+                if entry['kind'] not in self.sectional_params:\n+                    if entry['name'] not in self.common:\n+                        self.xml_params.extend(JsonXml(entry).xml_param_out)\n+                else:\n+                    self.sectional_params[entry['kind']].extend([param.replace('\\t\\t', '\\t\\t\\t') for param in JsonXml(entry).xml_param_out])\n+                self.cheetah_params.append(JsonCheetah(entry).cheetah_template())\n+            for section in self.sectional_params:\n+                section_template = {'name': section, 'label': section.title()}\n+                self.xml_params.append(Template('\\t\\t<section name=\"$name\" title=\"$label Parameters\" expanded=\"False\">\\n').substitute(section_template))\n+                self.xml_params.extend(self.sectional_params[section])\n+                self.xml_params.append('\\t\\t</section>\\n')\n \n     def get_shell(self, outfile):\n         \"\"\"\n         Return the xml shell.\n         :return:\n         \"\"\"\n         self.handle_out = open(outfile, 'w')\n+        shell_dict = self.build_shell_dict()\n+        if 'cheetah_template' not in shell_dict:\n+            shell_dict['cheetah_template'] = '\\n\\t\\t'.join(self.cheetah_params)\n         for k, v in self.build_shell_tmpl().items():\n-            self.handle_out.write(v.substitute(self.build_shell_dict()))\n+            self.handle_out.write(v.substitute(shell_dict).replace('\\t', '    '))","path":"parse_gatk_json.py","position":190,"original_position":190,"commit_id":"27ff39bb7a6caddcbec5acb458600c1e250f8611","original_commit_id":"27ff39bb7a6caddcbec5acb458600c1e250f8611","user":{"login":"jhl667","id":4055334,"node_id":"MDQ6VXNlcjQwNTUzMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4055334?v=4","gravatar_id":"","url":"https://api.github.com/users/jhl667","html_url":"https://github.com/jhl667","followers_url":"https://api.github.com/users/jhl667/followers","following_url":"https://api.github.com/users/jhl667/following{/other_user}","gists_url":"https://api.github.com/users/jhl667/gists{/gist_id}","starred_url":"https://api.github.com/users/jhl667/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhl667/subscriptions","organizations_url":"https://api.github.com/users/jhl667/orgs","repos_url":"https://api.github.com/users/jhl667/repos","events_url":"https://api.github.com/users/jhl667/events{/privacy}","received_events_url":"https://api.github.com/users/jhl667/received_events","type":"User","site_admin":false},"body":"Agreed, I will make sure my IDE is properly handling tabs as 4 spaces for this project.","created_at":"2018-07-17T20:34:40Z","updated_at":"2018-07-17T20:34:40Z","html_url":"https://github.com/jhl667/gatk4_xml_prepare/pull/1#discussion_r203168775","pull_request_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/comments/203168775"},"html":{"href":"https://github.com/jhl667/gatk4_xml_prepare/pull/1#discussion_r203168775"},"pull_request":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1"}},"in_reply_to_id":203161566},"pull_request":{"url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1","id":202055062,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMDU1MDYy","html_url":"https://github.com/jhl667/gatk4_xml_prepare/pull/1","diff_url":"https://github.com/jhl667/gatk4_xml_prepare/pull/1.diff","patch_url":"https://github.com/jhl667/gatk4_xml_prepare/pull/1.patch","issue_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/1","number":1,"state":"open","locked":false,"title":"Tweaks toward best practices and handling non-picard tools","user":{"login":"davebx","id":1497000,"node_id":"MDQ6VXNlcjE0OTcwMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1497000?v=4","gravatar_id":"","url":"https://api.github.com/users/davebx","html_url":"https://github.com/davebx","followers_url":"https://api.github.com/users/davebx/followers","following_url":"https://api.github.com/users/davebx/following{/other_user}","gists_url":"https://api.github.com/users/davebx/gists{/gist_id}","starred_url":"https://api.github.com/users/davebx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davebx/subscriptions","organizations_url":"https://api.github.com/users/davebx/orgs","repos_url":"https://api.github.com/users/davebx/repos","events_url":"https://api.github.com/users/davebx/events{/privacy}","received_events_url":"https://api.github.com/users/davebx/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-17T20:09:24Z","updated_at":"2018-07-17T20:34:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f9edd1b042900254767fe43c7effa35acba3993","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/1/comments","statuses_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/statuses/27ff39bb7a6caddcbec5acb458600c1e250f8611","head":{"label":"davebx:master","ref":"master","sha":"27ff39bb7a6caddcbec5acb458600c1e250f8611","user":{"login":"davebx","id":1497000,"node_id":"MDQ6VXNlcjE0OTcwMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1497000?v=4","gravatar_id":"","url":"https://api.github.com/users/davebx","html_url":"https://github.com/davebx","followers_url":"https://api.github.com/users/davebx/followers","following_url":"https://api.github.com/users/davebx/following{/other_user}","gists_url":"https://api.github.com/users/davebx/gists{/gist_id}","starred_url":"https://api.github.com/users/davebx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davebx/subscriptions","organizations_url":"https://api.github.com/users/davebx/orgs","repos_url":"https://api.github.com/users/davebx/repos","events_url":"https://api.github.com/users/davebx/events{/privacy}","received_events_url":"https://api.github.com/users/davebx/received_events","type":"User","site_admin":false},"repo":{"id":141338015,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEzMzgwMTU=","name":"gatk4_xml_prepare","full_name":"davebx/gatk4_xml_prepare","owner":{"login":"davebx","id":1497000,"node_id":"MDQ6VXNlcjE0OTcwMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1497000?v=4","gravatar_id":"","url":"https://api.github.com/users/davebx","html_url":"https://github.com/davebx","followers_url":"https://api.github.com/users/davebx/followers","following_url":"https://api.github.com/users/davebx/following{/other_user}","gists_url":"https://api.github.com/users/davebx/gists{/gist_id}","starred_url":"https://api.github.com/users/davebx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davebx/subscriptions","organizations_url":"https://api.github.com/users/davebx/orgs","repos_url":"https://api.github.com/users/davebx/repos","events_url":"https://api.github.com/users/davebx/events{/privacy}","received_events_url":"https://api.github.com/users/davebx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davebx/gatk4_xml_prepare","description":"Creates Galaxy XML files based on JSON formatted files provided from GATK Docs.","fork":true,"url":"https://api.github.com/repos/davebx/gatk4_xml_prepare","forks_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/forks","keys_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/teams","hooks_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/hooks","issue_events_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/issues/events{/number}","events_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/events","assignees_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/assignees{/user}","branches_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/branches{/branch}","tags_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/tags","blobs_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/git/refs{/sha}","trees_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/statuses/{sha}","languages_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/languages","stargazers_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/stargazers","contributors_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/contributors","subscribers_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/subscribers","subscription_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/subscription","commits_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/commits{/sha}","git_commits_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/git/commits{/sha}","comments_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/comments{/number}","issue_comment_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/issues/comments{/number}","contents_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/contents/{+path}","compare_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/merges","archive_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/downloads","issues_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/issues{/number}","pulls_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/pulls{/number}","milestones_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/milestones{/number}","notifications_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/labels{/name}","releases_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/releases{/id}","deployments_url":"https://api.github.com/repos/davebx/gatk4_xml_prepare/deployments","created_at":"2018-07-17T20:05:36Z","updated_at":"2018-07-17T20:08:28Z","pushed_at":"2018-07-17T20:08:26Z","git_url":"git://github.com/davebx/gatk4_xml_prepare.git","ssh_url":"git@github.com:davebx/gatk4_xml_prepare.git","clone_url":"https://github.com/davebx/gatk4_xml_prepare.git","svn_url":"https://github.com/davebx/gatk4_xml_prepare","homepage":null,"size":421,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jhl667:master","ref":"master","sha":"f80336fdc64b3a679a2e8510e7df43d2e9bcd710","user":{"login":"jhl667","id":4055334,"node_id":"MDQ6VXNlcjQwNTUzMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4055334?v=4","gravatar_id":"","url":"https://api.github.com/users/jhl667","html_url":"https://github.com/jhl667","followers_url":"https://api.github.com/users/jhl667/followers","following_url":"https://api.github.com/users/jhl667/following{/other_user}","gists_url":"https://api.github.com/users/jhl667/gists{/gist_id}","starred_url":"https://api.github.com/users/jhl667/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhl667/subscriptions","organizations_url":"https://api.github.com/users/jhl667/orgs","repos_url":"https://api.github.com/users/jhl667/repos","events_url":"https://api.github.com/users/jhl667/events{/privacy}","received_events_url":"https://api.github.com/users/jhl667/received_events","type":"User","site_admin":false},"repo":{"id":141203055,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEyMDMwNTU=","name":"gatk4_xml_prepare","full_name":"jhl667/gatk4_xml_prepare","owner":{"login":"jhl667","id":4055334,"node_id":"MDQ6VXNlcjQwNTUzMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4055334?v=4","gravatar_id":"","url":"https://api.github.com/users/jhl667","html_url":"https://github.com/jhl667","followers_url":"https://api.github.com/users/jhl667/followers","following_url":"https://api.github.com/users/jhl667/following{/other_user}","gists_url":"https://api.github.com/users/jhl667/gists{/gist_id}","starred_url":"https://api.github.com/users/jhl667/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhl667/subscriptions","organizations_url":"https://api.github.com/users/jhl667/orgs","repos_url":"https://api.github.com/users/jhl667/repos","events_url":"https://api.github.com/users/jhl667/events{/privacy}","received_events_url":"https://api.github.com/users/jhl667/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhl667/gatk4_xml_prepare","description":"Creates Galaxy XML files based on JSON formatted files provided from GATK Docs.","fork":false,"url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare","forks_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/forks","keys_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/teams","hooks_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/hooks","issue_events_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/events{/number}","events_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/events","assignees_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/assignees{/user}","branches_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/branches{/branch}","tags_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/tags","blobs_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/statuses/{sha}","languages_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/languages","stargazers_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/stargazers","contributors_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/contributors","subscribers_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/subscribers","subscription_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/subscription","commits_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/contents/{+path}","compare_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/merges","archive_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/downloads","issues_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues{/number}","pulls_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls{/number}","milestones_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/milestones{/number}","notifications_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/labels{/name}","releases_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/releases{/id}","deployments_url":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/deployments","created_at":"2018-07-16T22:50:52Z","updated_at":"2018-07-17T16:11:31Z","pushed_at":"2018-07-17T20:09:24Z","git_url":"git://github.com/jhl667/gatk4_xml_prepare.git","ssh_url":"git@github.com:jhl667/gatk4_xml_prepare.git","clone_url":"https://github.com/jhl667/gatk4_xml_prepare.git","svn_url":"https://github.com/jhl667/gatk4_xml_prepare","homepage":null,"size":421,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1"},"html":{"href":"https://github.com/jhl667/gatk4_xml_prepare/pull/1"},"issue":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/1"},"comments":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jhl667/gatk4_xml_prepare/statuses/27ff39bb7a6caddcbec5acb458600c1e250f8611"}},"author_association":"NONE"}}
{"actor":{"display_login":"jhl667"}}