According to [wikipedia][1], **sensitivity** and **specificity** are defined as:

![sensitivity formula][2]

![specificity formula][3]

However, in [cuffcompare][4], the values are calculated as:

```
sp=(100.0*(double)ps->exonTP)/(ps->exonTP+ps->exonFP);
sn=(100.0*(double)ps->exonTP)/(ps->exonTP+ps->exonFN);
```

`sn` is sensitivity and `sp` is specificity.

The formulas don't match, in particular **true-positive (exonTP)** is now used in both formulas. Does anybody know why?

 [1]: https://en.wikipedia.org/wiki/Sensitivity_and_specificity
 [2]: https://upload.wikimedia.org/math/1/3/4/13435a42931645fb999e06c9d62629f6.png
 [3]: https://upload.wikimedia.org/math/b/6/2/b62ae9edff0202210dde58500b1eb7f8.png
 [4]: https://github.com/cole-trapnell-lab/cufflinks/blob/master/src/cuffcompare.cpp
That was explained in [their paper][1].

In this context, we are measuring the accuracy at the base level. In the base level, we will have significantly more noncoding bases than coding bases. Therefore, TN will be much larger than FP. Therefore, SPC (specificity) will tend to be close to one and not very suitable as a metric. To fix the issue, cufflinks prefers another formula:

    sp=(100.0*(double)ps->exonTP)/(ps->exonTP+ps->exonFP);

It is important to note that cufflinks is not not calculating specificity anymore. Instead, we are getting the **prediction accuracy** of the experiment. It is a technical mistake that cufflinks should fix. They should never claim it's specificity when it's not.

 [1]: http://www.sciencedirect.com/science/article/pii/S0888754396902980