Skip to content
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

Fix hts_parse_decimal and make synced BCF targets parsing more robust #1396

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

pd3
Copy link
Member

@pd3 pd3 commented Feb 14, 2022

The function bcf_sr_regions_init() autodetects the format of input regions,
trying to decide between CHR,POS vs CHR,BEG,END formats. However, the function
hts_parse_decimal() was recognising standalone G as 0 which resulted in
chr1 1234 G being interpretted as chr1 1234 0.

This commit makes the digit parsing more strict, requiring at least one digit
to appear before the exponent or unit part.

See also samtools/bcftools#1598

@pd3
Copy link
Member Author

pd3 commented Feb 14, 2022

Whops, did not pass htslib tests...

The function bcf_sr_regions_init() autodetects the format of input regions,
trying to decide between CHR,POS vs CHR,BEG,END formats. However, the function
hts_parse_decimal() was recognising standalone `G` as `0` which resulted in
`chr1 1234 G` being interpretted as `chr1 1234 0`.

This commit makes the digit parsing more strict, requiring at least one digit
to appear before the exponent or unit part.

See also samtools/bcftools#1598
pd3 added a commit to samtools/bcftools that referenced this pull request Feb 14, 2022
Note this fails until samtools/htslib#1396 is merged
@daviesrob daviesrob self-assigned this Feb 15, 2022
@daviesrob daviesrob merged commit 6c1265c into samtools:develop Feb 15, 2022
@pd3 pd3 deleted the bt-1598 branch February 28, 2023 13:39
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

Successfully merging this pull request may close these issues.

2 participants