Source code for ccpn.AnalysisStructure.lib.DistanceRestraint

#=========================================================================================
# Licence, Reference and Credits
#=========================================================================================
__copyright__ = "Copyright (C) CCPN project (http://www.ccpn.ac.uk) 2014 - 2021"
__credits__ = ("Ed Brooksbank, Luca Mureddu, Timothy J Ragan & Geerten W Vuister")
__licence__ = ("CCPN licence. See http://www.ccpn.ac.uk/v3-software/downloads/license")
__reference__ = ("Skinner, S.P., Fogh, R.H., Boucher, W., Ragan, T.J., Mureddu, L.G., & Vuister, G.W.",
                 "CcpNmr AnalysisAssign: a flexible platform for integrated NMR analysis",
                 "J.Biomol.Nmr (2016), 66, 111-124, http://doi.org/10.1007/s10858-016-0060-y")
#=========================================================================================
# Last code modification
#=========================================================================================
__modifiedBy__ = "$modifiedBy: Luca Mureddu $"
__dateModified__ = "$dateModified: 2021-02-23 15:44:32 +0000 (Tue, February 23, 2021) $"
__version__ = "$Revision: 3.0.3 $"
#=========================================================================================
# Created
#=========================================================================================
__author__ = "$Author: Luca Mureddu $"
__date__ = "$Date: 2021-02-22 15:44:00 +0000 (Mon, February 22, 2021) $"
#=========================================================================================
# Start of code
#=========================================================================================

import numpy as np
from ccpn.util.Logging import getLogger

[docs]def getNoeDistance(intensity, refDist=3.2, absMin=1.72, absMax=8.0, power=6): """ :param intensity: :param refDist: :param absMin: :param absMax: :param power: :return: """ dist = refDist / (abs(intensity) ** (1 / power)) dist = max(min(dist, absMax), absMin) return dist
[docs]def getMinMaxNoeDistances(noeDistance, absMin=1.72, absMax=8.0, negError=0.2, posError=0.2): """ :param noeDistance: float. calculated as in getNoeDistance :param absMin: :param absMax: :param negError: :param posError: :return: """ minDistance = max(absMin, noeDistance - (negError * noeDistance)) maxDistance = min(absMax, noeDistance + (posError * noeDistance)) return minDistance, maxDistance