jade.pymol_jade package

jade.pymol_jade.PyMolScriptWriter module

class jade.pymol_jade.PyMolScriptWriter.PyMolScriptWriter(outdir)[source]

Class to help build PyMol scripts using arbitrary lists of PDBs.

Example for loading all top models into PyMol, aligning them to the native, and labeling them:

scripter = PyMolScriptWriter(outpath)

if native_path:
scripter.add_load_pdb(native_path, “native_”+os.path.basename(native_path))

scripter.add_load_pdbs(pdb_path_list, load_as_list) scripter.add_align_all_to(scripter.get_final_names()[0]) scripter.add_show(“cartoon”) scripter.add_line(“center”) scripter.add_save_session(pse_path) scripter.write_script(“load_align_top.pml”) run_pymol_script(top_dir+”/”+”load_align_top.pml”)

add_align_all(sele1='', sele2='', limit_to_bb=True, pair_fit=False)[source]

Align all to the first model

add_align_all_to(model, sele1='', sele2='', limit_to_bb=True, pair_fit=False)[source]

Align all to a particular model

add_align_to(model1, model2, sele1='', sele2='', limit_to_bb=True, pair_fit=False)[source]

Align one model to another, optionally specifying a selection. Recommended to use superimpose instead

add_antibody_script()[source]

Add running the color cdrs pymol script. Antibody must be in AHO numbering

add_center(sele=None)[source]
add_color(sele, color)[source]

Add color to a selection. sele: PyMol Selection color: Particular color.

See Also self.colors

add_group_object(name, new_group_name)[source]

Group a single object to another. Useful for meta-groups.

add_group_objects(names, new_group_name)[source]

Group a set of pre-loaded names to the new group.

add_hide(vis_type, sele='')[source]

Hide a representation. Optionally with a particular selection.

add_line(line)[source]

Add an arbitrary line to the script

add_load_pdb(pdb_path, load_as=None, group=None)[source]

Add line to load a PDB Path into PyMol Optionally load them as a particular name Will then set the final names PyMol uses to the object.

add_load_pdbs(pdb_paths, load_as=None, group=None)[source]

Add lines to load the list of PDB paths into PyMol Optionally load them as a particular name Will then set the final names PyMol uses to the object.

add_save_session(session_path)[source]

Add a line to save the session to a FULL path

add_select(name, sele, group=None)[source]
add_show(vis_type, sele='')[source]

Show a representation. Optionally with a particular selection

add_superimpose(sele1, sele2)[source]

Super impose two selections using the super command

add_superimpose_all_to(model, sele1, sele2)[source]
clear()[source]
get_color_types()[source]
get_colors_of_type(color_type)[source]
get_final_names()[source]

Get the final names PyMOL will use after loading PDBs.

get_sele(chain, resid_array)[source]

Get a a selection from an array of residue IDs and a particular chain. If the residue Id is a two-element tupple, then add a selection between the first and last element

get_vis_types()[source]
print_script()[source]
reset_script()[source]
run_script(script_outname='pml_script.pml', delete_script=True, parellel_process=False)[source]

Save and Run the Pymol script :param script_outname: str

save_script(fname=None)[source]
set_outdir(outdir)[source]
write_script(fname=None)[source]
jade.pymol_jade.PyMolScriptWriter.make_pymol_session_on_top(pdb_path_list, load_as_list, script_dir, session_dir, out_name, top_num=None, native_path=None, antibody=True)[source]

Make a pymol session on a set of decoys. Usually an ordered decoy list. :param top_dir: :param pdb_path_list: List of PDB Paths :param load_as_list: List of PDB Path names for pymol. :param outdir: :param out_name: :param top_num: :param native_path: :return:

jade.pymol_jade.PyMolScriptWriter.make_pymol_session_on_top_ab_include_native_cdrs(pdb_path_list, load_as_list, script_dir, session_dir, out_name, cdr_dir, top_num=None, native_path=None)[source]

Make a pymol session on a set of decoys. These decoys should have REMARK CDR_origin. These origin pdbs will be aligned and included in the pymol session :param top_dir: :param pdb_path_list: List of PDB Paths :param load_as_list: List of PDB Path names for pymol. :param cdr_dir: The directory of antibody CDRs from PyIgClassify. :return:

jade.pymol_jade.PyMolScriptWriter.make_pymol_session_on_top_scored(pdbpaths_scores, script_dir, session_dir, out_name, top_num=-1, native_path=None, antibody=True, parellel=True, super='', run_pymol=True, model_names=[])[source]

Make a pymol session on a set of decoys with a tuple of [[score, pdb], … ] Optionally, it can be a 3 length tupple with model name to use as last:

[[score, pdb, model_name], … ]

if run_pymol is False, will not run pymol.

Pymol names will be: model_n_RosettaModelNumber_score Score will be truncated to two decimal places.

Returns configured PyMol Scripter for extra use.

Parameters:
  • pdbpaths_scores – tuple of [[score, pdb], … ]
  • script_dir – Path to output PyMol script
  • session_dir – Path to output Session
  • out_name – name of the Pymol session
  • top_num – Optional - Only output TOP N models
  • native_path – Optional - Path to any input native to add to pymol session
  • parellel – Optional - Run in parellel (so many pymol sessions can be created at once)
  • super – Optional - Super to THIS particular selection instead of align_all to.
  • run_pymol – Optional - Run Pymol using script? Default true
Return type:

PyMolScriptWriter

jade.pymol_jade.PyMolScriptWriter.run_pymol_script(script_path, run_gui=False, delete_script=False, parellel_process=True)[source]

Run the script of the given path.