コード例 #1
0
def test_torsiondrive_factory_index():
    """
    Test making an index with a torsiondrive factory the index should tag the torsion atoms.
    """

    factory = TorsiondriveDatasetFactory()

    mol = Molecule.from_smiles("CC")
    mol.properties["atom_map"] = {0: 0, 1: 1, 2: 2, 3: 3}
    index = factory.create_index(mol)
    assert index == mol.to_smiles(isomeric=True, explicit_hydrogens=True, mapped=True)
コード例 #2
0
def test_torsiondrive_index():
    """
    Test generating an index using torsiondrive, this should tag the atoms in the torsion.
    """

    mol = Molecule.from_file(get_data("methanol.sdf"))

    mol.properties["atom_map"] = {4: 0, 0: 1, 1: 2, 5: 3}

    factory = TorsiondriveDatasetFactory()

    index = factory.create_index(mol)

    tags = ["[C:2]", "[H:1]", "[O:3]", "[H:4]"]
    for tag in tags:
        assert tag in index
コード例 #3
0
def get_torsiondrive_index(molecule: off.Molecule) -> str:
    """
    Generate a QCSubmit torsiondrive dataset index name for the molecule with an atom map.
    """
    factory = TorsiondriveDatasetFactory()
    return factory.create_index(molecule)