Beispiel #1
0
 def setParticleParameters(self, idx, params):
     params = copy.deepcopy(params)
     params[self.RADIUS_ARG_POSITION] = strip_unit(
         params[self.RADIUS_ARG_POSITION], u.nanometer) - self.OFFSET
     params[self.SCREEN_POSITION] *= params[self.RADIUS_ARG_POSITION]
     CustomGBForce.addParticle(self, params)
     return params
Beispiel #2
0
def GBSAOBC1Force(solventDielectric=78.5,
                  soluteDielectric=1,
                  SA=None,
                  cutoff=None,
                  kappa=0.0):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or")  # Offset radius
    custom.addPerParticleParameter("sr")  # Scaled offset radius
    custom.addComputedValue(
        "I",
        "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
        "U=r+sr2;"
        "L=max(or1, D);"
        "D=abs(r-sr2)", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue(
        "B", "1/(1/or-tanh(0.8*psi+2.909125*psi^3)/radius);"
        "psi=I*or; radius=or+offset; offset=0.009",
        CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff,
                       kappa, 0.009)
    return custom
Beispiel #3
0
    def __init__(self,
                 solventDielectric=78.5,
                 soluteDielectric=1,
                 SA=None,
                 cutoff=None,
                 kappa=0.0):

        CustomGBForce.__init__(self)

        self.addPerParticleParameter("q")
        self.addPerParticleParameter("or")  # Offset radius
        self.addPerParticleParameter("sr")  # Scaled offset radius
        self.addComputedValue(
            "I",
            "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
            "U=r+sr2;"
            "L=max(or1, D);"
            "D=abs(r-sr2)", CustomGBForce.ParticlePairNoExclusions)

        self.addComputedValue(
            "B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
            "psi=I*or; radius=or+offset; offset=0.009",
            CustomGBForce.SingleParticle)
        _createEnergyTerms(self, solventDielectric, soluteDielectric, SA,
                           cutoff, kappa, 0.009)
Beispiel #4
0
    def __init__(self, solventDielectric=78.5, soluteDielectric=1, SA=None,
                 cutoff=None, kappa=0.0):

        CustomGBForce.__init__(self)

        self.addPerParticleParameter("q")
        self.addPerParticleParameter("or") # Offset radius
        self.addPerParticleParameter("sr") # Scaled offset radius
        self.addPerParticleParameter("alpha")
        self.addPerParticleParameter("beta")
        self.addPerParticleParameter("gamma")

        self.addTabulatedFunction("getd0", Continuous2DFunction(21, 21, d0, 0.1, 0.2, 0.1, 0.2))
        self.addTabulatedFunction("getm0", Continuous2DFunction(21, 21, m0, 0.1, 0.2, 0.1, 0.2))

        self.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                    "Ineck=step(radius1+radius2+neckCut-r)*getm0(radius1,radius2)/(1+100*(r-getd0(radius1,radius2))^2+0.3*1000000*(r-getd0(radius1,radius2))^6);"
                                    "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                    "U=r+sr2;"
                                    "L=max(or1, D);"
                                    "D=abs(r-sr2);"
                                    "radius1=or1+offset; radius2=or2+offset;"
                                    "neckScale=0.826836; neckCut=0.68; offset=0.0195141", CustomGBForce.ParticlePairNoExclusions)

        self.addComputedValue("B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
                                     "psi=I*or; radius=or+offset; offset=0.0195141", CustomGBForce.SingleParticle)
        _createEnergyTerms(self, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.0195141)
Beispiel #5
0
    def __init__(self, solventDielectric=78.5, soluteDielectric=1, SA=None,
                 cutoff=None, kappa=0.0):
        CustomGBForce.__init__(self)

        self.addPerParticleParameter("q")
        self.addPerParticleParameter("or") # Offset radius
        self.addPerParticleParameter("sr") # Scaled offset radius
        self.addComputedValue("I", "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                   "U=r+sr2;"
                                   "L=max(or1, D);"
                                   "D=abs(r-sr2)",
                              CustomGBForce.ParticlePairNoExclusions)

        self.addComputedValue("B", "1/(1/or-I)", CustomGBForce.SingleParticle)
        _createEnergyTerms(self, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.009)
Beispiel #6
0
    def __init__(self, **kwargs):
        CustomGBForce.__init__(self)

        self.addPerParticleParameter("charge")
        self.addPerParticleParameter("radius")
        self.addPerParticleParameter("scale")

        self.offset_terms_single = ("sr=scale*or;"
                                    "or=(radius-OFFSET);"
                                    "OFFSET=%.16f;" % OFFSET)

        self.offset_terms_pair = ("sr1=scale1*or1;"
                                  "or1=(radius1-OFFSET);"
                                  "sr2=scale2*or2;"
                                  "or2=(radius2-OFFSET);"
                                  "OFFSET=%.16f;" % OFFSET)
Beispiel #7
0
def GBSAOBC2Force(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or") # Offset radius
    custom.addPerParticleParameter("sr") # Scaled offset radius
    custom.addComputedValue("I",  "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2)", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
                                 "psi=I*or; radius=or+offset; offset=0.009", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.009)
    return custom
Beispiel #8
0
    def __init__(self,
                 solventDielectric=78.5,
                 soluteDielectric=1,
                 SA=None,
                 cutoff=None,
                 kappa=0.0):

        CustomGBForce.__init__(self)

        self.addPerParticleParameter("q")
        self.addPerParticleParameter("or")  # Offset radius
        self.addPerParticleParameter("sr")  # Scaled offset radius
        self.addPerParticleParameter("alpha")
        self.addPerParticleParameter("beta")
        self.addPerParticleParameter("gamma")

        self.addTabulatedFunction(
            "getd0", Continuous2DFunction(21, 21, d0, 0.1, 0.2, 0.1, 0.2))
        self.addTabulatedFunction(
            "getm0", Continuous2DFunction(21, 21, m0, 0.1, 0.2, 0.1, 0.2))

        self.addComputedValue(
            "I", "Ivdw+neckScale*Ineck;"
            "Ineck=step(radius1+radius2+neckCut-r)*getm0(radius1,radius2)/(1+100*(r-getd0(radius1,radius2))^2+0.3*1000000*(r-getd0(radius1,radius2))^6);"
            "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
            "U=r+sr2;"
            "L=max(or1, D);"
            "D=abs(r-sr2);"
            "radius1=or1+offset; radius2=or2+offset;"
            "neckScale=0.826836; neckCut=0.68; offset=0.0195141",
            CustomGBForce.ParticlePairNoExclusions)

        self.addComputedValue(
            "B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
            "psi=I*or; radius=or+offset; offset=0.0195141",
            CustomGBForce.SingleParticle)
        _createEnergyTerms(self, solventDielectric, soluteDielectric, SA,
                           cutoff, kappa, 0.0195141)
Beispiel #9
0
 def _addParticles(self):
     for p in self.parameters:
         radIndex = self._radiusToIndex[p[self.RADIUS_ARG_POSITION]]
         CustomGBForce.addParticle(self, p + [radIndex])
Beispiel #10
0
 def _addParticles(self):
     for params in self.parameters:
         CustomGBForce.addParticle(self, params)
Beispiel #11
0
 def __init__(self):
     CustomGBForce.__init__(self)
     self.parameters = []
def GBSAOBC1Force(solventDielectric=78.5, soluteDielectric=1, SA=None, cutoff=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I",  "step(r+sr2-or1)*excl*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "excl=step(abs(q1)-0.00000001)*step(abs(q2)-0.00000001);" # exclude pair where one atom is not charged
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(0.8*psi+2.909125*psi^3)/radius);"
                                  "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #13
0
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None):

    
    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """
     
 
    custom = CustomGBForce()

    custom.addPerParticleParameter("q");
    custom.addPerParticleParameter("radius");
    custom.addPerParticleParameter("scale");
    
    custom.addGlobalParameter("solventDielectric", solventDielectric);
    custom.addGlobalParameter("soluteDielectric", soluteDielectric);
    custom.addGlobalParameter("offset", 0.009)
    custom.addGlobalParameter("neckScale", 0.361825)
    custom.addGlobalParameter("neckCut", 0.68)
    
    custom.addFunction("getd0", d0, 0, 440)
    custom.addFunction("getm0", m0, 0, 440)

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)
    
    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
 
    custom.addEnergyTerm("-0.5*138.935485*(1/soluteDielectric-1/solventDielectric)*q^2/B", CustomGBForce.SingleParticle)
    if SA=='ACE':
        custom.addEnergyTerm("28.3919551*(radius+0.14)^2*(radius/B)^6", CustomGBForce.SingleParticle)
    elif SA is not None:
        raise ValueError('Unknown surface area method: '+SA)
    custom.addEnergyTerm("-138.935485*(1/soluteDielectric-1/solventDielectric)*q1*q2/f;"
                           "f=sqrt(r^2+B1*B2*exp(-r^2/(4*B1*B2)))", CustomGBForce.ParticlePairNoExclusions)

    return custom
Beispiel #14
0
def GBSAHCTForce(solventDielectric=78.5, soluteDielectric=1, SA=None, cutoff=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q");
    custom.addPerParticleParameter("radius");
    custom.addPerParticleParameter("scale");
    custom.addGlobalParameter("solventDielectric", solventDielectric);
    custom.addGlobalParameter("soluteDielectric", soluteDielectric);
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I", "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-I);"
                                  "or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #15
0
def GBSAOBC2Force(solventDielectric=78.5, soluteDielectric=1, SA=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q");
    custom.addPerParticleParameter("radius");
    custom.addPerParticleParameter("scale");
    custom.addGlobalParameter("solventDielectric", solventDielectric);
    custom.addGlobalParameter("soluteDielectric", soluteDielectric);
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I",  "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
                                  "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)

    custom.addEnergyTerm("-0.5*138.935485*(1/soluteDielectric-1/solventDielectric)*q^2/B", CustomGBForce.SingleParticle)
    if SA=='ACE':
        custom.addEnergyTerm("28.3919551*(radius+0.14)^2*(radius/B)^6", CustomGBForce.SingleParticle)
    elif SA is not None:
        raise ValueError('Unknown surface area method: '+SA)
    custom.addEnergyTerm("-138.935485*(1/soluteDielectric-1/solventDielectric)*q1*q2/f;"
                           "f=sqrt(r^2+B1*B2*exp(-r^2/(4*B1*B2)))", CustomGBForce.ParticlePairNoExclusions)

    return custom
Beispiel #16
0
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")

    if kappa > 0: custom.addGlobalParameter('kappa', kappa)
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addGlobalParameter("neckScale", 0.361825)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addTabulatedFunction("getd0", Discrete1DFunction(d0))
    custom.addTabulatedFunction("getm0", Discrete1DFunction(m0))

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff, kappa)
    return custom
Beispiel #17
0
def GBSAOBC2Force(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    if kappa > 0: custom.addGlobalParameter('kappa', kappa)
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I",  "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
                                  "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff, kappa)
    return custom
Beispiel #18
0
def GBSAGBn2Force(solventDielectric=78.5,
                  soluteDielectric=1,
                  SA=None,
                  cutoff=None,
                  kappa=0.0):
    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or")  # Offset radius
    custom.addPerParticleParameter("sr")  # Scaled offset radius
    custom.addPerParticleParameter("alpha")
    custom.addPerParticleParameter("beta")
    custom.addPerParticleParameter("gamma")

    custom.addTabulatedFunction(
        "getd0", Continuous2DFunction(21, 21, d0, 0.1, 0.2, 0.1, 0.2))
    custom.addTabulatedFunction(
        "getm0", Continuous2DFunction(21, 21, m0, 0.1, 0.2, 0.1, 0.2))

    custom.addComputedValue(
        "I", "Ivdw+neckScale*Ineck;"
        "Ineck=step(radius1+radius2+neckCut-r)*getm0(radius1,radius2)/(1+100*(r-getd0(radius1,radius2))^2+0.3*1000000*(r-getd0(radius1,radius2))^6);"
        "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
        "U=r+sr2;"
        "L=max(or1, D);"
        "D=abs(r-sr2);"
        "radius1=or1+offset; radius2=or2+offset;"
        "neckScale=0.826836; neckCut=0.68; offset=0.0195141",
        CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue(
        "B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
        "psi=I*or; radius=or+offset; offset=0.0195141",
        CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff,
                       kappa, 0.0195141)
    return custom
Beispiel #19
0
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q");
    custom.addPerParticleParameter("radius");
    custom.addPerParticleParameter("scale");

    custom.addGlobalParameter("solventDielectric", solventDielectric);
    custom.addGlobalParameter("soluteDielectric", soluteDielectric);
    custom.addGlobalParameter("offset", 0.009)
    custom.addGlobalParameter("neckScale", 0.361825)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addFunction("getd0", d0, 0, 440)
    custom.addFunction("getm0", m0, 0, 440)

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)

    custom.addEnergyTerm("-0.5*138.935485*(1/soluteDielectric-1/solventDielectric)*q^2/B", CustomGBForce.SingleParticle)
    if SA=='ACE':
        custom.addEnergyTerm("28.3919551*(radius+0.14)^2*(radius/B)^6", CustomGBForce.SingleParticle)
    elif SA is not None:
        raise ValueError('Unknown surface area method: '+SA)
    custom.addEnergyTerm("-138.935485*(1/soluteDielectric-1/solventDielectric)*q1*q2/f;"
                           "f=sqrt(r^2+B1*B2*exp(-r^2/(4*B1*B2)))", CustomGBForce.ParticlePairNoExclusions)

    return custom
Beispiel #20
0
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or") # Offset radius
    custom.addPerParticleParameter("sr") # Scaled offset radius

    custom.addTabulatedFunction("getd0", Discrete1DFunction(d0))
    custom.addTabulatedFunction("getm0", Discrete1DFunction(m0))

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "radius1=or1+offset; radius2=or2+offset;"
                                  "neckScale=0.361825; neckCut=0.68; offset=0.009", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; radius=or+offset; offset=0.009", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.009)
    return custom
Beispiel #21
0
def GBSAOBC2Force(solventDielectric=78.5,
                  soluteDielectric=1,
                  SA=None,
                  cutoff=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue(
        "I",
        "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
        "U=r+sr2;"
        "L=max(or1, D);"
        "D=abs(r-sr2);"
        "sr2 = scale2*or2;"
        "or1 = radius1-offset; or2 = radius2-offset",
        CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue(
        "B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
        "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #22
0
def GBSAGBn2Force(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or") # Offset radius
    custom.addPerParticleParameter("sr") # Scaled offset radius
    custom.addPerParticleParameter("alpha")
    custom.addPerParticleParameter("beta")
    custom.addPerParticleParameter("gamma")

    custom.addTabulatedFunction("getd0", Continuous2DFunction(21, 21, d0, 0.1, 0.2, 0.1, 0.2))
    custom.addTabulatedFunction("getm0", Continuous2DFunction(21, 21, m0, 0.1, 0.2, 0.1, 0.2))

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(radius1,radius2)/(1+100*(r-getd0(radius1,radius2))^2+0.3*1000000*(r-getd0(radius1,radius2))^6);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "radius1=or1+offset; radius2=or2+offset;"
                                  "neckScale=0.826836; neckCut=0.68; offset=0.0195141", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
                                 "psi=I*or; radius=or+offset; offset=0.0195141", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.0195141)
    return custom
Beispiel #23
0
 def _addParticles(self):
     for params in self.parameters:
         CustomGBForce.addParticle(self, params)
Beispiel #24
0
 def _addParticles(self):
     for p in self.parameters:
         radIndex = self._radiusToIndex[p[self.RADIUS_ARG_POSITION]]
         CustomGBForce.addParticle(self, p + [radIndex])
def GBSAHCTForce(solventDielectric=78.5, soluteDielectric=1, SA=None, cutoff=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I", "step(r+sr2-or1)*excl*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "excl=step(abs(q1)-0.00000001)*step(abs(q2)-0.00000001);" # exclude pair where one atom is not charged
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-I);"
                                  "or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #26
0
 def setParticleParameters(self, idx, params):
     params = copy.deepcopy(params)
     params[self.RADIUS_ARG_POSITION] = strip_unit(params[self.RADIUS_ARG_POSITION], u.nanometer) - self.OFFSET
     params[self.SCREEN_POSITION] *= params[self.RADIUS_ARG_POSITION]
     CustomGBForce.addParticle(self, params)
     return params
Beispiel #27
0
def GBSAOBC2Force(solventDielectric=78.5, soluteDielectric=1, SA=None):

    custom = CustomGBForce()

    custom.addPerParticleParameter("q");
    custom.addPerParticleParameter("radius");
    custom.addPerParticleParameter("scale");
    custom.addGlobalParameter("solventDielectric", solventDielectric);
    custom.addGlobalParameter("soluteDielectric", soluteDielectric);
    custom.addGlobalParameter("offset", 0.009)
    custom.addComputedValue("I",  "step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(psi-0.8*psi^2+4.85*psi^3)/radius);"
                                  "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)

    custom.addEnergyTerm("-0.5*138.935485*(1/soluteDielectric-1/solventDielectric)*q^2/B", CustomGBForce.SingleParticle)
    if SA=='ACE':
        custom.addEnergyTerm("28.3919551*(radius+0.14)^2*(radius/B)^6", CustomGBForce.SingleParticle)
    elif SA is not None:
        raise ValueError('Unknown surface area method: '+SA)
    custom.addEnergyTerm("-138.935485*(1/soluteDielectric-1/solventDielectric)*q1*q2/f;"
                           "f=sqrt(r^2+B1*B2*exp(-r^2/(4*B1*B2)))", CustomGBForce.ParticlePairNoExclusions)

    return custom
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None, cutoff=None):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")

    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.009)
    custom.addGlobalParameter("neckScale", 0.361825)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addFunction("getd0", d0, 0, 440)
    custom.addFunction("getm0", m0, 0, 440)

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*excl*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "excl=step(abs(q1)-0.00000001)*step(abs(q2)-0.00000001);" # exclude pair where one atom is not charged
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
def GBSAGBn2Force(solventDielectric=78.5, soluteDielectric=1, SA=None, cutoff=None):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addPerParticleParameter("alpha")
    custom.addPerParticleParameter("beta")
    custom.addPerParticleParameter("gamma")

    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.0195141)
    custom.addGlobalParameter("neckScale", 0.826836)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addFunction("getd0", d0, 0, 440)
    custom.addFunction("getm0", m0, 0, 440)

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*excl*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "excl=step(abs(q1)-0.00000001)*step(abs(q2)-0.00000001);" # exclude pair where one atom is not charged
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #30
0
def GBSAGBn2Force(solventDielectric=78.5,
                  soluteDielectric=1,
                  SA=None,
                  cutoff=None):
    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """

    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addPerParticleParameter("alpha")
    custom.addPerParticleParameter("beta")
    custom.addPerParticleParameter("gamma")

    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.0195141)
    custom.addGlobalParameter("neckScale", 0.826836)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addFunction("getd0", d0, 0, 440)
    custom.addFunction("getm0", m0, 0, 440)

    custom.addComputedValue(
        "I", "Ivdw+neckScale*Ineck;"
        "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
        "index = (radius2*200-20)*21 + (radius1*200-20);"
        "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
        "U=r+sr2;"
        "L=max(or1, D);"
        "D=abs(r-sr2);"
        "sr2 = scale2*or2;"
        "or1 = radius1-offset; or2 = radius2-offset",
        CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue(
        "B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
        "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff)
    return custom
Beispiel #31
0
 def __init__(self):
     CustomGBForce.__init__(self)
     self.parameters = []