Commit 7f465557 by Mustafa Tekpinar

Final version of Bfactor incorporation.

parent ddc80a51
......@@ -76,9 +76,11 @@ def calcPercentDFI(pdbfile, outfile, nmodes=None, attenuate="true", ranksorted="
else:
return dfi
def calcBfactors(pdbfile, outfile, nmodes=None, attenuate="true", ranksorted="true"):
def calcBfactors(pdbfile, outfile, nmodes=None, attenuate="true",
ranksorted="true", inverted=False):
"""
Calculate rank normalized dynamic flexibility index.
Calculate rank normalized mean squared fluctuations,
which correlate well with Bfactors.
"""
#confProDy(auto_show=False)
......@@ -106,8 +108,14 @@ def calcBfactors(pdbfile, outfile, nmodes=None, attenuate="true", ranksorted="tr
# np.savetxt(outfile, dfi)
if(ranksorted.lower()=='true'):
if(inverted==True):
return (1.0 - percentBfactors)
else:
return percentBfactors
else:
if(inverted==True):
return (np.max(bfactors) - bfactors)
else:
return bfactors
def getBfactors(pdbfile, outfile, nmodes=None, attenuate="true", ranksorted="true"):
......@@ -553,10 +561,12 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
print("ERROR: There is not any pdb file to calculate or get Bfactors!")
sys.exit(-1)
else:
print("Calculating or getting Bfactor data per residue!")
if (isCalc):
bfactors = calcBfactors(pdbfile, outfile=None, nmodes=None, attenuate="true", ranksorted="true")
print("Computing Bfactors from the user-provided pdb file using ANM with all modes.")
bfactors = calcBfactors(pdbfile, outfile=None, nmodes=None, \
attenuate="true", ranksorted="true", inverted=False)
else:
print("Getting Bfactors from the user-provided pdb file.")
bfactors = getBfactors(pdbfile, outfile=None, nmodes=None, attenuate="true", ranksorted="true")
bfactors = bfactors
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment