SLiMSuite REST Server


Links
REST Home
EdwardsLab Homepage
EdwardsLab Blog
SLiMSuite Blog
SLiMSuite
Webservers
Genomes
REST Pages
REST Status
REST Help
REST Tools
REST Alias Data
REST API
REST News
REST Sitemap

rje_obj V2.9.0

Contains revised General Object templates for Rich Edwards scripts and bioinformatics programs

Module: rje_obj
Description: Contains revised General Object templates for Rich Edwards scripts and bioinformatics programs
Version: 2.9.0
Last Edit: 19/11/21

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


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

Function

This module contains updated Classes for use by all RJE scripts and bioinformatics programs. With time, all programs should be migrated over to the new objects. Miscellaneous methods will, for the most part, be kept in the rje module.

Commandline options are all in the form X=Y. Where Y is to include spaces, use X="Y". Commands in the form "-X Y" will also be recognised.

General Commandline

v=X : Sets verbosity (-1 for silent, 0 for no progress counters) [1]
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]
quiet=T/F : If set to True will not write to screen or log except for errors. [False]
errorlog=FILE : If given, will write errors to an additional error file. [None]
help : Print help to screen

Program-Specific Commands

basefile=FILE : This will set the 'root' filename for output files (FILE.*), including the log
outfile=FILE : This will set the 'root' filename for output files (FILE.*), excluding the log
delimit=X : Sets standard delimiter for results output files [\t]
mysql=T/F : MySQL output
append=T/F : Append to results files rather than overwrite [False]
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]
maxbin=X : Maximum number of trials for using binomial (else use Poisson) [-]
memsaver=T/F : Some modules will have a memsaver option to save memory usage [False]

System Commandline

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! )
runpath=PATH : Run program from given path (log files and some programs only) [path called from]
rpath=PATH : Path to installation of R ['R']
webserver=T/F : Trigger webserver run and output [False]
soaplab=T/F : Implement special options/defaults for SoapLab implementations [False]
rest=X : Variable that sets the output to be returned by REST services [None]
screenwrap=X : Maximum width for some screen outputs [200]
loadmod=T/F : Whether to try to load modules when checking for external programs [True]

Forking Commandline

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

Development Commandline

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]

Classes

[RJE_Object(log=None,cmd_list]{cmd:RJE_Object(log}=[]):
- 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
[Log(itime=time.time(),cmd_list]{cmd:Log(itime}=[]):
- Handles log output; printing to log file and error reporting
>> itime:float = initiation time
>> cmd_list:list of commandline variables

History Module Version History

    # 0.0 - Initial Compilation based on rje.py objects.
    # 1.0 - Fully working version, so upgraded to 1.0. Added dev and warn options.
    # 1.1 - Added rje_zen import and self.zen() to call rje_zen.Zen().wisdom().
    # 1.2 - Added warnLog functions.
    # 1.3 - Added perc cmdtype = float that is multiplied by 100.0 if < 1.0. Also added cmdtype = date for YYYY-MM-DD.
    # 1.4 - Added sourceDataFile() method from SLiMBench for wider use.
    # 1.5 - Added 'basefile' cmdlist types.
    # 1.6 - Added osx=T/F option for Mac-specific running options.
    # 1.7 - Added self.name() to basic object class.
    # 1.8 - Cleaned up some erroeneous opt, stat and info references.
    # 2.0 - Added self.file dictionary and methods for handling file handles with matching self.str filenames.
    # 2.1.0 - Added new built-in attributes/options for REST services.
    # 2.1.1 - Removed excess REST HTML methods.
    # 2.1.2 - Tweaked glist cmdRead warnings.
    # 2.1.3 - Modified integer commands to read/convert floats.
    # 2.2.0 - Added screenwrap=X.
    # 2.2.1 - Improved handling of integer parameters when given bad commands.
    # 2.2.2 - Updated error handling for full REST output.
    # 2.3.0 - Added quiet mode to object and stderr output.
    # 2.4.0 - Added vLog() and bugLog() methods.
    # 2.4.1 - Fixed bug where silent=T wasn't running silent.
    # 2.5.0 - Added flist command type that reads file lines as a list, ignoring commas.
    # 2.5.1 - Started updated formatting for Python3 compatibility.
    # 2.6.0 - Added threads() method to basic object.
    # 2.7.0 - Added loggedSystemCall()
    # 2.7.1 - Fixed formatting for Python 2.6 back compatibility for servers.
    # 2.7.2 - Tweaked the forks and threads settings and methods.
    # 2.7.3 - Added generic checkForProgram() method.
    # 2.8.0 - Added recognition of -cmd=ARG arguments.
    # 2.8.1 - Fixed ignoredate bug.
    # 2.9.0 - Expanded checkForProgram() method to

© 2015 RJ Edwards. Contact: richard.edwards@unsw.edu.au.