pythonCmd += " --paired_end" pythonCmd += " --genome {genome}".format(genome=genome) if force: pythonCmd += " --force" pythonCmd += " {controlConf} {sampConf}".format(controlConf=controlConf,sampConf=sampConf) pythonCmd += " 2> {stderr}".format(stderr=stderr) logfh.write(pythonCmd + "\n") qsubCmd = "qsub -V -sync y -wd {sampDir} -m a -M {notifyEmail} {pythonCmd}".format(sampDir=sampDir,notifyEmail=",".join(notifyEmail),pythonCmd=pythonCmd) logfh.write(qsubCmd) # try: # #set scoring status of ChIP Seq Scoring object in Syapse to "Running Analysis" # syapseConn = SyapseUtils.Utils(mode=args.syapse_mode) # syapseConn.setProperty(unique_id=runName,propertyName="scoringStatus",value="Running Analysis") #returns a syapse_client.err.PropertyValueError if value not in property range. returns a syapse_client.err.SemanticConstraintError if the property doesn't belong to the class. # print(qsubCmd) stdout,stderr = gbsc_utils.createSubprocess(cmd=qsubCmd,checkRetcode=True) except Exception as e: subject = "Chip Scoring {program}: {runName} failed.".format(runName=runName,program=os.path.basename(sys.argv[0])) body = e.message + "\n\nCheck the SGE log files in " + sampDir + " for more details." emailCmd = "mandrill_general_email.py --sender {sender} --subject \"{subject}\" --to {notifyEmail} --add \"{body}\" ".format(sender=conf.sender,subject=subject,notifyEmail=" ".join(notifyEmail),body=body) print(emailCmd) gbsc_utils.createSubprocess(cmd=emailCmd,checkRetcode=True) #update Syapse's Chip Seq Scoring object's Scoring Status attribute to 'Running Analysis' logfh.close()
elif os.path.isdir(i): shutil.rmtree(i) # refTime = datetime.datetime(2014,6,20) # if args.sample_time: # try: # mtime = os.path.getmtime(sampleResultsPath) # except OSError: # mtime = 0 # if mtime: # dte = datetime.datetime.fromtimestamp(mtime) # if dte > refTime: # print("Continuing") # continue #assume that scoring is still ongoing # cmd = "qsub -sync y -wd {wd} -m ae -M {notify} -V runPeakseqWithoutSnapUpdates.rb --name {run} --control {control} --force".format(notify=conf.toEmails[0],wd=sampleRunPath,run=run,control=control) cmd = "runPeakseqWithoutSnapUpdates.py --syapse-mode {syapseMode} --name {run} --control {control} --force".format(syapseMode=syapseMode,notify=conf.toEmails[0],wd=sampleRunPath,run=run,control=control) if args.paired_end: pass #runPeakseqWithoutSnapUpdates.py expects PE by default if args.rescore_control > 0: cmd += " --rescore-control={}".format(args.rescore_control) print(cmd) #let progam continue if runPeakseqWithoutSnapUpdates.py failes, since an email will already be sent in that case, to the 'sender' specified in conf.py. try: popen = gbsc_utils.createSubprocess(cmd=cmd,checkRetcode=False) except Exception as e: print(e.message) if limit: count += 1 if count >= limit: break fh.close()