jade.basic package

jade.basic.RestypeDefinitions module

class jade.basic.RestypeDefinitions.ResTypeSergey(ignore_groups=[])[source]

Bases: object

Residue Types corresponding to Sergey Menis’ definition of groups.

common_groups(three_letter_one, three_letter_two)[source]

Return the intersection of groups. :return:

get_groups(three_letter_code)[source]
has_common_group(three_letter_one, three_letter_two)[source]
class jade.basic.RestypeDefinitions.RestypeDefinitions[source]
get_all_one_letter_codes()[source]
get_mutation_info()[source]
get_one_letter_from_three(three_letter_code)[source]
get_residue_info()[source]
get_three_letter_from_one(one_letter_code)[source]
is_conserved(query_three_letter, group_three_letter)[source]
set_mutation_info()[source]
set_residue_info()[source]

jade.basic.general module

jade.basic.general.extract_score_from_decoy(pdb_path)[source]

Extract total score from a rosetta decoy (gzipped or otherwise)

If score is not found, it will return 0.

Parameters:pdb_path
Returns:float
jade.basic.general.fix_input_args()[source]

Enables options to be passed to ArgumentParser with dashes, but not single charactor ones. Example:

–rosetta_args “-out:prefix test -out:path:all my/dir/”
Normally, this would fail if you had declared an -o option to the ArgumentParser.
This happens because although the quotes are being parsed correctly, the system is looking or options using the starting ‘-‘ charactor. If you give a quote and then a space, you will recieve no error.
This code essentially checks for single dashes and puts a space in front of them. Note that this does not work with single
charactor options you are hoping to pass with a quote. Because there is no way to grab the input string from the system and fix it myself, for these it will have to have a space after the quotes. This at least fixes the most common use cases (Mostly for use with Rosetta.).
jade.basic.general.get_all_combos(list_of_lists)[source]

Get all the position-specific combos of a list of lists.

This is taken directly from Stack Overflow:
http://stackoverflow.com/questions/798854/all-combinations-of-a-list-of-lists
Parameters:list_of_lists – A list of lists we would like combos of.
Return type:list[list]
jade.basic.general.get_platform()[source]

Get OS of the particular platform the toolkit is being run on.

jade.basic.general.get_rosetta_program(program, mpi=True, compiler='gcc')[source]

Get the set program

jade.basic.general.get_today()[source]
jade.basic.general.match_patterns(search_string, patterns)[source]

Uses RE to match multiple patterns. Returns boolean of success

Parameters:
  • search_string – str
  • patterns – [str]
Return type:

boolean

jade.basic.general.merge_dicts(*dict_args)[source]

Given any number of dicts, shallow copy and merge into a new dict, precedence goes to key value pairs in latter dicts. (Pre-Python 3.5) (http://stackoverflow.com/questions/38987/how-to-merge-two-python-dictionaries-in-a-single-expression)

jade.basic.general.strip_left(s, pattern)[source]

Strips a string left (start) of string if found. Otherwise, returns the original string.

Parameters:
  • s – str
  • pattern – str
Return type:

str

jade.basic.general.strip_right(s, pattern)[source]

Strips a string right (end) of string if found. Otherwise, returns the original string.

Parameters:
  • s – str
  • pattern – str
Return type:

str

jade.basic.numeric module

jade.basic.numeric.distance(x1, y1, z1, x2, y2, z2)[source]

Get the distance between variables. :param x1: float :param y1: float :param z1: float :param x2: float :param y2: float :param z2: float :rtype: float

jade.basic.numeric.distance_numpy(array1, array2)[source]

Get the distance between two points :param array1: numpy.Array :param array2: numpy.Array :rtype: float

jade.basic.numeric.geometric_mean(data)[source]

Get the geometric mean of the data. Useful for numbers that go from 0 -> and are a type of enrichment of the data.

Parameters:data – numpy.Array
Returns:float
jade.basic.numeric.get_n_s(num)[source]

Get a string for a float at .2f

jade.basic.numeric.get_perc(freq, total)[source]

Get percent

jade.basic.numeric.get_s_perc(freq, total)[source]

Get string of percent

jade.basic.numeric.linear_rescale(min, max, value)[source]

Linearly rescale a value to 0 and 1 using the min and max values. :param min: :param max: :param value: :rtype: float

jade.basic.numeric.wrapto360(angle)[source]

Wrap a value on -180, 180 to 360.

Parameters:degrees – float
Returns:float

jade.basic.path module

jade.basic.path.get_Jade_root()[source]

Get the root path of Jade directory. :rtype: str

jade.basic.path.get_all_pdb_paths(directory, ext='.pdb')[source]
jade.basic.path.get_all_pdbs(directory, ext='.pdb')[source]
jade.basic.path.get_bin_path()[source]

Get the path to the Jade apps directory :rtype: str

jade.basic.path.get_database_path()[source]

Get the path to the Jade Database :rtype: str

jade.basic.path.get_database_testing_path()[source]

Get the path to the database testing file. :return:

jade.basic.path.get_decoy_extension(decoy)[source]

Return the extension of the decoy. .pdb, .pdb.gz, .cif, .cif.gz, etc. :param decoy: str :rtype: str

jade.basic.path.get_decoy_name(decoy)[source]

Get the decoy name from path or name, whether .pdb, .pdb.gz or no extension. :param decoy: :rtype:str

jade.basic.path.get_decoy_path(decoy, alternate_paths=None)[source]

Search .pdb, .pdb.gz, .cif, .cif.gz, .xml, .xml.gz In addition, Search alternative search paths. Return found path or NONE.

Parameters:
  • decoy
  • alternate_paths

:rtype:str

jade.basic.path.get_directories_recursively(inpath)[source]

Get a list of directories recursively in a path. Skips hidden directories. :param inpath: str :rtype: list

jade.basic.path.get_file_paths(pattern, dir, ext='.pdb')[source]

Get file paths matching the exact pattern and extension. :param pattern: :param dir: :param ext: :return:

jade.basic.path.get_make_get_dirs(root, dirs)[source]

Recursively make dirs and return the final path :param root: :param dirs: :rtype: str

jade.basic.path.get_matching_pdbs(directory, pattern, ext='.pdb')[source]

Get pdbs in a directory matching a pattern. :param directory: :param pattern: :param ext: :return:

jade.basic.path.get_nnk_database_path()[source]
jade.basic.path.get_pdb_path(decoy, alternate_paths=None)[source]
jade.basic.path.get_rosetta_features_json_path()[source]
jade.basic.path.get_rosetta_features_root()[source]

Get the path to Rosetta features directory through set ROSETTA3_DB env variable. :rtype: str

jade.basic.path.get_rosetta_features_run_script()[source]

Get the path to Rosetta features script dir through the set ROSETTA3_DB env variable. :rtype: str

jade.basic.path.get_rosetta_flags_path()[source]
jade.basic.path.get_rosetta_json_run_path()[source]
jade.basic.path.get_testing_inputs_path()[source]

Get the path to testing inputs (PDBs,fasta,etc.) :rtype:str

jade.basic.path.get_testing_path()[source]

Get the path to the Jade testing directory :rtype: str

jade.basic.path.get_xml_scripts_path()[source]

Get the path to the Rosetta xml script directory. Useful for variable substitutions. :rtype: str

jade.basic.path.make_dir_if_not_exists(dir)[source]
jade.basic.path.open_file(file_path, mode='r')[source]

Open a file which can be gzipped.

Parameters:
  • file_path
  • mode
Returns:

jade.basic.path.parse_contents(file_path)[source]

Return a list of (stripped) content, skipping empty lines and comments. :param file: string :rtype: list