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

Class FEPEdgeReportMaker

object --+
         |
        FEPEdgeReportMaker

Instance Methods [hide private]
 
__init__(self, fep_edge_data, basename=None, report_level=0)
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_text(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)
 
_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)
 
_create_pl_bar_fig(self, label, data_dict0, data_dict1, nframes, pl_interactions=ALL_PL_INTERACTIONS, name_1="Ligand 1", name_2="Ligand 2", fig=None, for_print=False)
 
_ligand_report(self)
Generate ligand report
 
_ligand_properties(self)
 
_ligand_rmsd_wrt_protein(self)
 
_get_ligand_wrt_prot_rmsd_text(self)
 
_get_ligand_wrt_prot_rmsd_plot(self, rmsd_l0, rmsd_l1, ts, ts_max)
 
_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
 
_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=r'RMSD ($\AA$)', y_inch=2.5, for_print=False)
 
_create_pair_rmsd_fig(self, val0, val1, ts, ts_max, names, fig, ylabel=r'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)
 
_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)
 
_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'
  REPORT_LEVELS = {0: 'Basic', 1: 'Secondary', 2: 'All'}
  HELIX_COLOR = '#F06040'
  STRAND_COLOR = '#40C0E0'
  B_FACTOR = '#9400D3'
  VERBOSE = False
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fep_edge_data, basename=None, report_level=0)
(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
  • report_level (int) - this class supports different levels of reporting. by default we'll report just the essential info. Secondary information will be shown if requested, this is the information that can be useful in some cases when troubleshooting the FEP job. The final option is to output *all* the information. where all the analysis types that we have can put in the report, however its usefulness is still in question
Overrides: object.__init__

get_rest_density_text(self)

 
Decorators:
  • @property

_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

_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=r'RMSD ($\AA$)', y_inch=2.5, 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.