Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frustratometer/classes/Frustratometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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):
"""
Expand Down
7 changes: 4 additions & 3 deletions frustratometer/frustration/frustration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1573,4 +1574,4 @@ def compute_energy_sliding_window(seq: str,
'frustration': frustration_sw
}

return results
return results
Loading