<ol>
<li>An example would be <code>ZC:B:i,271,271,1,0</code>, which is from TMAP. The <code>i</code> part denotes the values held in the array, which are comma-separated.</li>
<li>That code is only used in <code>samtools fastq</code>, where that tag type isn't output into fastq files.</li>
</ol>

CC BY-SA 3.0
2018-04-25T00:53:16.943Z
Thanks for the help. "which is from TMAP"---where did you find this?
EB2127
CC BY-SA 3.0
2018-04-25T05:20:22.427Z
Also, how command is this tag? I don't think I've seen this type of tag "in the wild" in any BAM files....though perhaps I'm very wrong.
EB2127
CC BY-SA 3.0
2018-04-25T06:38:04.307Z
That particular example can be found [here](https://wabi-wiki.scilifelab.se/display/KB/TMAP). You don't see tags like this that frequently, I had to search for a concrete example since I don't recall seeing any locally in a few years.
Devon Ryan
CC BY-SA 3.0
2018-04-25T17:38:20.950Z
Last questions: (1) I haven't seen this either. Is there any evidence that this tag format has largely been abandoned in recent years? (2) Is there a reason why the tag isn't output into FASTQ files?
EB2127
CC BY-SA 3.0
2018-04-25T21:57:16.520Z
That's used under the hood if you have more than 65535 CIGAR operations, but otherwise hasn't really seen wide-spread use. I guess no one ever saw the point in outputting that in fastq files. Presumably someone could make a PR to add it.
Devon Ryan
CC BY-SA 3.0
2018-04-26T20:04:56.157Z
"if you have more than 65535 CIGAR operations" Could you detail this a bit more?
EB2127
CC BY-SA 3.0
2018-04-26T20:37:39.530Z
I'm not sure what there is to detail there. Really long noisy reads can result in a lot of CIGAR operations, which exceed the bounds of the actual CIGAR field in a BAM file. Thus the `CG` auxiliary tag, which is also an array at its core.
Devon Ryan
CC BY-SA 3.0
2018-05-01T16:50:56.970Z
Thank you. I just needed a further clarification. I think I understand now, thank you
EB2127
CC BY-SA 3.0
2018-04-24T19:43:54.937Z
2018-04-24T19:43:54.937Z
Devon Ryan
<p>The SAM file format specification makes clear that optional fields must follow the format <code>TAG:TYPE:VALUE</code></p>

<pre><code>Type   Regexp matching                                       VALUE Description
A     [!-~]                                                  Printable character
i     [-+]?[0-9]+                                            Signed integer
f     [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?                 Single-precision floating number
Z     [ !-~]*                                                Printable string, including space
H     ([0-9A-F][0-9A-F])*                                    Byte array in the Hex format10
B     [cCsSiIf](,[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+    Integer or numeric array
</code></pre>

<p>However, looking at the samtools source code, I noticed this:</p>

<p><a href="https://github.com/samtools/samtools/blob/develop/sam_view.c#L920-L931" rel="nofollow noreferrer">https://github.com/samtools/samtools/blob/develop/sam_view.c#L920-L931</a></p>

<pre><code>switch (aux_type) {
    case 'H':
    case 'Z':
        if (kputs(bam_aux2Z(s), linebuf) &lt; 0) return false;
        break;
    case 'i': kputw(bam_aux2i(s), linebuf); break;
    case 'I': kputuw(bam_aux2i(s), linebuf); break;
    case 'A': kputc(bam_aux2A(s), linebuf); break;
    case 'f': kputd(bam_aux2f(s), linebuf); break;
    case 'B': kputs("*** Unhandled aux type ***", linebuf); return false;
    default:  kputs("*** Unknown aux type ***", linebuf); return false;
}
</code></pre>

<p>Questions:</p>

<p>(1) I have never seen an "Integer or numeric array" of <code>case "B"</code>. What does such an tag look like? Is there an example? </p>

<p>(2) Why is this currently <code>"*** Unhandled aux type ***"</code>? Was this the case with previous versions of samtools?</p>

<sam><samtools><htslib>
SAM format: Does the BAM "Integer or numeric array" field no longer exist? Why?
# SAM format: Does the BAM "Integer or numeric array" field no longer exist? Why?

(Asked by: username_0 on 2018-04-24)

The SAM file format specification makes clear that optional fields must follow the format TAG:TYPE:VALUE
Type   Regexp matching                                       VALUE Description
A     [!-~]                                                  Printable character
i     [-+]?[0-9]+                                            Signed integer
f     [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?                 Single-precision floating number
Z     [ !-~]*                                                Printable string, including space
H     ([0-9A-F][0-9A-F])*                                    Byte array in the Hex format10
B     [cCsSiIf](,[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+    Integer or numeric array

However, looking at the samtools source code, I noticed this:
https://github.com/samtools/samtools/blob/develop/sam_view.c#L920-L931
switch (aux_type) {
    case 'H':
    case 'Z':
        if (kputs(bam_aux2Z(s), linebuf) < 0) return false;
        break;
    case 'i': kputw(bam_aux2i(s), linebuf); break;
    case 'I': kputuw(bam_aux2i(s), linebuf); break;
    case 'A': kputc(bam_aux2A(s), linebuf); break;
    case 'f': kputd(bam_aux2f(s), linebuf); break;
    case 'B': kputs("*** Unhandled aux type ***", linebuf); return false;
    default:  kputs("*** Unknown aux type ***", linebuf); return false;
}

Questions:
(1) I have never seen an "Integer or numeric array" of case "B". What does such an tag look like? Is there an example? 
(2) Why is this currently "*** Unhandled aux type ***"? Was this the case with previous versions of samtools?

**Tags:** sam, samtools, htslib

---

## 1 answers

### Answer by username_1 on 2018-04-24. Score: 3 | Accepted answer

1. An example would be `ZC:B:i,271,271,1,0`, which is from TMAP. The `i` part denotes the values held in the array, which are comma-separated.
2. That code is only used in `samtools fastq`, where that tag type isn't output into fastq files.

> **Comments:**
> **username_0**: Thanks for the help. "which is from TMAP"---where did you find this?  
> **username_0**: Also, how command is this tag? I don't think I've seen this type of tag "in the wild" in any BAM files....though perhaps I'm very wrong.  
> **username_1**: That particular example can be found [here](https://wabi-wiki.scilifelab.se/display/KB/TMAP). You don't see tags like this that frequently, I had to search for a concrete example since I don't recall seeing any locally in a few years.  
> **username_0**: Last questions: (1) I haven't seen this either. Is there any evidence that this tag format has largely been abandoned in recent years? (2) Is there a reason why the tag isn't output into FASTQ files?  
> **username_1**: That's used under the hood if you have more than 65535 CIGAR operations, but otherwise hasn't really seen wide-spread use. I guess no one ever saw the point in outputting that in fastq files. Presumably someone could make a PR to add it.  
> **username_0**: "if you have more than 65535 CIGAR operations" Could you detail this a bit more?  
> **username_1**: I'm not sure what there is to detail there. Really long noisy reads can result in a lot of CIGAR operations, which exceed the bounds of the actual CIGAR field in a BAM file. Thus the `CG` auxiliary tag, which is also an array at its core.  
> **username_0**: Thank you. I just needed a further clarification. I think I understand now, thank you  

---

