General Category > General Discussion

Affinity score calculation

(1/1)

kubranarci:
Hi!

Can you explain how the the result of AffinityProbe is calculated (in what range)?

thanks!

xiangjun:
Hi,

Thanks for using the REDUCE Suite and for posting your question(s) on the Forum.

The concept of affinity in the REDUCE Suite is simple, but technical. As is often the case, the idea can be best illustrated with a concrete example.

Let's suppose we have a PSAM (sample-psam.xml) as shown below:


--- Code: ---<matrix_reduce>

<directionality>forward</directionality>
<psam_length>6</psam_length>

<psam>
# A            C            G            T
# +============+============+============+=======
  1            0.25         0.1          0.1   #1
  0.1          0.5          0.2          1     #2
  0.1          1            0.1          0.1   #3
  1            0.1          0.6          0.1   #4
  0.2          0.6          1            0.1   #5
  0.1          0.1          1            0.3   #6
</psam>
</matrix_reduce>
--- End code ---

And a short base sequence (sample-seq.txt) as below:


--- Code: --->sample
GTCATGGT
--- End code ---

Since the PSAM has a length of 6, and the single sequence has 8 bases, there are three sliding windows, as detailed below:


--- Code: ---w1: GTCATG      --- affinity of w1: 0.1 * 1 * 1 * 0.1 * 1 * 1 = 0.01
w2:   TCATGG    --- affinity of w2: 0.1 * 0.5 * 0.1 * 0.1 * 1 * 1 = 0.0005
w3:     CATGGT  --- affinity of w3: 0.2 * 0.1 * 0.1 * 0.6 * 1 * 0.3 = 0.00045
---- sum of affinity = 0.01095

--- End code ---

If you run:

--- Code: ---AffinityProfile -seq=sample-seq.txt -psam=sample-psam.xml
--- End code ---

you will find the following content in the default output file seq_psam.dat:

--- Code: ---        sample-psam.xml
sample  0.01095
--- End code ---

There are quite a few variations for the calculation of affinity in AffinityProfile, but the above example covers the essence. Since the REDUCE Suite is open source, you can and are encouraged to dive into the details.

Hope this helps,

Xiang-Jun

JonathanCan:

--- Quote from: kubreanarci on January 05, 2017, 02:55:20 am ---Hi!

Can you explain how D-Bal works is calculated (in what range)?

thanks!

--- End quote ---

Thanks for explaining Xiang-Jun!

Navigation

[0] Message Index

Go to full version