if (type == 'C' || type == 'A') ++s;
else if (type == 'S') { bam_swap_endian_2p(s); s += 2; }
else if (type == 'I' || type == 'F') { bam_swap_endian_4p(s); s += 4; }
+ else if (type == 'D') { bam_swap_endian_8p(s); s += 8; }
else if (type == 'Z' || type == 'H') { while (*s) ++s; ++s; }
}
}
printf("%d\t%d\t", c->mpos + 1, c->isize);
for (i = 0; i < c->l_qseq; ++i) putchar(bam_nt16_rev_table[bam1_seqi(s, i)]);
putchar('\t');
- for (i = 0; i < c->l_qseq; ++i) putchar(t[i] + 33);
+ if (t[0] == 0xff) putchar('*');
+ else for (i = 0; i < c->l_qseq; ++i) putchar(t[i] + 33);
s = bam1_aux(b);
while (s < b->data + b->data_len) {
uint8_t type, key[2];
else if (type == 'I') { printf("i:%u", *(uint32_t*)s); s += 4; }
else if (type == 'i') { printf("i:%d", *(int32_t*)s); s += 4; }
else if (type == 'f') { printf("f:%g", *(float*)s); s += 4; }
+ else if (type == 'd') { printf("d:%lg", *(double*)s); s += 8; }
else if (type == 'Z' || type == 'H') { printf("%c:", type); while (*s) putchar(*s++); ++s; }
}
putchar('\n');
for (i = 0; i < c->l_qseq; ++i)
p[i/2] |= bam_nt16_table[(int)str->s[i]] << 4*(1-i%2);
if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -6; // qual
- if (c->l_qseq != strlen(str->s))
+ if (strcmp(str->s, "*") && c->l_qseq != strlen(str->s))
parse_error(fp->n_lines, "sequence and quality are inconsistent");
p += (c->l_qseq+1)/2;
- for (i = 0; i < c->l_qseq; ++i) p[i] = str->s[i] - 33;
+ if (strcmp(str->s, "*") == 0) for (i = 0; i < c->l_qseq; ++i) p[i] = 0xff;
+ else for (i = 0; i < c->l_qseq; ++i) p[i] = str->s[i] - 33;
doff += c->l_qseq + (c->l_qseq+1)/2;
}
doff0 = doff;
*s++ = 'f';
*(float*)s = (float)atof(str->s + 5);
s += 4; doff += 5;
+ } else if (type == 'd') {
+ s = alloc_data(b, doff + 9) + doff;
+ *s++ = 'd';
+ *(float*)s = (float)atof(str->s + 9);
+ s += 8; doff += 9;
} else if (type == 'Z' || type == 'H') {
int size = 1 + (str->l - 5) + 1;
if (type == 'H') { // check whether the hex string is valid
#include "bam.h"
#ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.2-22"
+#define PACKAGE_VERSION "0.1.2-23"
#endif
int bam_taf2baf(int argc, char *argv[]);