prody / ProDy

A Python Package for Protein Dynamics Analysis
http://prody.csb.pitt.edu
Other
420 stars 154 forks source link

How to calculate squared inner product (SIP) in prody? #792

Closed HimiTar closed 5 years ago

HimiTar commented 5 years ago

Hi All

I wanted to know if there is any function (or equivalent) in ProDy to calculate Squared inner product (SIP), which basically gives the similarity between the atomic fluctuations of two proteins? I would like to calculate the correlation between two atomic fluctuation vectors. Any information in this regard will be useful.

SHZ66 commented 5 years ago

Hi, please look into calcSubspaceOverlap in ProDy.

HimiTar commented 5 years ago

Hi Thank you for the reply. If I have understood calcSubspaceOverlap correctly, then it gives the similarities between the modes in terms of direction. Can it be used to report similarities between only the magnitude of fluctuations? I am looking for something equivalent to "sip" function in Bio3D. Kindly excuse if I haven't understood the function rightly.

SHZ66 commented 5 years ago

Sorry, I thought you mean root mean square inner product (RMSIP). I don't think there is a function in ProDy currently for SIP, but it can be calculated fairly easily as

w1 = calcSqFlucts(anm)
w2 = prot.getBetas()

sip = dot(w1, w2)**2 / (dot(w1, w1) * dot(w2, w2))
HimiTar commented 5 years ago

Hi

Thanks a lot for the reply. I guess this is going to be helpful. :-)

jamesmkrieger commented 5 years ago

I have just added pull request #804 with a draft function. This should be able to take in modes or profiles. Please let me know if that satisfies this feature request.

jamesmkrieger commented 5 years ago

I'm assuming everything is fine here and closing this issue. Feel free to re-open it if you have any further comments.