Command line subpackage

Commad line facility for SIMBAD scripts

class LogColorFormatter(fmt=None, datefmt=None)[source]

Bases: logging.Formatter

Formatter for log messages

Methods

converter(…) Convert seconds since the Epoch to a time tuple expressing local time.
formatException(ei) Format and return the specified exception information as a string.
formatTime(record[, datefmt]) Return the creation time of the specified LogRecord as formatted text.
usesTime() Check if the format uses the creation time of the record.
format  
format(record)[source]
class LogColors[source]

Color container for log messages

COLORS = {‘DEBUG’: 34, ‘DEFAULT’: 0, ‘CRITICAL’: 31, ‘WARNING’: 33, ‘ERROR’: 31}
class LogController(reset=True)[source]

Bases: object

Controller class for log messaging

Methods

add_console  
add_logfile  
close  
get_levelname  
get_logger  
level_valid  
reset  
add_console(level=’info’, format=’%(message)s’, stream=<open file ‘<stdout>’, mode ‘w’>)[source]
add_logfile(file, level=’info’, format=’%(message)s’)[source]
close()[source]
get_levelname(level)[source]
get_logger()[source]
static level_valid(level)[source]
reset()[source]
class LogLevels[source]

Log level container

LEVELS = {‘INFO’: 20, ‘WARNING’: 30, ‘CRITICAL’: 50, ‘ERROR’: 40, ‘DEBUG’: 10, ‘NOTSET’: 0}
ccp4_root()[source]

Run CCP4 specific checks to check if it was setup correctly

Returns:
str

The path to the CCP4 root directory

Raises:
KeyError

Cannot find CCP4 installation

KeyError

$CCP4_SCR environment variable not set

ValueError

Cannot find the $CCP4_SCR directory

ccp4_version()[source]

Identify the CCP4 version

Returns:
obj

A StrictVersion object containing the CCP4 version

Raises:
RuntimeError

Cannot determine CCP4 version

cleanup(directory, csv, results_to_keep)[source]

Function to clean up working directory results not reported by GUI

get_work_dir(run_dir, work_dir=None, ccp4_jobid=None, ccp4i2_xml=None)[source]

Figure out the relative working directory by provided options

make_workdir(run_dir, ccp4_jobid=None, ccp4i2_xml=None, rootname=’SIMBAD_’)[source]

Make a work directory rooted at work_dir and return its path

Parameters:
run_dir : str

The path to a run directory

ccp4_jobid : int, optional

CCP4-assigned job identifier

ccp4i2_xml : str, optional

Path to CCP4 I2 XML output (just used to indicate running under CCP4 I2)

rootname : str, optional

Base name of the SIMBAD directory [default: ‘SIMBAD_’]

Returns:
work_dir : str

The path to the working directory

Raises:
ValueError

There is an existing SIMBAD CCP4 work directory

print_header()[source]

Print the header information at the top of each script

submit_mr_jobs(mtz, mr_dir, search_results, refine_type, args)[source]

Function to submit molecular replacement jobs

Parameters:
mtz : str

Path to input mtz file

models_dir : str

Path to input models directory

mr_dir : str

Path to directory where MR will be run

search_results : list

list of results from SIMBAD search

refine_type : str

The type of refinement to run

Returns:
object

MrSubmit object containing results from MR