Goodman-lab / DP5

Python workflow for DP5 and DP4 analysis of organic molecules
Other
173 stars 99 forks source link

Freeze on Tinker #36

Closed zjp closed 2 years ago

zjp commented 4 years ago

It looks like when DP4 gets to the Tinker processing step, it hangs because Tinker expects some manual input (a parameter file which I assume is mmff.prm). Can you verify whether this is the case for you with the newest version of Tinker? If so, I have a patch written to correct this behavior.

gkxiao commented 3 years ago

Yes, you are right. You need to fix the RunTinker function in the Tinker.py.

Here is the fixed function:

def RunTinker(TinkerInputs, settings):
    #Run Tinker scan for all diastereomeric inputs
    TinkerOutputs = []
    TinkerPrefix = os.path.join(settings.TinkerPath, 'bin', 'scan')
    if shutil.which(TinkerPrefix) is None:
        print('Tinker.py, RunTinker:\n  Could not find Tinker scan executable at ' + TinkerPrefix)
        quit()

    NCompleted = 0

    for isomer in TinkerInputs:
        if os.path.exists(isomer + '.tout') and os.path.exists(isomer + '.arc'):
            print('Output files for ' + isomer + ' already exist, skipping.')
            TinkerOutputs.append(isomer)
            continue

        print(settings.TinkerPath + '/bin/scan ' + isomer +' '+settings.TinkerPath + '/params/mmff.prm 0 10 20 0.00001 | tee ./' + isomer + \
            '.tout')
        outp = subprocess.check_output(settings.TinkerPath + '/bin/scan ' + isomer +' '+settings.TinkerPath+'/params/mmff.prm'+
            ' 0 10 20 0.00001 | tee ./' + isomer + '.tout', shell=True)
        NCompleted = NCompleted + 1
        TinkerOutputs.append(isomer)
        print("Tinker job " + str(NCompleted) + " of " + str(len(TinkerInputs)) + \
            " completed.")

        if settings.Rot5Cycle is True:
            print(settings.TinkerPath + '/bin/scan ' + isomer + 'rot '+settings.TinkerPath+'/params/mmff.prm 0 10 20 0.00001 | tee ./' + \
                isomer + 'rot.tout')
            outp = subprocess.check_output(settings.TinkerPath + '/bin/scan ' + isomer +
                'rot '+settings.TinkerPath+'/params/mmff.prm 0 10 20 0.00001 | tee ./' + isomer + 'rot.tout', shell=True)
            NCompleted = NCompleted + 1

    return TinkerOutputs
KristapsE commented 2 years ago

As the bugfix has been implemented in the code, I am closing this issue.