SLiMSuite REST Server

EdwardsLab Homepage
EdwardsLab Blog
SLiMSuite Blog
REST Pages
REST Status
REST Tools
REST Alias Data
REST Sitemap

rje V4.21.1

Contains SLiMSuite and Sequite General Objects

Module: rje
Description: Contains SLiMSuite and Sequite General Objects
Version: 4.21.1
Last Edit: 22/05/19

Copyright © 2005 Richard J. Edwards - See source code for GNU License Notice

See SLiMSuite Blog for further documentation. See rje for general commands.


General module containing Classes used by all SLiMSuite and Sequite programs plus a number of miscellaneous methods. Controls output to screen, commandline parameters and Log files.

Commandline options are all in the form X=Y or -X Y. Where Y is to include spaces, use X="Y".


General SLiMSuite Options

v=X : Sets verbosity (-1 for silent) [0]
i=X : Sets interactivity (-1 for full auto) [0]
log=FILE : Redirect log to FILE [Default = calling_program.log]
newlog=T/F : Create new log file. [Default = False: append log file]
silent=T/F : If set to True will not write to screen or log. [False]
errorlog=FILE : If given, will write errors to an additional error file. [None]
help : Print help to screen

Common Options (most programs)

basefile=FILE : This will set the 'root' filename for output files (FILE.*), including the log
delimit=X : Sets standard delimiter for results output files [\t]
force=T/F : Force to regenerate data rather than keep old results [False]
backups=T/F : Whether to generate backup files (True) or just overwrite without asking (False) [True]
rest=X : Variable that sets the output to be returned by REST services [None]

Forking Options (Some programs only)

noforks=T/F : Whether to avoid forks [False]
forks=X : Number of parallel sequences to process at once [0]
killforks=X : Number of seconds of no activity before killing all remaining forks. [36000]

Program-Specific Commands (Some programs only)

outfile=FILE : This will set the 'root' filename for output files (FILE.*), excluding the log
mysql=T/F : MySQL output
append=T/F : Append to results files rather than overwrite [False]
maxbin=X : Maximum number of trials for using binomial (else use Poisson) [-]

System Options

win32=T/F : Run in Win32 Mode [False]
osx=T/F : Run in MacOSX Mode [False]
pwin : Run in PythonWin (** Must be 'commandline', not in ini file! **)
cerberus : Run on Cerberus cluster at RCSI
memsaver=T/F : Some modules will have a memsaver option to save memory usage [False]
runpath=PATH : Run program from given path (log files and some programs only) [path called from]
rpath=PATH : Path to installation of R ['R']

Development Options

debug=T/F : Turn on additional debugging prints and prompts [False]
warn=T/F : Turn on program integrity check warnings (unless silent) [True]
test=T/F : Run additional testing methods and/or produce additional test outputs [False]
dev=T/F : Run development-specific code. (Added to keep main coding working during dev) [False]
webserver=T/F : Trigger webserver run and output [False]
soaplab=T/F : Implement special options/defaults for SoapLab implementations [False]


- Metclass for inheritance by other classes.
>> log:Log = rje.Log object
>> cmd_list:List = List of commandline variables
On intiation, this object:
- sets the Log object (if any)
- sets verbosity and interactive attributes
- calls the _setAttributes() method to setup class attributes
- calls the _cmdList() method to process relevant Commandline Parameters
- Handles log output; printing to log file and error reporting
>> itime:float = initiation time
>> cmd_list:list of commandline variables
Info(prog='Unknown',vers='X',edit='??/??/??',desc='Python script',author='Unknown',ptime=None):
- Stores intro information for a program.
>> prog:str = program name
>> vers:str = version number
>> edit:str = last edit date
>> desc:str = program description
>> author:str = author name
>> ptime:float = starting time of program, time.time()
- Handles basic generic output to screen based on Verbosity and Interactivity for modules without classes.
>> cmd:list = list of command-line arguments

History Module Version History

    # 0.0 - Initial Compilation based on RJE_General01.plx. Simplified Class Names
    # 0.1 - Added comments and changed capitilisation etc.
    # 0.2 - Added RJE_Object class and 'No Log' concept
    # 0.3 - Updated RJE_Object to not need Out object (restrict Out Object to Log object?)
    # 1.0 - Better Documentation to go with GASP V:1.2
    # 1.1 - Added make Path and sorted ErrorLog
    # 1.1 - def errorLog(self, text='Missing text for errorLog() call!',quitchoice=False,printerror=True):
    # 1.2 - Added Norman's error-tracking and 'basefile/outfile' options as Object defaults
    # 2.0 - Major Overhaul of Module. Out, Log and RJE_Object will now inherit RJE_Object_Shell (see also changes below)
    # 2.1 - Added X="Y" options
    # 2.2 - Added confirm=T/F option to choice()
    # 2.3 - Added more delimited text functions
    # 2.4 - Added listFromCommand() function
    # 2.5 - Added Force opt
    # 3.0 - Added self.list and self.dict dictionaries to RJE_Object. Added 'list', 'clist' and 'glist' to cmdRead.
    # 3.1 - Added object save and load methods
    # 3.2 - Added more refined path options
    # 3.3 - Added general delimitedFileOut() method based on compileOut()
    # 3.4 - Added cmdReadList for handling lists of "standard" options
    # 3.5 - Added getFileName for interactive input of file names with confirmation/existence options and checkInputFiles()
    # 3.6 - Added dataDict() method for extracting data from delimited file into dictionary
    # 3.7 - Added extra dictionary methods for storage and retrieval of results in a dict['Data'] dictionary
    # 3.8 - Gave module a general tidy up.
    # 3.9 - Added RunPath to control where program is run.
    # 3.10- Added errorlog=FILE option to redirect errors to an additional error file.
    # 3.11- Added dictionary ranking method.
    # 3.12- Added more list methods.
    # 4.0 - Added RJE_ObjectLite for data storage objects with minimal generic methods and attributes.
    # 4.1 - Added a bioware_server switch for reading iniServer/ ini files on bioware.
    # 4.2 - Modified INI reading across the board to look in ../settings/ and look for defaults.ini as well as rje.ini.
    # 4.2 - Enabled handing on -ini FILE in addition to ini=FILE.
    # 4.3 - Added ilist and nlist types to cmdRead for objects. (Lists of integers and floats). Add ratio() function.
    # 4.4 - Added lineFromIndex(target,file,re_index='^(\S+)\s',sortunique=False,xreplace=True).
    # 4.5 - Modified randomString() and added stringShuffle() methods.
    # 4.6 - Added dev and warn options. Fixed -h lack of help.
    # 4.7 - Added self.warn list and self.warnLog() functions to Log object. Modified i=-1 quitchoice to raise not quit.
    # 4.8 - Added perc cmdtype = float that is multiplied by 100.0 if < 1.0. Removed server option from iniCmds().
    # 4.9 - Added rje.slimsuite, which determines the slimsuite home directory from file path.
    # 4.10- Added osx=T/F option for Mac-specific running options.
    # 4.11- Enabled '\t#' comments in ini files. Modified getStrLC to return '' for 'none' by default. Added listMax().
    # 4.11- Added to basic object class.
    # 4.12- Added 'bool' and 'str' to _cmdRead() to ease switchover to new RJE_Objects.
    # 4.13.0 - Added new built-in attributes/options for REST services.
    # 4.13.1 - Fixed MemSaver typo in WarnLog output. Modified mkDir() to avoid clashes raising errors.
    # 4.13.2 - Removed excess REST HTML methods.
    # 4.13.3 - Added uselower=False to dataDict() method.
    # 4.13.4 - Added maxrep=X to listCombos() method.
    # 4.14.0 - Added listToDict() method.
    # 4.14.1 - Fixed matchExp method to be able to handline multilines. (Shame re.DOTALL doesn't work!)
    # 4.14.2 - Modified integer commands to read/convert floats.
    # 4.15.0 - Added intList() and numList() functions.
    # 4.15.1 - Fixed rare errorlog printlog error vicious cycle.
    # 4.16.0 - Added list2dict(inlist,inkeys) and dict2list(indict,inkeys) functions.
    # 4.16.1 - Improved handling of integer parameters when given bad commands.
    # 4.17.0 - Added extra functions to randomList()
    # 4.18.0 - Added Roman numeral functions.
    # 4.18.1 - Updated error handling for full REST output.
    # 4.18.2 - Fixed rje module call bug.
    # 4.19.0 - Tweaked Docstring. Added extra parameter catching. Added report of INI loading.
    # 4.19.1 - Added code for catching non-ASCII log filenames.
    # 4.20.0 - Added quiet mode to log object and output of errors to stderr. Fixed rankList(unique=True)
    # 4.21.0 - Added hashlib MD% functions.
    # 4.21.1 - Fixed bug where silent=T wasn't running silent.

© 2015 RJ Edwards. Contact: