<p>Picard (actually HtsJdk) uses a <a href="https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/util/FormatUtil.java" rel="noreferrer">formatting class</a> (via the <a href="https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/metrics/MetricsFile.java" rel="noreferrer">MetricsFile</a> class) that emits &quot;?&quot; for NaNs (and Infs).</p>
<p>In your case, there seems to be a division-by-zero error during the calculation of the metric (likely due to zero coverage at some small percentage of bases in your input). This resulting Nan is emitted as a &quot;?&quot;.</p>

CC BY-SA 4.0
2024-01-12T00:32:13.627Z
2024-01-12T00:32:13.627Z
Yossi Farjoun
<p>Does anyone know what conditions must be true for Picard to put a <code>?</code> where I expect a number?</p>
<p>Here is an example from the output of the tool <a href="https://gatk.broadinstitute.org/hc/en-us/articles/360036804671-CollectWgsMetrics-Picard-" rel="nofollow noreferrer"><code>CollectWgsMetrics</code></a>:</p>
<pre><code>❯ cat sample.wgs_metrics.txt | head -n8 | tail -n2 | verticalize | grep FOLD
FOLD_80_BASE_PENALTY    1.33476
FOLD_90_BASE_PENALTY    2.288159
FOLD_95_BASE_PENALTY    ?
</code></pre>
<p>Code searching (<a href="https://github.com/search?q=repo%3Abroadinstitute%2Fpicard%20%5C%22%3F%5C%22&amp;type=code" rel="nofollow noreferrer">link</a>) didn't reveal anything, and googling isn't returning anything obvious either.</p>
<hr />
<p><em>[Verticalize is a little CLI tool I've forever been using by Pierre Lindenbaum: <a href="https://github.com/lindenb/verticalize" rel="nofollow noreferrer"><code>verticalize</code></a>. Easy to compile and I toss it in my <code>~/bin</code> every time I get a new computer.]</em></p>

<picard>
What does a question mark ("?") mean in Picard metrics files when I expect a number (integer, float, etc.)
# What does a question mark ("?") mean in Picard metrics files when I expect a number (integer, float, etc.)

(Asked by: username_0 on 2024-01-12)

Does anyone know what conditions must be true for Picard to put a ? where I expect a number?
Here is an example from the output of the tool CollectWgsMetrics:
❯ cat sample.wgs_metrics.txt | head -n8 | tail -n2 | verticalize | grep FOLD
FOLD_80_BASE_PENALTY    1.33476
FOLD_90_BASE_PENALTY    2.288159
FOLD_95_BASE_PENALTY    ?

Code searching (link) didn't reveal anything, and googling isn't returning anything obvious either.

[Verticalize is a little CLI tool I've forever been using by Pierre Lindenbaum: verticalize. Easy to compile and I toss it in my ~/bin every time I get a new computer.]

**Tags:** picard

---

## 1 answers

### Answer by username_1 on 2024-01-12. Score: 5 | Accepted answer

Picard (actually HtsJdk) uses a [formatting class](https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/util/FormatUtil.java) (via the [MetricsFile](https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/metrics/MetricsFile.java) class) that emits "?" for NaNs (and Infs).

In your case, there seems to be a division-by-zero error during the calculation of the metric (likely due to zero coverage at some small percentage of bases in your input). This resulting Nan is emitted as a "?".


---

