Skip to content

Commit

Permalink
Merge pull request #61 from NDoering99/main
Browse files Browse the repository at this point in the history
Remove ligand_processing_test.py and update imports in openmmdlanalysis_test.py and test_preprocessing.py
  • Loading branch information
talagayev authored Jan 22, 2024
2 parents 56500f1 + 297fda3 commit dfe36fc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 43 deletions.
41 changes: 0 additions & 41 deletions openmmdl/tests/openmmdl_analysis/ligand_processing_test.py

This file was deleted.

3 changes: 1 addition & 2 deletions openmmdl/tests/openmmdl_analysis/openmmdlanalysis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

from pathlib import Path

from openmmdl.openmmdl_analysis.preprocessing import process_pdb_file, convert_pdb_to_sdf
from openmmdl.openmmdl_analysis.preprocessing import process_pdb_file, convert_pdb_to_sdf, increase_ring_indices, convert_ligand_to_smiles
from openmmdl.openmmdl_analysis.rmsd_calculation import rmsd_for_atomgroups, RMSD_dist_frames
from openmmdl.openmmdl_analysis.ligand_processing import increase_ring_indices, convert_ligand_to_smiles
from openmmdl.openmmdl_analysis.interaction_gathering import characterize_complex, retrieve_plip_interactions, create_df_from_binding_site, process_frame, process_trajectory, fill_missing_frames
from openmmdl.openmmdl_analysis.binding_mode_processing import gather_interactions, remove_duplicate_values, combine_subdict_values, filtering_values, unique_data_generation, df_iteration_numbering, update_values
from openmmdl.openmmdl_analysis.markov_state_figure_generation import min_transition_calculation, binding_site_markov_network
Expand Down
32 changes: 32 additions & 0 deletions openmmdl/tests/openmmdl_analysis/test_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,35 @@ def test_extract_and_save_ligand_as_sdf():

assert output_filename is not None
os.remove("ligand_changed.sdf")

test_data_directory = Path("openmmdl/tests/data/in")
TEST_LIGAND_FILE = f"{test_data_directory}/CVV.sdf"
TEST_OUTPUT_FILE = "CVV.smi"

def test_increase_ring_indices():
# Test case 1: Check if ring indices are correctly increased
ring = [1, 2, 3]
lig_index = 10
result = increase_ring_indices(ring, lig_index)
assert result == [11, 12, 13]

# Test case 2: Check with a different lig_index
ring = [3, 4, 5]
lig_index = 20
result = increase_ring_indices(ring, lig_index)
assert result == [23, 24, 25]


def test_convert_ligand_to_smiles():
# Convert the ligand structure to SMILES in the same directory as the input SDF file
convert_ligand_to_smiles(TEST_LIGAND_FILE, TEST_OUTPUT_FILE)

# Verify that the output SMILES file was created in the same directory as the input file
assert os.path.exists(TEST_OUTPUT_FILE)

# Optionally, you can also read and validate the content of the output SMILES file
with open(TEST_OUTPUT_FILE, "r") as smi_file:
smiles_lines = smi_file.readlines()
assert len(smiles_lines) > 0 # Check that there are SMILES representations


0 comments on commit dfe36fc

Please sign in to comment.