{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/gatk/pulls/comments/134685606","pull_request_review_id":58004079,"id":134685606,"diff_hunk":"@@ -19,25 +23,51 @@\n )\n public final class BwaMemIndexImageCreator extends CommandLineProgram {\n \n+    public static final String USE_EXISTING_INDEX_FULL_NAME = \"useExistingIndexFilesIfAvailable\";\n+    public static final String USE_EXISTING_INDEX_SHORT_NAME = \"useIndexFiles\";\n+\n     @Argument(fullName = StandardArgumentDefinitions.INPUT_LONG_NAME,\n-              shortName = StandardArgumentDefinitions.INPUT_SHORT_NAME,\n-              doc = \"Input reference fasta file. The five bwa index files are assumed living in the same directory with the same prefix.\")\n+            shortName = StandardArgumentDefinitions.INPUT_SHORT_NAME,\n+            doc = \"Input reference fasta file. The five bwa index files are assumed living in the same directory with the same prefix.\")\n     private String referenceFastaLoc = null;\n \n     @Argument(fullName = StandardArgumentDefinitions.OUTPUT_LONG_NAME,\n-              shortName = StandardArgumentDefinitions.OUTPUT_SHORT_NAME,\n-              doc = \"Output reference index image file (ending in \\\".img\\\").\",\n-              optional = true)\n+            shortName = StandardArgumentDefinitions.OUTPUT_SHORT_NAME,\n+            doc = \"Output reference index image file (ending in \\\".img\\\").\",\n+            optional = true)\n     private String referenceIndexImageOutputLoc = null;\n \n+    @Argument(fullName = USE_EXISTING_INDEX_FULL_NAME,\n+            shortName = USE_EXISTING_INDEX_SHORT_NAME,\n+            doc = \"If there are some index files present, build the image out of those rather than the reference.\",\n+            optional = true)\n+    private boolean useExistingIndexFilesIfAvailable = false;\n+\n     @Override\n     protected final Object doWork() {\n-\n         if (referenceIndexImageOutputLoc == null) {\n-            referenceIndexImageOutputLoc = referenceFastaLoc+\".img\";\n+            referenceIndexImageOutputLoc = referenceFastaLoc + \".img\";\n         }\n \n-        BwaMemIndex.createIndexImage(referenceFastaLoc, referenceIndexImageOutputLoc);\n+        if (useExistingIndexFilesIfAvailable) {\n+            if (checkIndexFilesArePresent(referenceFastaLoc)) {\n+                BwaMemIndex.createIndexImageFromIndexFiles(referenceFastaLoc, referenceIndexImageOutputLoc);\n+                return null;\n+            } else {\n+                logger.warn(String.format(\"User requested to use existing index files, \" +\n+                        \"however no complete set of index file (%s.*) was found; \" +\n+                        \"trying to create the image from the reference file directly\", referenceFastaLoc));\n+            }\n+        } else {\n+            logger.warn(\"User requested to use existing index files however no complete set was found\");","path":"src/main/java/org/broadinstitute/hellbender/tools/BwaMemIndexImageCreator.java","position":66,"original_position":66,"commit_id":"91b47a774a2b8fb80b3e151d9c04245133874fd3","original_commit_id":"91b47a774a2b8fb80b3e151d9c04245133874fd3","user":{"login":"magicDGS","id":7352559,"avatar_url":"https://avatars0.githubusercontent.com/u/7352559?v=4","gravatar_id":"","url":"https://api.github.com/users/magicDGS","html_url":"https://github.com/magicDGS","followers_url":"https://api.github.com/users/magicDGS/followers","following_url":"https://api.github.com/users/magicDGS/following{/other_user}","gists_url":"https://api.github.com/users/magicDGS/gists{/gist_id}","starred_url":"https://api.github.com/users/magicDGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicDGS/subscriptions","organizations_url":"https://api.github.com/users/magicDGS/orgs","repos_url":"https://api.github.com/users/magicDGS/repos","events_url":"https://api.github.com/users/magicDGS/events{/privacy}","received_events_url":"https://api.github.com/users/magicDGS/received_events","type":"User","site_admin":false},"body":"I guess that this else clause should be removed now.","created_at":"2017-08-23T08:19:13Z","updated_at":"2017-08-23T08:19:13Z","html_url":"https://github.com/broadinstitute/gatk/pull/3474#discussion_r134685606","pull_request_url":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/comments/134685606"},"html":{"href":"https://github.com/broadinstitute/gatk/pull/3474#discussion_r134685606"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474","id":136908714,"html_url":"https://github.com/broadinstitute/gatk/pull/3474","diff_url":"https://github.com/broadinstitute/gatk/pull/3474.diff","patch_url":"https://github.com/broadinstitute/gatk/pull/3474.patch","issue_url":"https://api.github.com/repos/broadinstitute/gatk/issues/3474","number":3474,"state":"open","locked":false,"title":"Updates bwamem-jni depedency to 1.0.2 and adds the possibility of ali…","user":{"login":"vruano","id":791104,"avatar_url":"https://avatars3.githubusercontent.com/u/791104?v=4","gravatar_id":"","url":"https://api.github.com/users/vruano","html_url":"https://github.com/vruano","followers_url":"https://api.github.com/users/vruano/followers","following_url":"https://api.github.com/users/vruano/following{/other_user}","gists_url":"https://api.github.com/users/vruano/gists{/gist_id}","starred_url":"https://api.github.com/users/vruano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vruano/subscriptions","organizations_url":"https://api.github.com/users/vruano/orgs","repos_url":"https://api.github.com/users/vruano/repos","events_url":"https://api.github.com/users/vruano/events{/privacy}","received_events_url":"https://api.github.com/users/vruano/received_events","type":"User","site_admin":false},"body":"…gning singletons to  BwaEngine classes.\r\n\r\nUpdates bwamem-jni depedency to 1.0.2 and adds the possibility of aligning singletons to  BwaEngine classes.","created_at":"2017-08-22T07:26:19Z","updated_at":"2017-08-23T08:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d640c8c47b716a9edc800735a6fcfee78643190c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/gatk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/gatk/issues/3474/comments","statuses_url":"https://api.github.com/repos/broadinstitute/gatk/statuses/91b47a774a2b8fb80b3e151d9c04245133874fd3","head":{"label":"broadinstitute:vrr_bwa_update_and_single_end","ref":"vrr_bwa_update_and_single_end","sha":"91b47a774a2b8fb80b3e151d9c04245133874fd3","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","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":27452807,"name":"gatk","full_name":"broadinstitute/gatk","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","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/gatk","description":"Official code repository for GATK versions 4 and up","fork":false,"url":"https://api.github.com/repos/broadinstitute/gatk","forks_url":"https://api.github.com/repos/broadinstitute/gatk/forks","keys_url":"https://api.github.com/repos/broadinstitute/gatk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gatk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gatk/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gatk/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gatk/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gatk/events","assignees_url":"https://api.github.com/repos/broadinstitute/gatk/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gatk/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gatk/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gatk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gatk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gatk/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gatk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gatk/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gatk/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gatk/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gatk/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gatk/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gatk/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gatk/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gatk/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gatk/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gatk/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/gatk/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gatk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gatk/merges","archive_url":"https://api.github.com/repos/broadinstitute/gatk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gatk/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gatk/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gatk/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gatk/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gatk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gatk/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gatk/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/gatk/deployments","created_at":"2014-12-02T20:50:36Z","updated_at":"2017-08-22T16:43:22Z","pushed_at":"2017-08-23T00:23:13Z","git_url":"git://github.com/broadinstitute/gatk.git","ssh_url":"git@github.com:broadinstitute/gatk.git","clone_url":"https://github.com/broadinstitute/gatk.git","svn_url":"https://github.com/broadinstitute/gatk","homepage":"https://software.broadinstitute.org/gatk","size":139479,"stargazers_count":209,"watchers_count":209,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":779,"forks":77,"open_issues":779,"watchers":209,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"bf05177bb1337fa878d85f467deb00c190d17360","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","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":27452807,"name":"gatk","full_name":"broadinstitute/gatk","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","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/gatk","description":"Official code repository for GATK versions 4 and up","fork":false,"url":"https://api.github.com/repos/broadinstitute/gatk","forks_url":"https://api.github.com/repos/broadinstitute/gatk/forks","keys_url":"https://api.github.com/repos/broadinstitute/gatk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/gatk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/gatk/teams","hooks_url":"https://api.github.com/repos/broadinstitute/gatk/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/gatk/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/gatk/events","assignees_url":"https://api.github.com/repos/broadinstitute/gatk/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/gatk/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/gatk/tags","blobs_url":"https://api.github.com/repos/broadinstitute/gatk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/gatk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/gatk/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/gatk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/gatk/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/gatk/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/gatk/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/gatk/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/gatk/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/gatk/subscription","commits_url":"https://api.github.com/repos/broadinstitute/gatk/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/gatk/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/gatk/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/gatk/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/gatk/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/gatk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/gatk/merges","archive_url":"https://api.github.com/repos/broadinstitute/gatk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/gatk/downloads","issues_url":"https://api.github.com/repos/broadinstitute/gatk/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/gatk/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/gatk/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/gatk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/gatk/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/gatk/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/gatk/deployments","created_at":"2014-12-02T20:50:36Z","updated_at":"2017-08-22T16:43:22Z","pushed_at":"2017-08-23T00:23:13Z","git_url":"git://github.com/broadinstitute/gatk.git","ssh_url":"git@github.com:broadinstitute/gatk.git","clone_url":"https://github.com/broadinstitute/gatk.git","svn_url":"https://github.com/broadinstitute/gatk","homepage":"https://software.broadinstitute.org/gatk","size":139479,"stargazers_count":209,"watchers_count":209,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":779,"forks":77,"open_issues":779,"watchers":209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474"},"html":{"href":"https://github.com/broadinstitute/gatk/pull/3474"},"issue":{"href":"https://api.github.com/repos/broadinstitute/gatk/issues/3474"},"comments":{"href":"https://api.github.com/repos/broadinstitute/gatk/issues/3474/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/gatk/pulls/3474/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/gatk/statuses/91b47a774a2b8fb80b3e151d9c04245133874fd3"}}}}
{"actor":{"display_login":"magicDGS"}}