Package schrodinger :: Package application :: Package desmond :: Module fep_edge_report_maker :: Class FEPEdgeReportMaker
[hide private]
[frames] | no frames]

Class FEPEdgeReportMaker

object --+
         |
        FEPEdgeReportMaker
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, fep_edge_data, basename=None, perturbation_type='small_molecule')
This class generates a PDF report for an FEP/REST (+) type of job.
 
_load_modules(self)
 
report(self)
 
_cleanup_temp_files(self)
 
_init_report(self)
 
_replica_exchange_density(self)
 
get_rest_density_plot(self, rest_density_data, legend=True)
 
get_rest_density_img(self, rest_density_data, legend=True)
 
_protein_ligand_report(self)
 
_get_lid_img(self, stats, lig_noh_dict, lig_atom_dict, ligand_st, ligand_core_idx, template_st=None, template_core_idx=None, cutoff=0.2)
 
_align_chmmol(self, ligand_chmmol, ligand_core_idx=None, template_chmmol=None, template_core_idx=None)
 
_get_aligned_chmmol(self, ligand_st, ligand_core_idx, template_st=None, template_core_idx=None)
 
_get_lid(self, stats, lig_noh_dict, lig_atom_dict, ligand_st, ligand_core_idx, template_st=None, template_core_idx=None, cutoff=0.2)
 
_get_pl_text(self)
 
_get_plot_pl_bar_chart(self, label, data_dict0, data_dict1, nframes, name_1='Ligand 1', name_2='Ligand 2')
 
_create_pl_bar_fig(self, label, data_dict0, data_dict1, nframes, pl_interactions=['hb', 'hphb', 'ion', 'wb'], name_1='Ligand 1', name_2='Ligand 2', fig=None, for_print=False)
structure2d.structure_item
get_structure_item(self, st)
Returns structure as a graphic item to draw and to annotate.
 
get_2d_tors_annotated_lig_pair(self, tors1, tors2, tors_from, tors_to)
Returns structure scenes for two 2d ligands with annotations.
 
remove_last_atom_highlight(self, lig_item)
Removes previously highlighted atoms, if any, in a torsion.
 
add_atom_highlight(self, lig_item, torsion, color)
Add new highlight for atoms in the given torsion.
 
on_move(self, event)
If the mouse is inside a torsion plot, highlight the 1st and 4th atoms in that torsion in the structure.
 
_highlight_matching_torsion_atoms(self, row, tors, lig_item, color)
Highlight atoms in a torsion that matches the plot where the mouse is in.
 
create_torsions_plot(self, fig, tors1, tors2, tors_from, tors_to, ipage=None, structure1_item=None, structure2_item=None, for_print=False)
Creates a plot for torsions using the given matplot figure.
 
get_torsions_plot(self, tors1, tors2, tors_from, tors_to, for_print=False)
 
_get_torsion_plot_img(self, fig, nrows)
 
_get_annotated_2d_lig_img(self, lig_2d_si)
 
_ligand_torsion_report(self)
Generates report which monitors Rotatable bonds
 
_get_ligand_torsion_text(self)
 
_ligand_report(self)
Generate ligand report
 
_ligand_properties(self)
 
_ligand_rmsd_wrt_protein(self, name1='Ligand 1', name2='Ligand 2')
 
_get_ligand_wrt_prot_rmsd_text(self)
 
_get_ligand_wrt_prot_rmsd_plot(self, rmsd_l0, rmsd_l1, ts, ts_max, name1, name2)
 
_protein_report(self)
Generates the protein report (RSMD/RSMF for both end-point lambdas).
 
_protein_rmsf(self)
 
_get_protein_rmsf_text(self, show_sse=False, show_b=False, lig_res=None)
Returns a string to be used in the PDF document
 
_add_sse_span(self, ax, data_limits, color)
Setup overlay for SSE elements...
str
_add_b_factor(self, ax2, b_data, color, y_range_ratio, fsize=8)
Add B factor to the plot, on the Y2 axis.
 
_add_interacting_residues(self, ax, show_res, vals, color, ymin=0)
Draw a vertical bar for reisdues that interact with the ligand
 
gen_protein_rmsf_image(self, rmsf_l0, rmsf_l1, sse_l0, sse_l1, b_factor, contact_data, show_res_type=None)
image | matplotlib ax obj
get_protein_rmsf(self, for_print=True, fig=None, show_sse=False, show_b_factor=False, show_interacting_residues=(False, False, False))
This function returns either an img or a matplotlib object of protein RMSF plot
 
_b_factor_valid(self, b_factor)
If b factor values are not available don't plot them
 
_gen_protein_rmsf_ax(self, ax, rmsf_l0, rmsf_l1, sse_l0, sse_l1, b_factor, contact_data, show_res_type=None, fsize=8)
Given an matplotlib ax object, setup the plot...
 
_protein_rmsd(self)
 
_get_protein_rmsd_text(self)
 
_get_protein_lambda_rmsd_plot(self, rmsd_l0, rmsd_l1, ts, ts_max)
 
_get_pair_rmsd_plot(self, val0, val1, ts, ts_max, names, ylabel='RMSD ($\\AA$)', y_inch=1.8, for_print=False)
 
_create_pair_rmsd_fig(self, val0, val1, ts, ts_max, names, fig, ylabel='RMSD ($\\AA$)', for_print=False)
 
_get_sequence_viewer_image(self)
Generate protein sequence image, given a protein structure Returns a platypus image
 
_free_energy_convergence_profiles(self)
 
_get_free_energy_convergence_text(self)
 
_gen_free_energy_convergence_table(self, df_per_replica, dg, bootstrap_std, analytical_std)
 
_gen_free_energy_convergence_plot(self, start_time, end_time, dG_forward, dG_forward_err, dG_reverse, dG_reverse_err, dG_sliding, dG_sliding_err)
 
_gen_free_energy_convergence_fig(self, start_time, end_time, dG_forward, dG_forward_err, dG_reverse, dG_reverse_err, dG_sliding, dG_sliding_err, fig, for_print=True)
 
_reaction_details(self)
 
_ligand_perturbation_details(self)
 
_generate_2d_lig_images(self)
Generate 2d images of the ligands.
 
_generate_aligned_2d_lig_pair(self)
Generate *aligned* 2d images of the ligands.
 
_protein_details(self)
 
get_2d_ligand_image(self, lig_st)
 
_get_2d_ligand_image(self, st)
 
_get_temp_image_fn(self, prefix='')
 
_report_fep_simulation_details(self)
 
error(self, msg)
 
str(self, str_in)
This is to remove the "'s in ARK returned strings enclosed in double quotes

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
canvas2d.ChmMol
_st_to_chmmol(ligand_st)
Convert ligand_st to Canvas 2d structure
 
_lid_add_lig_water_exposed(res_label, sk, ligand_st, lig_noh_dict, ligand_atoms)
 
_lid_add_water_br(res_label, sk, already_added_res_dict, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
`res_label' for water-mediated interactions looks like this:...
 
_lid_add_hydrophobic(res_label, sk, already_added_res_dict)
`res_label` for non-specific hydrophobic interactions looks like this:...
 
_lid_add_picat(res_label, sk, already_added_res_dict, lig_atom_dict, ligand_atoms)
`res_label` for pi-cat interactions looks like this:...
 
_lid_add_pipi(res_label, sk, already_added_res_dict, lig_atom_dict, ligand_atoms)
`res_label` for pi-pi interactions looks like this:...
 
_lid_add_prot_metal(res_label, sk, already_added_metal_dict, already_added_res_dict)
`res_label' for metal-protein mediated interactions looks like this:...
 
_lid_add_lig_metal(res_label, sk, already_added_metal_dict, lig_atom_dict, ligand_atoms)
`res_label' for metal-ligand mediated interactions looks like this:...
 
_lid_add_intramolecular_hb(res_label, sk, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
res_label for internal (intramolecular) hydrogen bonds looks like this:...
 
_lid_add_ionic(res_label, sk, already_added_res_dict, lig_noh_dict, ligand_atoms)
res_label for ionic bonds looks like this:...
 
_lid_add_hbonds(res_label, sk, already_added_res_dict, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
res_label for hydrogen bonds looks like this:...
Class Variables [hide private]
  HELIX = 'helix'
  STRAND = 'strand'
  HELIX_COLOR = '#F06040'
  STRAND_COLOR = '#40C0E0'
  B_FACTOR = '#9400D3'
  VERBOSE = False
hash(x)
Properties [hide private]
  get_rest_density_text

Inherited from object: __class__

Method Details [hide private]

__init__(self, fep_edge_data, basename=None, perturbation_type='small_molecule')
(Constructor)

 

This class generates a PDF report for an FEP/REST (+) type of job. Both Legs of the simulations are processed in the FEPEdgeData and is used by this class to compile a result.

Parameters:
  • fep_edge_data (FEPEdgeData) - Object containing all the data for this report
  • basename (string) - the basename of the file of the PDF report
  • perturbation_type (str) - Type of PRM job it was
Overrides: object.__init__

_st_to_chmmol(ligand_st)
Static Method

 

Convert ligand_st to Canvas 2d structure

Parameters:
  • ligand_st (schrodinger.structure) - Ligand structure
Returns: canvas2d.ChmMol
Canvas molecule

_lid_add_water_br(res_label, sk, already_added_res_dict, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
Static Method

 

`res_label' for water-mediated interactions looks like this:
   (0.610, 'B:LEU_52:O', [-7.148, -19.094, -5.2140861], 3702)
   (freq, prot_label, prot_xyz, ligand_aid)

_lid_add_hydrophobic(res_label, sk, already_added_res_dict)
Static Method

 

`res_label` for non-specific hydrophobic interactions looks like this:
 (0.801, 'B:LEU_52', [-5.9, -21.1, -5.4],
                            [3694, 3695, 3696, 3709, 3710, 3711])
    (freq, prot_label, [prot_xyz], fragment_aids)

_lid_add_picat(res_label, sk, already_added_res_dict, lig_atom_dict, ligand_atoms)
Static Method

 

`res_label` for pi-cat interactions looks like this:
 (0.16, 'B:ARG_77:CZ', [-5.9, -11.1, -5.9], [698, 699, 701, 702, 700])
    (freq, prot_label, [prot_xyz], lig_ring_aids)
in case the aromatic group is on the protein, and charged group on the
ligand:
 (1.0, 'B:TYR_99', [13.404797, 3.522047, 15.211519], 2945)
  (freq, prot_label (aromatic) , [prot_xyz], ligand_aid)

_lid_add_pipi(res_label, sk, already_added_res_dict, lig_atom_dict, ligand_atoms)
Static Method

 

`res_label` for pi-pi interactions looks like this:
 (0.068, 'B:TYR_14', [4.0, -22.1, -8.7], [3698, 3699, 3701, 3702, 3700],
                                                                    0.0)
   (freq, prot_label, [Calpha_xyz], ligand_rings_aid, f2f_fraction)

_lid_add_prot_metal(res_label, sk, already_added_metal_dict, already_added_res_dict)
Static Method

 

`res_label' for metal-protein mediated interactions looks like this:
 (1.0, 'A:ASP_116:OD1', 1511, [9.3, 17.1, -3.8], 1, [7.4, 16.6, -5.2])
   (freq, prot_label, Calpha_aid, [Calpha_xyz], metal_aid,
                                            metal_label, metal_xyz)

_lid_add_lig_metal(res_label, sk, already_added_metal_dict, lig_atom_dict, ligand_atoms)
Static Method

 

`res_label' for metal-ligand mediated interactions looks like this:
 (1.0, 'L-FRAG_0:O1754', 1754, [9.4, 16.6, -7.0], 1, [7.4, 16.6, -5.2])
   (freq, lig_label, [ligand_xyz], metal_aid, metal_label, metal_xyz)

_lid_add_intramolecular_hb(res_label, sk, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
Static Method

 

res_label for internal (intramolecular) hydrogen bonds looks like this:
 (0.123, 4720, 4764)
 freq, lig_donor_aid, lig_acceptor_aid

_lid_add_ionic(res_label, sk, already_added_res_dict, lig_noh_dict, ligand_atoms)
Static Method

 

res_label for ionic bonds looks like this:
 (0.0148, 'B:ARG_13:NH2', 180, [4.014, -2.630, 8.924], 2357)
 freq, prot_label, prot_aid, [prot_ xyz], lig_aid

_lid_add_hbonds(res_label, sk, already_added_res_dict, ligand_st, lig_atom_dict, lig_noh_dict, ligand_atoms)
Static Method

 

res_label for hydrogen bonds looks like this:
 (0.40, 'A:LYS_97:HZ1', 2005, [-9.87, 7.35, -35.22], 'L-FRAG_0:O16', 16)
 frequency, prot_label  prot_aid,  [xyz], lig_label,  lig_aid

get_structure_item(self, st)

 

Returns structure as a graphic item to draw and to annotate.

Parameters:
  • st - Structure to draw in 2D
Returns: structure2d.structure_item
Structure item to be drawn in 2D.

remove_last_atom_highlight(self, lig_item)

 

Removes previously highlighted atoms, if any, in a torsion.

Parameters:
  • lig_item (structure2d.structure_item) - Ligand structure item.

add_atom_highlight(self, lig_item, torsion, color)

 

Add new highlight for atoms in the given torsion.

Parameters:
  • lig_item (structure2d.structure_item) - Ligand structure item.
  • torsion (fep_edge_data.FEPTorsions) - Ligand torsion to highlight
  • color (QtGui.QColor) - Highlight color

on_move(self, event)

 

If the mouse is inside a torsion plot, highlight the 1st and 4th atoms in that torsion in the structure.

Because torsions can spread to multiple tabs (or pages), need to access figure and structure items for each tab.

Parameters:
  • event (matplotlib.backend_bases.MouseEvent) - The mouse event that triggered this callback

_highlight_matching_torsion_atoms(self, row, tors, lig_item, color)

 

Highlight atoms in a torsion that matches the plot where the mouse is in.

Parameters:
  • row (int) - Row index of the torsion plot that the mouse is in
  • tors (list) - List of torsions from a ligand
  • lig_item (structure2d.structure_item) - Structure item for a ligand.
  • color (QtGui.QColor) - Color used to highlight the atoms.

create_torsions_plot(self, fig, tors1, tors2, tors_from, tors_to, ipage=None, structure1_item=None, structure2_item=None, for_print=False)

 

Creates a plot for torsions using the given matplot figure.

Parameters:
  • fig (matplotlib.figure.Figure) - Figure to draw the torsion subplots in.
  • tors1 - List of torsions from ligand 1.
  • tors2 (list) - List of torsions from ligand 2.
  • tors_from (int) - Starting torsion index.
  • tors_to (int) - Ending torsion index
  • ipage (int or None) - Page index of the torsions, only needed for interactively highlighting torsion atoms.
  • structure1_item (structure2d.structure_item or None) - Structure item 1, only needed for interactively highlighting torsion atoms.
  • structure2_item (structure2d.structure_item or None) - Structure item 2, only needed for interactively highlighting torsion atoms.
  • for_print (bool) - Whether the figure is used for print.

_add_sse_span(self, ax, data_limits, color)

 

Setup overlay for SSE elements
@param ax:          matplotlib plot
@type  ax:          matplotlib.ax
@param data_limits: list of ranges for secondary structure elements
                    along the residue index
@type  data_limits: L{(from,to)}
@param color:       which color to use
@type  color:       matplotlib color, either string or hex

_add_b_factor(self, ax2, b_data, color, y_range_ratio, fsize=8)

 

Add B factor to the plot, on the Y2 axis. scale the Y2 axis to be compatible with Y1 axis.

Parameters:
  • ax2 (matplotlib.ax (twinx/Y2 axis)) - matplotlib plot
  • b_data (dict) - dictionary with b factor values for each residue
  • color (matplotlib color, either string or hex) - which color to use
  • y_range_ratio (float) - a ratio by which to scale the Y2-axis
  • fsize (int) - font size to use in plots
Returns: str
a title of the plot for legends

_add_interacting_residues(self, ax, show_res, vals, color, ymin=0)

 

Draw a vertical bar for reisdues that interact with the ligand

Parameters:
  • ax (matplotlib.ax) - matplotlib plot
  • show_res (int) - residues index to add the vbar to
  • vals (float) - the hight of the vbar
  • color (matplotlib color, either string or hex) - which color to use
  • ymin (float) - the starting y-position of the bar

get_protein_rmsf(self, for_print=True, fig=None, show_sse=False, show_b_factor=False, show_interacting_residues=(False, False, False))

 

This function returns either an img or a matplotlib object of protein RMSF plot

Parameters:
  • for_print (bool) - return an image for PDF if True otherwise return matplotlib object
  • fig (matplotlib.figure.Figure) - matplotlib Figure object
  • show_sse (bool) - overlay secondary structure information on RMSF plot
  • show_b_factor (bool) - overlay b factor on the y2 axis
  • show_interacting_residues ((common, uniq_lig1, uniq_lig2)) - a tuple with residue indices that correspond to different contacts for ligand1, ligand2, and common
Returns: image | matplotlib ax obj
returns either an image or an matplotlib object, depends on the for_print variable

_gen_protein_rmsf_ax(self, ax, rmsf_l0, rmsf_l1, sse_l0, sse_l1, b_factor, contact_data, show_res_type=None, fsize=8)

 

Given an matplotlib ax object, setup the plot
@param rmsf_l0:      list of rmsf valuse for protein in lambda0 sim
@type  rmsf_l0:      L{float}
@param rmsf_l1:      list of rmsf valuse for protein in lambda1 sim
@type  rmsf_l1:      L{float}
@param sse_l0:       A dictionary with 'helix' and 'strand' values which
                     contain limits of all the SSE in lambda0 protein
@type  sse_l0:       dict{'helix_limits', 'strand_limits'}
@param sse_l1:       A dictionary with 'helix' and 'strand' values which
                     contain limits of all the SSE in lambda1 protein
@type  sse_l1:       dict{'helix_limits', 'strand_limits'}
@param b_factor:     dictionary of b factor values for each residue
@type  b_factor:     dict{'residue_id'}
@param contact_data: a dictionary with residue indices that correspond
                     to different contacts for ligand1, ligand2, and
                      common
@type  contact_data: dict{'common', 'uniq_lig1', 'uniq_lig2'}
@param show_res_type: to show contact residues
@type  show_res_type: bool

_get_pair_rmsd_plot(self, val0, val1, ts, ts_max, names, ylabel='RMSD ($\\AA$)', y_inch=1.8, for_print=False)

 
Parameters:
  • rmsd_l0 (float) - list of RSMD values in angstroms for lambda=0
  • rmsd_l1 (float) - list of RSMD values in angstroms for lambda=1
  • ts (float) - list of simulation times for each snapshot
  • ts_max (float) - simulation time
  • names (str) - List of names that that are in the legend
  • ylabel (str) - Label that goes on the y-axis
  • y_inch (float) - height of the image returned
  • for_print (bool) - Bool if the figure will be used for print

_generate_2d_lig_images(self)

 

Generate 2d images of the ligands. Try to align them first, or just regular 2d images, if nothing works, return a string.


Property Details [hide private]

get_rest_density_text

Get Method:
unreachable.get_rest_density_text(self)