thanks for sharing this tool. I'm trying to run the example shown using testtopgrams.tpr
and testtrjgromacs.xtc
.
I've managed to run the notebook but at the last set of instructions I get this error:
start the clustering procedure
Nsnaps = 200
WC=WaterClustering(nsnaps= Nsnaps)
perform multi stage reclustering
WC.multi_stage_reclustering(*get_orientations_from_positions(coordO,coordH))
visualise results with pymol
WC.visualise_pymol(aligned_snap, active_site_ids=active_site_resnums, dist=distance)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 7
5 WC.multi_stage_reclustering(*get_orientations_from_positions(coordO,coordH))
6 # visualise results with pymol
----> 7 WC.visualise_pymol(aligned_snap, active_site_ids=active_site_resnums, dist=distance)
File ~/opt/miniconda3/envs/WaterNetworkAnalysis/lib/python3.11/site-packages/ConservedWaterSearch/water_clustering.py:1068, in WaterClustering.visualise_pymol(self, aligned_protein, output_file, active_site_ids, crystal_waters, ligand_resname, dist, density_map)
1037 def visualise_pymol(
1038 self,
1039 aligned_protein: str = "aligned.pdb",
(...)
1045 density_map: str | None = None,
1046 ) -> None:
1047 """Visualise results using `pymol <[https://pymol.org/>`__](https://pymol.org/%3E%60__).
1048
1049 Args:
(...)
1066 visualisation session (usually .dx file). Defaults to None.
1067 """
-> 1068 visualise_pymol(
1069 self._water_type,
1070 self._waterO,
1071 self._waterH1,
1072 self._waterH2,
1073 aligned_protein=aligned_protein,
1074 output_file=output_file,
1075 active_site_ids=active_site_ids,
1076 crystal_waters=crystal_waters,
1077 ligand_resname=ligand_resname,
1078 dist=dist,
1079 density_map=density_map,
1080 )
File ~/opt/miniconda3/envs/WaterNetworkAnalysis/lib/python3.11/site-packages/ConservedWaterSearch/utils.py:352, in visualise_pymol(water_type, waterO, waterH1, waterH2, aligned_protein, output_file, active_site_ids, crystal_waters, ligand_resname, dist, density_map)
350 os.remove("hoh.cif")
351 # save
--> 352 cmd.save(output_file)
353 cmd.reinitialize()
File ~/opt/miniconda3/envs/WaterNetworkAnalysis/lib/python3.11/site-packages/pymol/exporting.py:834, in save(filename, selection, state, format, ref, ref_state, quiet, partial, _self)
832 # analyze filename
833 from pymol.importing import filename_to_format, _eval_func
--> 834 _, _, format_guessed, zipped = filename_to_format(filename)
835 filename = _self.exp_path(filename)
837 # file format
File ~/opt/miniconda3/envs/WaterNetworkAnalysis/lib/python3.11/site-packages/pymol/importing.py:42, in filename_to_format(filename)
41 def filename_to_format(filename):
---> 42 filename = os.path.basename(filename)
43 pre, delim, ext = filename.rpartition('.')
45 if ext in ('gz', 'bz2',):
File <frozen posixpath>:142, in basename(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
I'm working on intel Mac and I have installed the tool using conda in a new env.