jade.rosetta_jade package

jade.rosetta_jade.BenchmarkInfo module

class jade.rosetta_jade.BenchmarkInfo.BenchmarkInfo(decoy_path, full_name, final_name, scorefunction='talaris2014')[source]

Simple Class for holding info for a particular benchmark. Parses the Run_Settings.txt file in the decoy directory. This file is output by RunRosettaBenchmarks.

The settings dictionary then holds key/value pairs. Here is an example of this file for RAbD:

CDR = ALL DATASET = bm2_ten DOCK = False INNER_CYCLE_ROUNDS = 1 INPUT_PDB_TYPE = pareto L_CHAIN = kappa MINTYPE = relax OUTER_CYCLE_ROUNDS = 100 PAPER_AB_DB = True PROTOCOL = even_cluster_mc RANDOM_START = True REMOVE_ANTIGEN = True SEPARATE_CDRS = False

get_dataset()[source]

Get the dataset used for benchmarking. :rtype: str

get_decoy_path()[source]

Get the directory of all of the decoys for this benchmark. :rtype:

get_final_name()[source]

Get the final name of the benchmark (used mainly for features dbs or comparisons between benchmarks.) :rtype: str

get_full_name()[source]

Get the full name of the benchmark. :rtype: str

get_input_pdb_type()[source]

Get the input pdb type used, ex: native vs pareto :rtype: str

get_scorefunction_name()[source]

Get the scorefunction name set in this info instance. :rtype: str

has_log_path()[source]
jade.rosetta_jade.BenchmarkInfo.get_run_settings(dir, fname='RUN_SETTINGS.txt')[source]

Gets a dict of the settings used to run the benchmark in the directory.

The settings file looks like this, and is output by RunRosettaBenchmarks into the decoy directory:

CDR = ALL DATASET = bm2_ten DOCK = False INNER_CYCLE_ROUNDS = 1 INPUT_PDB_TYPE = pareto L_CHAIN = kappa MINTYPE = relax OUTER_CYCLE_ROUNDS = 100 PAPER_AB_DB = True PROTOCOL = even_cluster_mc RANDOM_START = True REMOVE_ANTIGEN = True SEPARATE_CDRS = False
Parameters:dir – str
Return type:defaultdict

jade.rosetta_jade.FeaturesJsonCreator module

class jade.rosetta_jade.FeaturesJsonCreator.JsonCreator(out_path, script_type)[source]

Basic implementation of a simple JsonCreator to create Jsons. Could be expanded to not load jsons with pre-set scripts. A nicer implementation would be a GUI for running the FeaturesReporter scripts.

add_features_script(rel_script_path)[source]

Add a features script to run.

add_output_method(output_method)[source]

Add an output method

add_sample_source_info(db_path, id, ref=False)[source]
run_json(backround=False)[source]
save_json(out_path='local_json.txt')[source]
jade.rosetta_jade.FeaturesJsonCreator.add_sample_source(json_dict, sample_source_dict)[source]
jade.rosetta_jade.FeaturesJsonCreator.append_scripts_formats_to_json_dict(data, json_dict)[source]
jade.rosetta_jade.FeaturesJsonCreator.initialize_json_dict(out_dir)[source]
jade.rosetta_jade.FeaturesJsonCreator.run_features_json(json_path, backround=False, outpath='')[source]

Convenience function Outputs an R script for running a JSON file, and runs it. Works with the new Library structure of the Features Reporter Framework.

jade.rosetta_jade.FeaturesJsonCreator.run_features_json_old(json_path, backround=False, outpath='')[source]

Convenience function Run compare_sample_sources with json path.

jade.rosetta_jade.FeaturesJsonCreator.setup_baseline_scripts_and_formats(json_dict, type)[source]
jade.rosetta_jade.FeaturesJsonCreator.write_json_for_single_recovery_experiment(db_path_exp, db_path_natives, exp_id, out_path)[source]

Create a JSON file for recovery of a single experiment.

jade.rosetta_jade.Region module

jade.rosetta_jade.RunRosetta module

class jade.rosetta_jade.RunRosetta.RunRosetta(program=None, parser=None, db_mode=False, json_run=None)[source]

Bases: object

local_run(*args, **kwargs)[source]

Get if we are running locally :rtype: bool

run(*args, **kwargs)[source]
jade.rosetta_jade.RunRosetta.get_option_strings(cmd)[source]

Get the options as a string to be printed or saved to a file. :param cmd: :rtype: str

jade.rosetta_jade.RunRosetta.print_full_cmd(cmd, script_path=None)[source]
jade.rosetta_jade.RunRosetta.run_on_qsub(cmd, queue_dir, name, print_only=False, extra_opts='')[source]
jade.rosetta_jade.RunRosetta.run_on_slurm(cmd, queue_dir, name, nodes=False, ntasks=None, print_only=False, extra_opts='')[source]
jade.rosetta_jade.RunRosetta.write_queue_file(cmd, queue_dir, name)[source]

jade.rosetta_jade.RunRosettaBenchmarks module

class jade.rosetta_jade.RunRosettaBenchmarks.RunRosettaBenchmarks(program=None, parser=None)[source]

Bases: jade.rosetta_jade.RunRosetta.RunRosetta

run()[source]

Run All Benchmarks. This code callse the following:

run -> _get_list_of_benchmarks -> run_benchmark
Returns:
run_benchmark(benchmark_names, benchmark_options)[source]

Run a single benchmark with options.

Parameters:
  • benchmark_names – List of benchmark names
  • benchmark_options – List of benchmark options
Returns:

jade.rosetta_jade.ScoreFiles module

class jade.rosetta_jade.ScoreFiles.ScoreFile(filename)[source]
get_Dataframe(scoreterms=None, order_by='total_score', top_n=-1, reverse=True)[source]

Get data as a pandas dataframe. Definitely preferred now. :param scoreterms: list :param order_by: str :param top_n: int :param reverse: bool :rtype: pandas.DataFrame

get_decoy_count()[source]
get_decoy_names()[source]
get_ordered_decoy_list(scoreterm, decoy_names=None, top_n=-1, reverse=False)[source]

Get an ordered tuple of [[score, decoy_name], …] Will automatically order some known scoreterms (hbonds_int, dSASA_int)

Return type:list[list]
get_score(decoy, scoreterm)[source]

Get Score of a particular decoy and scoreterm :param decoy: str :param scoreterm: str :rtype: float

get_scores(scoreterm, decoy_names=None, top_n=-1, reverse=False)[source]
get_scoreterm(scoreterm)[source]
get_scoreterm_names()[source]
get_scoreterms(scoreterms='')[source]
get_stats(scoreterms='', decoy_names=None)[source]
jade.rosetta_jade.ScoreFiles.get_scorefiles(indir='/home/docs/checkouts/readthedocs.org/user_builds/bio-jade/checkouts/latest/docs')[source]

Get Score files from a directory. Walk through all directories in directory. :param indir: str :rtype: list

jade.rosetta_jade.ScoreFiles.plot_score_vs_rmsd(df, title, outpath, score='total_score', rmsd='looprms', top_p=0.95, reverse=True)[source]

Plot a typical Score VS RMSD using matplotlib, save it somewhere. Return the axes. By default, plot the top 95% :param df: pandas.DataFrame :param outpath: str :param score: str :param rmsd: str :rtype: matplotlib.Axes

jade.rosetta_jade.ScoreFiles.pymol_session_on_top_df(df, outdir, decoy_dir=None, scoreterm='total_score', top_n=10, decoy_column='decoy', native_path=None, out_prefix_override=None, ab_structure=False, superimpose=False, run_pymol=True)[source]

Make a PyMol session (or setup a scripter) on top X using a dataframe. Return the scripter for extra control.

df should have an attribute of ‘name’ or out_prefix_override should be set.

Parameters:
  • df – pandas.DataFrame
  • outdir – str
  • decoy_dir – str
  • scoreterm – str
  • top_n – int
  • decoy_column – str
  • native_path – str
  • out_prefix_override – str
  • ab_structure – boolean
  • superimpose – boolean
Return type:

PyMolScriptWriter

jade.rosetta_jade.SetupRosettaOptionsBenchmark module

class jade.rosetta_jade.SetupRosettaOptionsBenchmark.SetupRosettaOptionsBenchmark(json_file)[source]

Bases: jade.rosetta_jade.SetupRosettaOptionsGeneral.SetupRosettaOptionsGeneral

Class for setting up Rosetta Benchmarks. See database/rosetta/benchmark_jsons_rabd/nstruct_test.json for an example.

Basically, a set of benchmarks and rosetta options are given in the JSON. Other keys can be specified for specific benchmarks (like the instructions file stuff in the above file.)

This can be used to use a single JSON file and run RosettaMPI on ALL combinations of benchmarks given.

get_benchmark_names(only_rosetta=False)[source]

Get the names of all the benchmarks we will run.

Each benchmark must have a dictionary that defines ‘benchmarks’ as a list. You may optionally give the rosetta_option. Currently, your subclass of RunRosetta will need to code how all this is run. Hopefully, that will change.

If only_rosetta is true, will only give the benchmark names that are based on rosetta options.

For example:

“outer_cycle_rounds”:{
“rosetta_option”:”-outer_cycle_rounds”, “benchmarks”:[ 25, 50, 75, 100]

},

Return type:list
get_benchmarks_of_key(benchmark_name)[source]

Get the list of benchmarks for a particular benchmark key. :param benchmark_name: str :rtype: list

get_exp()[source]

Get the benchmark name or fail. :rtype: str

get_non_rosetta_option_benchmark_names()[source]

Similar to get_benchmark_names, but only for options which do not have the tag rosetta_option

Return type:list
get_rosetta_option_of_key(benchmark_name)[source]

Get the Rosetta option :param benchmark_name: :rtype: str

use_benchmark_for_outdir(benchmark)[source]

Should we use the benchmark name for output?

Specified by the ‘use_for_outdir’ in JSON. If not specified, or benchmark not in list, we assume True!
Parameters:benchmark – str
Return type:bool
use_benchmark_for_prefix(benchmark)[source]

Should we use the benchmark name for prefix?

Specified by the ‘use_for_prefix’ in JSON. If not specified, or benchmark not in list, we assume True!
Parameters:benchmark – str
Return type:bool

jade.rosetta_jade.SetupRosettaOptionsGeneral module

class jade.rosetta_jade.SetupRosettaOptionsGeneral.SetupRosettaOptionsGeneral(cluster_json_file)[source]

Bases: object

Class for setting up more general Rosetta options for benchmarking and repeatable runs on different clusters. Useful for benchmarking. Subclass for adding more benchmarking settings for specific benchmarks.

get_base_rosetta_flag_string(indir_root=None)[source]
Get the full flag string for output. Optionally give indir_root for subclasses that require setting of different
directories, but with same root as given in the cluster file. Used primarily for complicated benchmarks.
get_db_mode()[source]
get_indirs()[source]
get_machine_file()[source]
get_nstruct()[source]
get_program()[source]
get_root()[source]
get_xml_script()[source]
get_xml_var_string()[source]

jade.rosetta_jade.alignment module

jade.rosetta_jade.alignment.align_to_second_pose_save_pdb(pose_name, pose, second_pose, outdir, overhang=0, stem_align=False)[source]
jade.rosetta_jade.alignment.get_map_for_rmsd(pose, second_pose, overhang=3)[source]
jade.rosetta_jade.alignment.get_mask_for_alignment(pose, second_pose, overhang=0)[source]

Get mask assuming they are both the same length!

jade.rosetta_jade.alignment.get_mask_for_stem_alignment(pose, second_pose, stem_size)[source]
jade.rosetta_jade.alignment.get_rmsd(pose, second_pose, overhang=0)[source]

Get RMSD assuming they are both the same length!

jade.rosetta_jade.features module

jade.rosetta_jade.features.create_features_db(pdb_list, xml_name, compiler, score_weights, out_db_name, out_db_batch, outdir, use_present_dbs, indir='', mpi=True, np=5)[source]

old_db_name = outdir+’/’+out_db_name+’.’+score_weights+”.db3” new_db_name = outdir+’/’+out_db_name+’.’+xml_name+’.’+score_weights+”.db3” if os.path.exists(old_db_name):

os.system(‘mv ‘+old_db_name+’ ‘+new_db_name) print “Old db name already exists. Moving.” return
jade.rosetta_jade.features.rm_features_dbs(outdir, out_names)[source]

jade.rosetta_jade.flag_util module

jade.rosetta_jade.flag_util.get_common_flags_string_for_init(flags_name='common_flags.flags')[source]

Get a string of common flags as specified in the database. :return: str

jade.rosetta_jade.score_util module

jade.rosetta_jade.score_util.parse_decoy_scores(decoy_path)[source]

Parse a score from a decoy and return a dictionary. :param decoy_path: :return: defaultdict