Consider filename extensions (where necessary) in format detection #1350
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.
Fix the issue of some BED files being misrecognised as FASTA/Q indexes, by — as suggested in #1085 (comment) and #1085 (comment) — adding another API function that also considers the filename extension.
I have not implemented “
hts_detect_format()
should only recognise files asfqi_format
orfai_format
if they are uncompressed” — as suggested in #1347 (comment) — as it would mean that an affected BED file would be recognised as BED if compressed but as a FASTA/Q index if not compressed, and that seems like an unfortunate inconsistency. (The inconsistency of misrecognising an actual FASTA-IDX as BED when it's read from standard input (uncommon for index files!) is comparatively minor.)hts_open()
) are a particular case of 5/6-column BED files (comparatively common). We don't want to misrecognise any actual BED files as FASTA/Q indexes, so require a.fai
/.fqi
extension for the latter — which are unlikely to appear on standard input anyway, so filenames will usually be available.We now have the machinery to recognise GZI indexes as well:
.gzi
extension.Fixes #1085, fixes #1165, and fixes #1347.