def calcDaysCrosses(aggregatedNodesData, thresholds, ssPops, gIx): chngDays = [] for j in range(len(aggregatedNodesData['landscape'])): nodePop = aggregatedNodesData['landscape'][j] thrsBool = monet.comparePopToThresholds(nodePop, gIx, [0, 1], thresholds, refPop=ssPops[j]) chngDays.append(monet.getConditionChangeDays(thrsBool)) return chngDays
print('* Loading mean response data...') # Load mean response and aggregate -------------------------------------------- filenames = monet.readExperimentFilenames(dirMean) landscapeData = monet.loadLandscapeData(filenames, male=MALE, female=FEMALE) aggregatedNodesData = monet.aggregateGenotypesInLandscape( landscapeData, drvPars.get('HLT')) # Get the max range for each node --------------------------------------------- maxPops = [] for i in aggregatedNodesData["landscape"]: maxPops.append(i[burn][-1] * 1) # Get the crosses through thresholds ------------------------------------------ (chngDays, prtcDays) = ([], []) for j in range(len(aggregatedNodesData['landscape'])): nodePop = aggregatedNodesData['landscape'][j] thrsBool = monet.comparePopToThresholds(nodePop, gIx, [0, 1], thresholds, refPop=maxPops[j]) chngDays.append(monet.getConditionChangeDays(thrsBool)) prtcDays.append(monet.countConditionDays(thrsBool)) ############################################################################### # Individual Nodes Traces ############################################################################### paths = monet.listDirectoriesWithPathWithinAPath(dirTraces + '/') print('* Loading traces reps datasets ({}) for populations ({})...'.format( len(paths), len(aggregatedNodesData['landscape']))) landscapeReps = monet.loadAndAggregateLandscapeDataRepetitions( paths, drvPars.get('HLT'), male=MALE, female=FEMALE) # Get the max range for each node --------------------------------------------- maxPops = [] for i in landscapeReps["landscapes"][0]: maxPops.append(i[burn][-1] * 1)
####################################################################### # Load files with the mean response and aggregate ##################### gIx = drivePars['HLT']['genotypes'].index('Other') filenames = monet.readExperimentFilenames(pathSampleM) landscapeData = monet.loadLandscapeData(filenames, male=True, female=True, dataType=float) aggregatedNodesData = monet.aggregateGenotypesInLandscape( landscapeData, drivePars.get('HLT')) # Get the crosses through thresholds ################################## (chngDays, prtcDays, minTuple) = ([], [], []) for j in range(len(aggregatedNodesData['landscape'])): nodePop = aggregatedNodesData['landscape'][j] thrsBool = monet.comparePopToThresholds(nodePop, gIx, [0, 1], thresholds, refPop=SSPOP) chngDays.append(monet.getConditionChangeDays(thrsBool)) prtcDays.append(monet.countConditionDays(thrsBool)) # Get the info to min pop ######################################### nodePopDict = {} nodePopDict["population"] = nodePop minData = aux.getTimeToMinAtAllele(nodePopDict, gIx) minTuple.append(minData) ####################################################################### # Traces # Generates the plot of the experiment at a repetition level. ####################################################################### # Load Data ########################################################### paths = monet.listDirectoriesWithPathWithinAPath(pathSample + "/") landscapeReps = monet.loadAndAggregateLandscapeDataRepetitions(