the -d and -D options of samtools view currently handle only tags of type string, as evidenced by the following code:
|
if (settings->tvhash && settings->tag) { |
|
uint8_t *s = bam_aux_get(b, settings->tag); |
|
if (s) { |
|
khint_t k = kh_get(tv, settings->tvhash, (char*)(s + 1)); |
|
if (k == kh_end(settings->tvhash)) return 1; |
|
} else { |
|
return 1; |
|
} |
|
} |
It would be nice if those options could also handle tags of type integer.
For example, the following mods allowed me to use option -D with a file containing 1651 integers:
if (settings->tvhash && settings->tag) {
uint8_t *s = bam_aux_get(b, settings->tag);
if (s) {
uint8_t t[24];
khint_t k;
if (*s=='i') { sprintf((char*)t,"%ld",bam_aux2i(s)); s=t; } else ++s;
k = kh_get(tv, settings->tvhash, (char*)s);
if (k == kh_end(settings->tvhash)) return 1;
} else {
return 1;
}
}
Otherwise, the man page should state that the -d and -D options can only handle tags of type string.
the -d and -D options of samtools view currently handle only tags of type string, as evidenced by the following code:
samtools/sam_view.c
Lines 104 to 112 in d58fc8a
It would be nice if those options could also handle tags of type integer.
For example, the following mods allowed me to use option -D with a file containing 1651 integers:
Otherwise, the man page should state that the -d and -D options can only handle tags of type string.