Exemplo n.º 1
0
def stm(config, inp: str, origin: int, partner: int, out: click.File):
    """Calculate sterimol descriptors using kallisto van der Waals radii."""

    # setup molecular structure
    mol = ksr.constructMolecule(geometry=inp, out=out)

    # calculate Sterimol descriptors: L, bmin, bmax
    from kallisto.sterics import getClassicalSterimol

    L, bmin, bmax = getClassicalSterimol(mol, origin, partner)

    if config.verbose:
        # print values in Bohr
        verbosePrinter(
            config.verbose,
            "L, Bmin, Bmax / au: {:5.2f} {:5.2f} {:5.2f}".format(
                L, bmin, bmax),
            out,
        )

        # print values in Angstrom
        from kallisto.units import Bohr

        verbosePrinter(
            config.verbose,
            "L, Bmin, Bmax / A: {:5.2f} {:5.2f} {:5.2f}".format(
                L * Bohr, bmin * Bohr, bmax * Bohr),
            out,
        )

    return L, bmin, bmax
Exemplo n.º 2
0
def test_stm():
    mol = toluene()
    origin = 6
    partner = 5
    L, bmin, bmax = getClassicalSterimol(mol, origin, partner)
    assert np.isclose(L, 12.714385)
    assert np.isclose(bmin, 3.539068)
    assert np.isclose(bmax, 6.640342)
Exemplo n.º 3
0
def test_stm():
    mol = toluene()
    origin = 6
    partner = 5
    L, bmin, bmax = getClassicalSterimol(mol, origin, partner)
    assert (L - 12.714385) < epsilon
    assert (bmin - 3.539068) < epsilon
    assert (bmax - 6.640342) < epsilon
Exemplo n.º 4
0
def stm(config, inp: str, origin: int, partner: int, out: click.File):
    """Calculate sterimol descriptors using kallisto van der Waals radii."""

    # setup molecular structure
    mol = ksr.constructMolecule(geometry=inp, out=out)

    # calculate Sterimol descriptors: L, bmin, bmax
    from kallisto.sterics import getClassicalSterimol

    L, bmin, bmax = getClassicalSterimol(mol, origin, partner)

    # print origin and partner
    silentPrinter(
        config.silent,
        "Calculated for atom {0} (origin) and atom {1} (partner)".format(
            origin, partner
        ),
        out,
    )

    # descriptors in Bohr
    silentPrinter(
        config.silent,
        "L, Bmin, Bmax / au: {:8.6f} {:8.6f} {:8.6f}".format(L, bmin, bmax),
        out,
    )

    # descriptors in Angstrom
    from kallisto.units import Bohr

    silentPrinter(
        config.silent,
        "L, Bmin, Bmax / A: {:8.6f} {:8.6f} {:8.6f}".format(
            L * Bohr, bmin * Bohr, bmax * Bohr
        ),
        out,
    )

    return L, bmin, bmax