Example #1
0
from rSeq.utils.sitRep import start_sitrep
start_sitrep('/home/augustine/tmp/')
print "this should be stdOut!\nBut also this!\n"
raise Exception('This should be stdErr!')
                   help="""Include to redirect stdout and stderr to a central log file in out_dir. [useful for reproducibility and debugging] (default=%default)""")
 parser.add_option('--override', dest="override", action='store_true',default=False,
                   help="""A switch that causes the default --bt-opts to be replaced by those provided as arguments to --bt-opts instead of adding to them. (default=%default)""")
 
 (opts, args) = parser.parse_args()
 
 if len(sys.argv) == 1:
     parser.print_help()
     exit(0)
 if opts.out_dir:
     mkdirp(opts.out_dir)
     opts.out_dir = opts.out_dir.rstrip('/')
 else:
     opts.out_dir = os.getcwd()
 if opts.cent_log:
     start_sitrep(opts.out_dir)
 if not 'BOWTIE_INDEXES' in os.environ:
     raise Exception('ERROR: please set the BOWTIE_INDEXES environment variable!')
 try:
     opts.bt_index
     opts.bam_base
     opts.fastqs
 except KeyError:
     raise MissingArgumentError('missing at least one of the required command line arguments: --bt-index, --bam-base, --fastqs')        
 if not opts.override:
     opts.bt_opts = "%s %s" % (defaultBtOpts,opts.bt_opts)
 
 # Change to out_dir to make sure that any tempfiles are not droped in random
 #   places in the file system in case of fatal errors
 os.chdir(opts.out_dir)