Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all instances of # End Method comments #70

Merged
merged 6 commits into from
Mar 20, 2025
3 changes: 0 additions & 3 deletions CodeEntropy/ConformationFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,3 @@ def assign_conformation(
conformations[frame] = np.argmin(distances)

return conformations


# END assign_conformation
12 changes: 0 additions & 12 deletions CodeEntropy/EntropyFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ def frequency_calculation(lambdas, temp):
return frequencies


# END frequency_calculation


def vibrational_entropy(matrix, matrix_type, temp, highest_level):
"""
Function to calculate the vibrational entropy for each level calculated from eq. (4)
Expand Down Expand Up @@ -110,9 +107,6 @@ def vibrational_entropy(matrix, matrix_type, temp, highest_level):
return S_vib_total


# END vibrational_entropy


def conformational_entropy(
data_container, dihedrals, bin_width, start, end, step, number_frames
):
Expand Down Expand Up @@ -166,9 +160,6 @@ def conformational_entropy(
return S_conf_total


# END conformational_entropy


def orientational_entropy(neighbours_dict):
"""
Function to calculate orientational entropies from eq. (10) in J. Higham, S.-Y.
Expand Down Expand Up @@ -211,6 +202,3 @@ def orientational_entropy(neighbours_dict):
# implement a case for molecules with hydrogen bonds but to a lesser
# extent than water
return S_or_total


# END orientational_entropy
24 changes: 0 additions & 24 deletions CodeEntropy/GeometricFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def get_beads(data_container, level):
return list_of_beads


# END


def get_axes(data_container, level, index=0):
"""
Function to set the translational and rotational axes.
Expand Down Expand Up @@ -126,9 +123,6 @@ def get_axes(data_container, level, index=0):
return trans_axes, rot_axes


# END


def get_avg_pos(atom_set, center):
"""
Function to get the average position of a set of atoms.
Expand Down Expand Up @@ -168,9 +162,6 @@ def get_avg_pos(atom_set, center):
return avg_position


# END


def get_sphCoord_axes(arg_r):
"""
For a given vector in space, treat it is a radial vector rooted at 0,0,0 and
Expand Down Expand Up @@ -243,9 +234,6 @@ def get_sphCoord_axes(arg_r):
return spherical_basis


# END


def get_weighted_forces(
data_container, bead, trans_axes, highest_level, force_partitioning=0.5
):
Expand Down Expand Up @@ -291,9 +279,6 @@ def get_weighted_forces(
return weighted_force


# END


def get_weighted_torques(data_container, bead, rot_axes, force_partitioning=0.5):
"""
Function to calculate the moment of inertia weighted torques for a given bead.
Expand Down Expand Up @@ -379,9 +364,6 @@ def get_weighted_torques(data_container, bead, rot_axes, force_partitioning=0.5)
return weighted_torque


# END


def create_submatrix(data_i, data_j, number_frames):
"""
Function for making covariance matrices.
Expand Down Expand Up @@ -411,9 +393,6 @@ def create_submatrix(data_i, data_j, number_frames):
return submatrix


# END


def filter_zero_rows_columns(arg_matrix, verbose):
"""
function for removing rows and columns that contain only zeros from a matrix
Expand Down Expand Up @@ -461,6 +440,3 @@ def filter_zero_rows_columns(arg_matrix, verbose):
)

return arg_matrix


# END
9 changes: 0 additions & 9 deletions CodeEntropy/LevelFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ def select_levels(data_container, verbose):
return number_molecules, levels


# END get_levels


def get_matrices(
data_container, level, verbose, start, end, step, number_frames, highest_level
):
Expand Down Expand Up @@ -155,9 +152,6 @@ def get_matrices(
return force_matrix, torque_matrix


# END get_matrices


def get_dihedrals(data_container, level):
"""
Define the set of dihedrals for use in the conformational entropy function.
Expand Down Expand Up @@ -233,6 +227,3 @@ def get_dihedrals(data_container, level):
dihedrals.append(atom_group.dihedral)

return dihedrals


# END get_dihedrals
14 changes: 5 additions & 9 deletions CodeEntropy/main_mcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"help": "Bin width in degrees for making the histogram",
"default": 30,
},
"tempra": {
"temperature": {
"type": float,
"help": "Temperature for entropy calculation (K)",
"default": 298.0,
Expand Down Expand Up @@ -286,7 +286,7 @@ def main():

# Calculate the entropy from the diagonalisation of the matrices
S_trans_residue = EF.vibrational_entropy(
force_matrix, "force", args.temp, highest_level
force_matrix, "force", args.temperature, highest_level
)
S_trans += S_trans_residue
print(f"S_trans_{level}_{residue} = {S_trans_residue}")
Expand All @@ -312,7 +312,7 @@ def main():
)

S_rot_residue = EF.vibrational_entropy(
torque_matrix, "torque", args.temp, highest_level
torque_matrix, "torque", args.temperature, highest_level
)
S_rot += S_rot_residue
print(f"S_rot_{level}_{residue} = {S_rot_residue}")
Expand Down Expand Up @@ -420,8 +420,6 @@ def main():
with open(args.outfile, "a") as out:
print(molecule, "\t", level, "\tConformational\t", S_conf, file=out)

# End united atom vibrational and conformational calculations #

if level in ("polymer", "residue"):
# Vibrational entropy at every level
# Get the force and torque matrices for the beads at the relevant level
Expand All @@ -438,7 +436,7 @@ def main():

# Calculate the entropy from the diagonalisation of the matrices
S_trans = EF.vibrational_entropy(
force_matrix, "force", args.temp, highest_level
force_matrix, "force", args.temperature, highest_level
)
print(f"S_trans_{level} = {S_trans}")
new_row = pd.DataFrame(
Expand All @@ -456,7 +454,7 @@ def main():
)

S_rot = EF.vibrational_entropy(
torque_matrix, "torque", args.temp, highest_level
torque_matrix, "torque", args.temperature, highest_level
)
print(f"S_rot_{level} = {S_rot}")
new_row = pd.DataFrame(
Expand Down Expand Up @@ -540,8 +538,6 @@ def main():
print(molecule, "\t Molecule\tTotal Entropy\t", S_molecule, file=out)


# END main function

if __name__ == "__main__":

main()