Pymol Protein Viewer

This module generates Pymol scene files files (.pse) which can be viewed in the Pymol GUI application. This module requires that Pymol is installed and in the PATH. Pymol can be downloaded from the Pymol website

GWProt.pymol_protein_viewer.compare_proteins_in_pymol(file1: str, file2: str, output_file: str, chain1: str = 'A', chain2: str = 'A', correspondence: Optional[array] = None, threshold: float = 0.5) None

This loads two pdb files and display them in Pymol and aligns them with a correspondence, then saves the scene to a .pse file. A rigid alignment is created minimizing weighted RSMD. Note that if Pymol 2 is used it uses cmd.cealign instead. For a pair of aligned residues, a line will connect them if over threshold of each of their mass is connected. The proteins are also colored by the local geometric distortion (LGD) levels.

Parameters
  • file1 – Filepath to the first protein.

  • file2 – Filepath to the second protien.

  • output_file – Filepath where the resulting file should be saved to.

  • chain1 – Which chain of the first protein to use, default is A.

  • chain2 – Which chain of the second protein to use, default is A.

  • correspondence – A correspondence to align the two proteins. If none is provided one will be calculated with GW_protein.run_GW.

  • threshold – The threshold for displaying aligned residues.

GWProt.pymol_protein_viewer.show_proteins_with_values(infiles: list[str], data_lists: list[list[float]], output_file: str, chain_ids: Optional[list[str]] = None, hide: bool = True) None

This loads pdb files and display them in Pymol with colors based on the data_lists, then saves the scene to a .pse file.

Parameters
  • infiles – Filepaths to the first protein.

  • chain_ids – Which chains of the proteins to use, a value must be entered for each. Defaults to all ‘A’.

  • data_lists – A list of lists of values to display

  • output_file – Filepath where the resulting file should be saved to.

  • hide – Whether to hide the chains that aren’t selected.