diff --git a/frustratometer/classes/Frustratometer.py b/frustratometer/classes/Frustratometer.py index 962050f..8c58dac 100644 --- a/frustratometer/classes/Frustratometer.py +++ b/frustratometer/classes/Frustratometer.py @@ -291,7 +291,7 @@ def auc(self): """ return frustration.compute_auc(self.roc()) - def vmd(self, sequence: str = None, single:Union[str,np.array] = 'singleresidue', pair:Union[str,np.array] = 'mutational', + def vmd(self, sequence: str = None, single:Union[str,np.array] = 'singleresidue', pair:Union[str,np.array] = 'mutational', launch_vmd:bool = True, aa_freq:np.array = None, correction:int = 0, max_connections:Union[int,None] = None, movie_name=None, still_image_name=None): """ Calculates frustration indices and superimposes frustration patterns onto PDB structure using the VMD software. @@ -322,7 +322,8 @@ def vmd(self, sequence: str = None, single:Union[str,np.array] = 'singleresidue' -self.frustration(kind=single, sequence=sequence, aa_freq=aa_freq), -self.frustration(kind=pair, sequence=sequence, aa_freq=aa_freq), max_connections=max_connections, movie_name=movie_name, still_image_name=still_image_name) - frustration.call_vmd(self.pdb_file, tcl_script) + if launch_vmd: + frustration.call_vmd(self.pdb_file, tcl_script) def view_pair_frustration(self, sequence:str = None, pair:str = 'mutational', aa_freq:np.array = None): """ diff --git a/frustratometer/frustration/frustration.py b/frustratometer/frustration/frustration.py index 81ec880..38ad604 100644 --- a/frustratometer/frustration/frustration.py +++ b/frustratometer/frustration/frustration.py @@ -1025,9 +1025,10 @@ def write_tcl_script(pdb_file: Union[Path,str], chain: str, mask: np.array, dist exit ''') elif still_image_name: + # file type choices other than ppm may work; see https://www.ks.uiuc.edu/Research/vmd/current/ug/node147.html fo.write(f'set output "{still_image_name}"' + ''' - render snapshot $output - exit + render format TachyonInternal PPM + render TachyonInternal $output ''') fo.close() return tcl_script @@ -1573,4 +1574,4 @@ def compute_energy_sliding_window(seq: str, 'frustration': frustration_sw } - return results \ No newline at end of file + return results