def addTSsearch (jobGraph, rootDir, currentDir, baseData, initialGeom, index):
    newNode = FDynamoNode("tsSearch.f90", currentDir)
    newNode.verification = ["Opt" , "Freq"]
    newNode.noOfExcpectedImaginaryFrequetions = 1
    newNode.templateKey = "QMMM_opt_mopac"
    newNode.additionalKeywords = { "ts_search" : "true" }
    newNode.coordsIn = "coordsIn.crd"
    
    makedirs(currentDir)
    saveCrdFromDCD( join(currentDir, "coordsIn.crd"), initialGeom )
    
    newNode.coordsOut = "coordsDone.crd"
    newNode.getCoordsFromParent = False
    
    newNode.fDynamoPath = baseData["fDynamoPath"]
    newNode.charge = baseData["charge"]
    newNode.method = baseData["method"]
    newNode.forceField = data["forceField"]
    copyfile( join(baseData["filesDir"], baseData["forceField"]), join(currentDir, newNode.forceField) )
    newNode.flexiblePart = data["flexiblePart"]
    copyfile( join(baseData["filesDir"], baseData["flexiblePart"]), join(currentDir, newNode.flexiblePart) )
    newNode.sequence = data["sequence"]
    copyfile( join(baseData["filesDir"], baseData["sequence"]), join(currentDir, newNode.sequence) )
    newNode.qmSele = data["qmSele"]
    
    jobGraph.add_node(currentDir, data = newNode)
    jobGraph.add_edge(rootDir, currentDir)
    
    newDir = join(currentDir, "irc_reverse")
    newNode = FDynamoNode("irc_reverse.f90", newDir)
    newNode.verification = ["SP"]
    newNode.templateKey = "QMMM_irc_mopac"
    newNode.additionalKeywords = { "IRC_dir" : "-1" }
    newNode.coordsIn = "coordsStart.crd"
    newNode.coordsOut = "coordsDone.crd"
    

    jobGraph.add_node(newDir, data = newNode)
    jobGraph.add_edge(currentDir, newDir)
    
    optDir = join(newDir, "opt")
    
    newNode = FDynamoNode("opt.f90", optDir)
    newNode.verification = ["Opt", "Freq"]
    newNode.noOfExcpectedImaginaryFrequetions = 0
    newNode.templateKey = "QMMM_opt_mopac"
    newNode.additionalKeywords = { "ts_search" : "false" , "definedAtoms" : baseData["definedAtoms"]}
    newNode.coordsIn = "coordsStart.crd"
    newNode.coordsOut = "coordsDone"+str(index)+".crd"
    newNode.measureRCinOutput = True
    

    jobGraph.add_node(optDir, data = newNode)
    jobGraph.add_edge( newDir, optDir)
    
    newDir = join(currentDir, "irc_forward")
    newNode = FDynamoNode("irc_forward.f90", newDir)
    newNode.verification = ["SP"]
    newNode.templateKey = "QMMM_irc_mopac"
    newNode.additionalKeywords = { "IRC_dir" : "1" }
    newNode.coordsIn = "coordsStart.crd"
    newNode.coordsOut = "coordsDone.crd"
    
    jobGraph.add_node(newDir, data = newNode)
    jobGraph.add_edge(currentDir, newDir)
    
    optDir = join(newDir, "opt")
    
    newNode = FDynamoNode("opt.f90", optDir)
    newNode.verification = ["Opt", "Freq"]
    newNode.noOfExcpectedImaginaryFrequetions = 0
    newNode.templateKey = "QMMM_opt_mopac"
    newNode.additionalKeywords = { "ts_search" : "false" , "definedAtoms" : baseData["definedAtoms"]}
    newNode.coordsIn = "coordsStart.crd"
    newNode.coordsOut = "coordsDone"+str(index)+".crd"
    newNode.measureRCinOutput = True
    
    jobGraph.add_node(optDir, data = newNode)
    jobGraph.add_edge( newDir, optDir)
    

    if len(sys.argv) < 4:
        print("Usage: graphTSsearchWHAM wham.log/RC compileScanScript.sh numberOfTS2find addName")
    else:
        whamLog = sys.argv[1]
        compileScript = sys.argv[2]
        TSno = int(sys.argv[3])
        
        addName = ""
        if len(sys.argv) > 4:
            addName = sys.argv[4]

        if isfile(whamLog):
            tsReactionCoord = getTScoords(whamLog)
        else:
            tsReactionCoord = float(whamLog)
        print("Found reaction coordinate: ", tsReactionCoord)
        data = parseFDynamoCompileScript(compileScript)
        definedAtoms = data["definedAtoms"]
        atoms = atomsFromAtomSelection( definedAtoms)

        currentDir = abspath(dirname(compileScript))

        graphDir = join( getcwd(), "multiTSsearch"+addName )

        sm = GraphManager()
        graph = sm.isGraphHere(graphDir)
        if not graph:
            newGraph = jobGraph = buildGraph(tsReactionCoord, atoms, graphDir, data, currentDir, TSno)
    
            
            result = sm.addGraph(newGraph, graphDir)
            if result:
                sm.buildGraphDirectories(newGraph)
                sm.saveGraphs()
            print("Created new graph")
        else:
            print("Cannot create more than one graph in the same directory")
Beispiel #2
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 16:41:28 2019

@author: michal
"""
import sys
from graphManager import GraphManager

if __name__ == "__main__":
    if len(sys.argv) == 1:
        print("Usage: graphRemove graphKeys")
    elif len(sys.argv) > 1:
        sm = GraphManager()
        graphKeys = sys.argv[1:]
        for g in graphKeys:
            sm.deleteGraph(g)
        sm.saveGraphs()
    else:
        print( "cooooo?")
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 10:27:35 2020

@author: michal
"""

from graphManager import GraphManager
import sys

if __name__ == "__main__":
    if len(sys.argv) == 2:
        nodePath = sys.argv[1]
        gm = GraphManager()

        graph = gm.isGraphHere(nodePath)

        if not graph:
            print("Invalid path!")
            quit()

        graph.nodes[nodePath]["data"].status = "waitingForParent"
        gm.saveGraphs()
    elif len(sys.argv) == 3:
        nodePath = sys.argv[1]
        status = sys.argv[2]

        if not status in [
                "waitingForParent", "running", "finished", "examined"
        ]: