You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
failure to parse mulitple regions passed with -r #309
This is fallout from samtools/htslib#171, in particular that it makes hts_parse_decimal() match hts_parse_reg() in allowing commas as thousands-separators. This of course conflicts with _regions_init_string()'s use of commas for a list. Alas…
You can work around it with -r 1:74941293.,1:169676486 as the comma is only used as a thousands-separator before a decimal point. But it would be good to come up with a better solution to this conflict.
This is unfortunate. Having syntax (like , lists) inside option arguments is not very Unixy, and the problems like this that it leads to is why. More Unixy would be to have -r able to be given multiple times, so you could write this as
but that would require changes to the argument parsing of every bcftools command that has this -r option.
To fix the regression and make the existing -r 1:74941293,1:169676486 usage work the same way as previously, probably the answer is to give functions like _regions_init_string() that have their own designs on commas a way to tell hts_parse_decimal() not to parse them itself. See the proposed HTS_PARSE_* htslib change to do this.
The thousands separating commas are unfortunately ambiguous: -r 1:1,123 can be interpreted as -r 1:1123 but also as -r 1:1 -r 123.
Putting aside the question of what is UNIXy (see for example cut) and ignoring for a moment backward compatibility, it would be quite inconvenient to write -r 1 -r 2 -r 3 -r 4 instead of the current -r 1,2,3,4. Note also that comma is used as a list separator also in other contexts, for example when giving lists of samples.
The user convenience of allowing commas as thousands separators is in practice less useful than passing multiple regions at once.
Doesn't this mean that bcftools doesn't adhere to the SAM specification though, as comma is a legal character in sample names? I think this boat has perhaps already sailed :(
Activity
jmarshall commentedon Aug 25, 2015
This is fallout from samtools/htslib#171, in particular that it makes
hts_parse_decimal()matchhts_parse_reg()in allowing commas as thousands-separators. This of course conflicts with_regions_init_string()'s use of commas for a list. Alas…You can work around it with
-r 1:74941293.,1:169676486as the comma is only used as a thousands-separator before a decimal point. But it would be good to come up with a better solution to this conflict.jmarshall commentedon Aug 26, 2015
This is unfortunate. Having syntax (like
,lists) inside option arguments is not very Unixy, and the problems like this that it leads to is why. More Unixy would be to have-rable to be given multiple times, so you could write this asbut that would require changes to the argument parsing of every bcftools command that has this
-roption.To fix the regression and make the existing
-r 1:74941293,1:169676486usage work the same way as previously, probably the answer is to give functions like_regions_init_string()that have their own designs on commas a way to tellhts_parse_decimal()not to parse them itself. See the proposed HTS_PARSE_* htslib change to do this.pd3 commentedon Aug 26, 2015
The thousands separating commas are unfortunately ambiguous:
-r 1:1,123can be interpreted as-r 1:1123but also as-r 1:1 -r 123.Putting aside the question of what is UNIXy (see for example
cut) and ignoring for a moment backward compatibility, it would be quite inconvenient to write-r 1 -r 2 -r 3 -r 4instead of the current-r 1,2,3,4. Note also that comma is used as a list separator also in other contexts, for example when giving lists of samples.The user convenience of allowing commas as thousands separators is in practice less useful than passing multiple regions at once.
jkbonfield commentedon Aug 26, 2015
Doesn't this mean that bcftools doesn't adhere to the SAM specification though, as comma is a legal character in sample names? I think this boat has perhaps already sailed :(
pd3 commentedon Aug 26, 2015
Yes, bcftools does not support commas in sequence names.
Add hts_parse_decimal() flags parameter and HTS_PARSE_THOUSANDS_SEP
Add hts_parse_decimal() flags parameter and HTS_PARSE_THOUSANDS_SEP