Skip to content

Commit

Permalink
remove unused calls
Browse files Browse the repository at this point in the history
  • Loading branch information
wiederm committed Oct 26, 2021
1 parent 58e0d72 commit fbfa10e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 125 deletions.
118 changes: 0 additions & 118 deletions transformato/mutate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,121 +1777,3 @@ def mutate_pure_tautomers(
)

return (i_tautomer1.output_files, i_tautomer2.output_files)


def mutate_systems(
config: str,
nr_of_bonded_windows: int = 4,
input_dir: str = "../data/",
output_dir: str = ".",
connected_dummy_regions_cc1: list = [],
connected_dummy_regions_cc2: list = [],
el_nr_of_states: int = 5,
):

from transformato import (
IntermediateStateFactory,
ProposeMutationRoute,
SystemStructure,
load_config_yaml,
)

configuration = load_config_yaml(
config=config, input_dir=input_dir, output_dir=output_dir
)
s1 = SystemStructure(configuration, "structure1")
s2 = SystemStructure(configuration, "structure2")
s1_to_s2 = ProposeMutationRoute(s1, s2)

# setup mutation route
if connected_dummy_regions_cc1:
s1_to_s2.propose_common_core()
s1_to_s2.finish_common_core(
connected_dummy_regions_cc1=connected_dummy_regions_cc1
)
elif connected_dummy_regions_cc2:
s1_to_s2.propose_common_core()
s1_to_s2.finish_common_core(
connected_dummy_regions_cc2=connected_dummy_regions_cc2
)
elif connected_dummy_regions_cc2 and connected_dummy_regions_cc1:
s1_to_s2.propose_common_core()
s1_to_s2.finish_common_core(
connected_dummy_regions_cc1=connected_dummy_regions_cc1,
connected_dummy_regions_cc2=connected_dummy_regions_cc2,
)
else:
raise RuntimeError()

# setup mutation and StateFactory
mutation_list = s1_to_s2.generate_mutations_to_common_core_for_mol1()

# system 1
i = IntermediateStateFactory(
system=s1,
configuration=configuration,
)

# write out states
# start with charge
intst = 1
charges = mutation_list["charge"]
output_files_t1 = []
for lambda_value in np.linspace(1, 0, el_nr_of_states):
# turn off charges
o, intst = i.write_state(
mutation_conf=charges,
lambda_value_electrostatic=lambda_value,
intst_nr=intst,
)
output_files_t1.append(o)

# turn off the lj of the hydrogen
lj = mutation_list["lj"]
o, intst = i.write_state(
mutation_conf=lj,
lambda_value_vdw=0.0,
intst_nr=intst,
)
output_files_t1.append(o)

# transform common core
for lambda_value in np.linspace(1, 0, nr_of_bonded_windows + 1)[1:]:
# turn off charges
o, intst = i.write_state(
mutation_conf=mutation_list["transform"],
common_core_transformation=lambda_value,
intst_nr=intst,
)
output_files_t1.append(o)

# setup other tautomer
mutation_list = s1_to_s2.generate_mutations_to_common_core_for_mol2()
i = IntermediateStateFactory(
system=system2,
configuration=configuration,
)
# write out states
# start with charge
intst = 1
output_files_t2 = []
charges = mutation_list["charge"]
for lambda_value in np.linspace(1, 0, 2):
# turn off charges
o, intst = i.write_state(
mutation_conf=charges,
lambda_value_electrostatic=lambda_value,
intst_nr=intst,
)
output_files_t2.append(o)

# turn off the lj of the hydrogen
lj = mutation_list["lj"]
o, intst = i.write_state(
mutation_conf=lj,
lambda_value_vdw=0.0,
intst_nr=intst,
)
output_files_t2.append(o)

return (output_files_t1, output_files_t2)
6 changes: 0 additions & 6 deletions transformato/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ def write_state(
common_core_transformation : float, optional
[description], by default 1.0
Returns
-------
[type]
[description]
intst_nr : int
automatically incremented intst nr
"""

logger.debug("#########################################")
Expand Down
1 change: 0 additions & 1 deletion transformato/tests/test_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ def test_vdw_mutation_for_hydrogens_system2():
i.write_state(
mutation_conf=hydrogen_lj_mutations,
lambda_value_vdw=lambda_value,
intst_nr=0,
)
print("Set epsilon/rmin for selected atoms")

Expand Down

0 comments on commit fbfa10e

Please sign in to comment.