choppa.render.InteractiveView
- class choppa.render.InteractiveView(filled_aligned_fitness_dict, complex, complex_rdkit, fitness_threshold, output_session_file='out.html')[source]
Uses 3DMol and Jinja to create a single HTML file that can be hosted anywhere to enable shareable interactive views of the fitness data on top of the complex PDB
- __init__(filled_aligned_fitness_dict, complex, complex_rdkit, fitness_threshold, output_session_file='out.html')[source]
Methods
__init__(filled_aligned_fitness_dict, ...[, ...])Figures out what the global maximum and minimum is of the confidence measures (e.g. number of reads) in the experimental protocol of the fitness data.
Generates interactions to be displayed on the interactive HTML view.
get_logoplot_dict(confidence_lims[, ...])For a fitness dict, load all base64 logoplots into memory using multithreading if requested.
Based on fitness coloring, creates a dict where keys are colors, values are residue numbers.
inject_stuff_in_template(sdf_str, pdb_str, ...)"
render()surface_coloring_dict_to_js(color_res_dict)Transforms a dictionary of residue indices per color (hex) to a JavaScript-compatible string.
- get_confidence_limits()[source]
Figures out what the global maximum and minimum is of the confidence measures (e.g. number of reads) in the experimental protocol of the fitness data. If there is no confidence measure, returns False
- get_interaction_dict()[source]
Generates interactions to be displayed on the interactive HTML view. Interactions are colored by the same rules as for PyMOL (render.PublicationView()), but a dict of interactions is used which is generated in render.PublicationView().pymol_add_interactions().
- get_logoplot_dict(confidence_lims, multiprocess=True, max_workers=None)[source]
For a fitness dict, load all base64 logoplots into memory using multithreading if requested.
Instead of adding base64 strings to fitness dict (making it uninterpretable), make a separate dict that mimics the form of fitness dict.
- get_surface_coloring_dict()[source]
Based on fitness coloring, creates a dict where keys are colors, values are residue numbers.
- inject_stuff_in_template(sdf_str, pdb_str, surface_coloring, logoplot_dict)[source]
” Replaces parts of a template HTML with relevant bits of data to get to a HTML view of the (ligand-) protein, its fitness and its interactions (if any).
Uses Jinja2 templating to render based on static HTML template.