Esempio n. 1
0
            args.respin_location, save_resp_to, resp_type='unrest',
            check_ivary=True, esp_fn=args.esp_file)
    except Exception as e:
        shutil.rmtree(save_resp_to)
        raise e
    if args.save_resp_to is None:
        shutil.rmtree(save_resp_to)
else:
    averaged_charges, ivary_list = equivalence(
        molecule, args.input_charge_type, args.respin_location, respin1_fn="",
        respin2_fn="")
    # Check equivalence information from respin:
    _check_ivary(True, molecule, ivary_list)
    # The new molecule and name 'resp' is for consistency with the
    # equivalencing code above
    averaged_molecule = copy.deepcopy(molecule)
    charges._update_molecule_with_charges(averaged_molecule, averaged_charges,
                                          "resp")

message = charges.compare_charges(args.input_charge_type, "resp", molecule,
                                  averaged_molecule, thresh=args.thresh)
thresh_message = " vary by more than the threshold of " + str(args.thresh)

if message:
    print("\nThe following charges" + thresh_message)
    print(message)
else:
    print("\nNo charges" + thresh_message)

charges.dump_charges_to_qout(averaged_molecule, "resp", args.output)
Esempio n. 2
0
esp_charge_rrms = rms_and_rep(g.field, g.molecule, esp_charge_type)[1]
resp_charge_rrms = rms_and_rep(g.field, esp_equiv_molecule, 'resp')[1]

print("\nThe molecule with {0} charges:".format(charge_type.upper()))
print("RRMS: {0:.5f}".format(charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(charge_type)

print("\nThe molecule with equivalenced {0} charges:".format(
    charge_type.upper()))
print("RRMS: {0:.5f}".format(equiv_charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(charge_type + '_equiv')

print("\nChecking differences between raw and equivalenced charges ...")
print(compare_charges(charge_type, charge_type + '_equiv', g.molecule))

print("\nThe molecule with {0} charges:".format(esp_charge_type.upper()))
print("RRMS: {0:.5f}".format(esp_charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(esp_charge_type)

print(
    "\nThe molecule with equivalenced {0} charges (unrestrained RESP):".format(
        esp_charge_type.upper()))
print("RRMS: {0:.5f}".format(resp_charge_rrms))
for atom in esp_equiv_molecule:
    atom.print_with_charge('resp')

print("\nChecking differences between raw and equivalenced charges ...")
print(compare_charges(esp_charge_type, 'resp', g.molecule, esp_equiv_molecule))
Esempio n. 3
0
    print("RRMS: {0:.5f}".format(charge_rrms))
    print("RMSV: {0:.5f}".format(charge_rms / charge_rrms))
    for atom in g.molecule:
        atom.print_with_charge(esp_charge_type)

    print("\nThe molecule with equivalenced {0} charges (unrestrained RESP):".
          format(esp_charge_type.upper()))
    print(" RMS: {0:.5f}".format(resp_rms))
    print("RRMS: {0:.5f}".format(resp_rrms))
    print("RMSV: {0:.5f}".format(resp_rms / resp_rrms))
    for atom in esp_equiv_molecule:
        atom.print_with_charge('resp')

    print("\nChecking differences between raw and equivalenced charges ...")
    print(
        charges.compare_charges(esp_charge_type, 'resp', g.molecule,
                                esp_equiv_molecule))

    print("\nThe molecule with equivalenced {0} charges (unrestrained RESP) "
          "evaluated on the {1} grid:".format(alt_esp_charge_type.upper(),
                                              esp_charge_type.upper()))
    print(" RMS: {0:.5f}".format(alt_resp_rms))
    print("RRMS: {0:.5f}".format(alt_resp_rrms))
    print("RMSV: {0:.5f}".format(alt_resp_rms / alt_resp_rrms))
    print(
        "Percentage increase over equivalenced {0} charges: {1:.2f} %".format(
            esp_charge_type.upper(),
            100 * (alt_resp_rrms - resp_rrms) / resp_rrms))
    for atom in alt_esp_equiv_molecule:
        atom.print_with_charge('resp')

Esempio n. 4
0
esp_charge_rrms = rms_and_rep(g.field, g.molecule, esp_charge_type)[1]
resp_charge_rrms = rms_and_rep(g.field, esp_equiv_molecule, 'resp')[1]

print("\nThe molecule with {0} charges:".format(charge_type.upper()))
print("RRMS: {0:.5f}".format(charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(charge_type)

print("\nThe molecule with equivalenced {0} charges:".format(
      charge_type.upper()))
print("RRMS: {0:.5f}".format(equiv_charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(charge_type + '_equiv')

print("\nChecking differences between raw and equivalenced charges ...")
print(compare_charges(charge_type, charge_type + '_equiv', g.molecule))

print("\nThe molecule with {0} charges:".format(esp_charge_type.upper()))
print("RRMS: {0:.5f}".format(esp_charge_rrms))
for atom in g.molecule:
    atom.print_with_charge(esp_charge_type)

print("\nThe molecule with equivalenced {0} charges (unrestrained RESP):"
      .format(esp_charge_type.upper()))
print("RRMS: {0:.5f}".format(resp_charge_rrms))
for atom in esp_equiv_molecule:
    atom.print_with_charge('resp')

print("\nChecking differences between raw and equivalenced charges ...")
print(compare_charges(esp_charge_type, 'resp', g.molecule, esp_equiv_molecule))
Esempio n. 5
0
    if args.save_resp_to is None:
        shutil.rmtree(save_resp_to)
else:
    averaged_charges, ivary_list = equivalence(molecule,
                                               args.input_charge_type,
                                               args.respin_location,
                                               respin1_fn="",
                                               respin2_fn="")
    # Check equivalence information from respin:
    _check_ivary(True, molecule, ivary_list)
    # The new molecule and name 'resp' is for consistency with the
    # equivalencing code above
    averaged_molecule = copy.deepcopy(molecule)
    charges._update_molecule_with_charges(averaged_molecule, averaged_charges,
                                          "resp")

message = charges.compare_charges(args.input_charge_type,
                                  "resp",
                                  molecule,
                                  averaged_molecule,
                                  thresh=args.thresh)
thresh_message = " vary by more than the threshold of " + str(args.thresh)

if message:
    print("\nThe following charges" + thresh_message)
    print(message)
else:
    print("\nNo charges" + thresh_message)

charges.dump_charges_to_qout(averaged_molecule, "resp", args.output)