def calculateTaskForMissingWindowsForSequence(seriesSourceNumber, taskDescription, debug=False): config.initLogging() logging.warning("Processing task %s" % taskDescription) print(taskDescription) #def __init__(self, windowWidth=40, logfile=None, debugDoneWriteResults=False, computationTag="rna-fold-window-40-0", seriesSourceNumber=db.Sour (taxId, protId, seqIds, requestedShuffleIds, lastWindowStart, windowStep, windowRef, shuffleType) = parseTaskDescription(taskDescription) windowWidth = db.getWindowWidthForComputationTag( seriesSourceNumber ) firstWindowStart = 0 if seriesSourceNumber in (db.Sources.RNAfoldEnergy_SlidingWindow40_v2, db.Sources.RNAfoldEnergy_SlidingWindow30_v2, db.Sources.RNAfoldEnergy_SlidingWindow50_v2, db.Sources.RNAfoldEnergy_SlidingWindow40_v2_native_temp, db.Sources.TEST_StepFunction_BeginReferenced, db.Sources.TEST_StepFunction_EndReferenced, db.Sources.GC_content_SlidingWindow40, db.Sources.Purine_content_SlidingWindow40, db.Sources.StopCodon_content_SlidingWindow30, db.Sources.StopCodon_content_SlidingWindow50, db.Sources.StopCodon_content_SlidingWindow50 ): f = CalculateSlidingWindowRandomizedComparisonSeries(windowWidth, seriesSourceNumber=seriesSourceNumber) else: raise Exception("Got invalid sourceSeries: {}".format(seriesSourceNumber)) try: #def calculateMissingWindowsForSequence(self, taxId, protId, seqIds, requestedShuffleIds, firstWindow, lastWindowStart, windowStep, reference="begin"): ret = f.calculateMissingWindowsForSequence(taxId, protId, seqIds, requestedShuffleIds, firstWindowStart, lastWindowStart, windowStep, windowRef, shuffleType, debug=debug) except Exception as e: logging.error("calculateMissingWindowsForSequence() caught exception") logging.error(e) logging.error(taskDescription) raise if useProfiling and rl(): # display performance timers pre = timerForPreFolding.stats()[0] fold = timerForFolding.stats()[0] post = timerForPostFolding.stats()[0] logging.warning("Performance timers: Pre: %.4gs; Folding: %.4gs; Post: %.4gs; Total: %.4gs" % (pre, fold, post, pre+fold+post)) return taskDescription
def main(): args = initParser() config = initConfig(args.settings_file) db = initDatabase(config) initLogging(config) if exists(args.filename): log_entry = LogEntry(args.filename) db.insert_entry(log_entry) return 0 else: logging.error("%s does not exist. Exiting..." % args.filename) return 1
from collections import Counter from itertools import compress import logging import traceback import config import mysql_rnafold as db from data_helpers import CDSHelper, countSpeciesCDS, getSpeciesName, SpeciesCDSSource, numItemsInQueue import _distributed import dask from store_new_shuffles import storeNewShuffles from calculate_sliding_window_series import calculateTaskForMissingWindowsForSequence import notify_pushover scheduler = _distributed.open() config.initLogging() def parseList(conversion=str): def convert(values): return list(map(conversion, values.split(","))) return convert argsParser = argparse.ArgumentParser() argsParser.add_argument("--species", type=parseList(int), required=True) argsParser.add_argument("--computation-tag", default="rna-fold-window-40-0") argsParser.add_argument("--random-fraction", type=int, default=1) argsParser.add_argument("--window-step", type=int, default=10) argsParser.add_argument("--from-shuffle", type=int, default=-1)