Change build_index to only occur for old index #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In current implementation a new index file will be created if the index file modification time is older than, or equal, to the fasta file. In some cases, e.g. if the files are downloaded as part of an external bundle, the modification times could be equal for all files. In such cases you often want to preserve the original index.
Fix this by only building index if the index is older than the fasta file. If they have equal mtime, it will be used instead.
The day-to-day reason behind wanting this change is that we're using the reference fasta file from the GATK bundle, and we don't trust to change it from the original bundle index used by GATK. As we don't always have control how the bundle is deployed, touching the index file for each deployment is also a hassle.