Example #1
0
def add_fws(reset=False):
    if reset:
        lpad.reset('', require_password=False)
    lpad = create_launchpad(LOCAL_DB_CONFIG)

    for fname in glob(QM9_DATA_HOME + '/*'):
        pm3 = Firework(ProtonateMolecule(xyzparent=fname),
                       name=fname.split('.')[0])

        lpad.add_wf(pm3)
    return
Example #2
0
def rapid_update(batch):
    lpad = create_launchpad(LOCAL_DB_CONFIG)
    for fw_id in batch:
        try:
            lpad.mark_fizzled(fw_id)
            lpad.rerun_fw(fw_id, recover_mode='prev_dir')

            fwdict = lpad.get_fw_dict_by_id(fw_id)
            parent_xyz = str(fwdict['name']+'.xyz')
            mol = pybel.readfile('xyz', parent_xyz).next()

            lpad.update_spec([fw_id], {'_tasks.0._fw_name': 'ProtonateMolecule',
                                    '_tasks.0.xyzparent': parent_xyz})
        except LockedWorkflowError:
            continue
Example #3
0
def add_neutral_fws(reset=False):
    if reset:
        lpad.reset('', require_password=False)
    lpad = create_launchpad(LOCAL_DB_CONFIG)

    for fname in glob(QM9_DATA_HOME + '/*'):
        smiles = row['original_smiles']
        formula = row['formula']

        if type(smiles) is float:
            continue

        uff = OBUFFOptimize(smiles_string=smiles)
        pm3 = OrcaOptimize()
        fw = Firework([uff, pm3], name=formula)

        lpad.add_wf(fw)
    return
Example #4
0
def rapid(dummy):
    lpad = create_launchpad(LOCAL_DB_CONFIG)
    rapidfire(lpad, FWorker(), nlaunches=25000)
Example #5
0
import os
from metatlas import create_launchpad, make_xyz_from_stored_data, make_grad_from_stored_data

if __name__ == '__main__':
    LOCAL_DB_CONFIG = '/home/bkrull/.fireworks/local_db.ini'
    lpad = create_launchpad(LOCAL_DB_CONFIG)

    fract = 1

    for id in lpad.get_fw_ids({'state': 'COMPLETED'}):
        data = lpad.get_fw_dict_by_id(id)
        name = data['name'].split('/')[-1]
        stored_data = data['launches'][0]['action']['stored_data']

        conformers = stored_data['atom_list']
        nconformers = len(conformers)

        try:
            atoms = conformers[0]
        except IndexError:
            continue

        for confid in range(nconformers):
            coords = stored_data['coords'][confid]
            grads = stored_data['grads'][confid]
            energies = stored_data['energies'][confid]
            with open(
                    '/scratch/users/bkrull/qm9struct/{}/{}-{}.xyz'.format(
                        fract, name, confid), 'w') as f:
                for step in range(len(coords)):
                    coord = coords[step]
Example #6
0
-----------    ----------    -----------
| Create  |    | Run    |    | Process |
| Orca    | => | Orca   | => | Output  |
| Input   |    | Calc   |    | File    |
-----------    ----------    -----------
"""
from fireworks import Firework
from metatlas import OBUFFOptimize, OrcaOptimize, \
    create_launchpad, make_df_with_smiles_only_from_csv

if __name__ == "__main__":
    METATLAS_DB_CONFIG = '/home/bkrull/.fireworks/metatlas.ini'
    CSV_FILE = './chebi_and_metacyc_molecules.csv'
    PROJECT_HOME = 'scr/'

    metatlas_lpad = create_launchpad(METATLAS_DB_CONFIG)
    metatlas_lpad.reset('2018-03-13')
    molecules = make_df_with_smiles_only_from_csv(CSV_FILE, reset=True)

    for index, row in molecules.iterrows():
        smiles = row['original_smiles']
        formula = row['formula']

        if type(smiles) is float:
            continue

        uff = OBUFFOptimize(smiles_string=smiles)
        pm3 = OrcaOptimize()
        fw = Firework([uff, pm3], name=formula)

        metatlas_lpad.add_wf(fw)