# TRANSFAC Matrix.dat retrieve count matrix using BA or CC field

In the TRANSFAC Matrix.dat most of the motifs are given in the form of count matrix, but a few of them are given as some kind of frequency matrix. Those aren't ordinary PWMs because rows don't sum to 1, but these sums are more or less stable across rows.

I would like to have a raw count matrix in all cases, so I trying to retrieve the count matrix from those several "fractional" cases.

At first I thought that the field BA (Basis - statistical basis of the matrix) MANDATORILY starts with a number of sequences actually used in the matrix, so I would be able to simply multiply:

$$\frac{\text{nucleotide value}}{\text{row sum}} \times \text{number of sequences from BA}$$

Moreover, sometimes in CC field there's information like: core from: 11

Unfortunately, the results are not very close to integer value, so this cannot be explained by rounding errors.

For example, in a certain row we have (btw, the row sum is $10.73$ from rounding errors):

3.99 4.07 0.87 1.8

BA 17 compiled ... sequences; total weight of sequences: 10.74

CC core from: 11, length: 6

$$\frac{4.07}{10.74} \times 17 = 6.4423$$

$$\frac{4.07}{10.74} \times 11 = 4.1685$$

In my opinion these values $0.44$ or $0.16$ couldn't be explained by rounding errors. There's no description (link to article) enclosed to this motif. That aren't log-odds because all of them are non-negative values.

In this particular case, if I use the formula $count(x) = round( (\frac{x}{10.74}) \times 11 )$, the resulting counts will sum up to $11$, so it's fine. This method with value $11$ replaced by $17$ doesn't result in set of values summing to $17$, but $16$.

The problem is that in another example I have

BA 17 compiled binding sequences; total weight of equences: 12.86

CC core from: 1, length: 4 In this case I should rather multiply by $17$ not $1$ to get the sum of $17$. As you see, I cannot stick to either BA or CC for all such motifs.

How would you retrieve the raw count matrix in a such case and what could be the problem in my approach? (jumping between BA and CC values)

Could anyone explain how those values in matrix have been derived, is it some kind of log-odds?