ample.util.mrbump_util module

class NullHandler(level=0)[source]

Bases: logging.Handler

emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

class ResultsSummary(results=None, results_pkl=None)[source]

Bases: object

Summarise the results for a series of MRBUMP runs

analyseResult(result)[source]
createDict()[source]
extractResults(mrbump_dir, purge=False, max_loglevel=20)[source]
static jobSucceeded(job_dict)[source]
processMrbumpPkl(resultsPkl)[source]

Process dictionary

results_table(results)[source]
sortResults(prioritise=False)[source]

Wrapper function to allow calls with self

static sortResultsStatic(results, prioritise=False)[source]

Sort the results

summariseResults(mrbump_dir, max_loglevel=20)[source]

Return a string summarising the results

summaryString()[source]

Return a string suitable for printing the sorted results

topFiles(num_results=3)[source]

Return a list of dictionaries listing the top num_results PDB and MTZ files

Parameters:num_results (int) – How many of the top results to return
Returns:topf – A list of dictionaries, one per result, with xyz, mtz and info keys
Return type:list
checkSuccess(script_path)[source]

Check if a job ran successfully.

Parameters:script_path (str) – Path to the MrBUMP script
Returns:True if success
Return type:bool

Notes

Success is assumed as a SHELX CC score of >= SHELXSUCCESS

finalSummary(amoptd)[source]

Print a final summary of the job

job_unfinished(job_dict)[source]
purge_MRBUMP(amoptd)[source]

Remove as much as possible from a MRBUMP directory whilst keeping valid results

set_success_criteria(amoptd)[source]

Set the module-level success criteria from an AMPLE job dictionary

unfinished_scripts(amoptd)[source]

See if there are any unfinished mrbump jobs in a mrbump directory and return a list of the scripts

write_jobscript(name, keyword_file, amoptd, directory=None, job_time=86400, extra_options={})[source]

Create the script to run MrBump for this PDB.

write_mrbump_files(ensemble_pdbs, amoptd, job_time=172800, ensemble_options=None, directory=None)[source]

Write the MRBUMP job files for all the ensembles.

Arguments: ensemble_pdbs – list of the ensembles, each a single pdb file. amoptd – dictionary with job options. job_time – maximum permissible runtime (mainly used for batch queueing systems). ensemble_options – dictionary with ensemble-specific keywords e.g. ensemble_options[ensemble_name] = {‘ncopies’ : ncopies} directory – working directory to write files to.