8000 int hts_detect_format(hFILE *hfile, htsFormat *fmt) can return fmt->compression = no_compression even if file is compressed · Issue #717 · samtools/htslib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

int hts_detect_format(hFILE *hfile, htsFormat *fmt) can return fmt->compression = no_compression even if file is compressed #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
freeseek opened this issue Jun 20, 2018 · 0 comments

Comments

@freeseek
Copy link

I was trying to use int hts_detect_format(hFILE *hfile, htsFormat *fmt) from htslib/hts.h to open Illumina GTC files. These files can be either uncompressed or compressed.

However, because the first four characters of a GTC file can be "GTC\3", the execution ends up to the end of the function code:

    fmt->category = unknown_category;
    fmt->format = unknown_format;
    fmt->version.major = fmt->version.minor = -1;
    fmt->compression = no_compression;
    return 0;

And fmt->compression gets arbitrarily set to no_compression even if it is initially set to gzip. I am not going to use this function anyway, but I thought this is weird behaviour. I would just remove the second to last line from the code.

jmarshall added a commit to jmarshall/htslib that referenced this issue Jun 26, 2018
Fixes samtools#717 and facilitates upcoming hts_detect_format() changes
that will mean it no longer always returns SAM for unknown data.

Also set compression_level according to XFL when CM is DEFLATE
(BGZF does not set XFL, but plain gzip does).
jmarshall added a commit to jmarshall/htslib that referenced this issue Aug 30, 2019
Fixes samtools#717 and facilitates upcoming hts_detect_format() changes
that will mean it no longer always returns SAM for unknown data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0