Commit 1e43234c authored by Maximilian Beckers's avatar Maximilian Beckers

additional printouts

parent aefff9ba
......@@ -419,6 +419,7 @@ def pAdjust(pValues, method):
numPVal = len(pValues);
print("Sorting p-values ...")
pSortInd = np.argsort(pValues);
pSort = pValues[pSortInd];
......@@ -428,6 +429,7 @@ def pAdjust(pValues, method):
#use expansion for harmonic series
Hn = math.log(numPVal) + 0.5772 + 0.5/numPVal - 1.0/(12*numPVal**2) + 1.0/(120*numPVal**4);
print("Adjusting p-values ...");
if method =='BH': #do benjamini-hochberg procedure
for i in range(numPVal-1, -1, -1):
pAdjust[i] = min(prevPVal, pSort[i]*numPVal/(i+1.0));
......
......@@ -103,18 +103,18 @@ def calculateConfidenceMap(em_map, apix, noiseBox, testProc, ecdf, lowPassFilter
FDRutil.checkNormality(em_map, wn, boxCoord);
em_map, mean, var, ECDF = mapUtil.localFiltration(em_map, locResMap, apix, True, wn, boxCoord, ECDF);
#em_map = FDRutil.studentizeMap(em_map, mean, var);
locFiltMap = em_map;
locScaleMap = None;
else:
em_map, mean, var, ECDF = locscaleUtil.launch_amplitude_scaling(em_map, modelMap, apix, stepSize, wn_locscale, wn, method, locResMap, boxCoord, mpi, ECDF );
#em_map = FDRutil.studentizeMap(em_map, mean, var);
locScaleMap = em_map;
locFiltMap = None;
# calculate the qMap
qMap = FDRutil.calcQMap(em_map, mean, var, ECDF, wn, boxCoord, circularMaskData, method, testProc);
#em_map = FDRutil.studentizeMap(em_map, mean, var);
# if a explicit thresholding is wished, do so
if fdr is not None:
......@@ -142,8 +142,24 @@ def calculateConfidenceMap(em_map, apix, noiseBox, testProc, ecdf, lowPassFilter
minMapValue = np.min(maskedMap[np.nonzero(maskedMap)]);
if (locResMap is None) & (modelMap is None): # if no local Resolution map is give, then give the correspoding threshold, not usefule with local filtration
# apply the thresholded qMap to data
maskedMap = np.multiply(binMap, np.copy(em_map));
minMapValue = np.min(maskedMap[np.nonzero(maskedMap)]);
output = "Calculated map threshold: " + repr(minMapValue) + " at a FDR of " + repr(fdr*100) + "%.";
print(output);
"""elif (locResMap is not None) & (modelMap is None):
# apply the thresholded qMap to data
maskedMap = np.multiply(binMap, np.copy(locFiltMap));
minMapValue = np.min(maskedMap[np.nonzero(maskedMap)]);
output = "Calculated map threshold: " + repr(minMapValue) + " at a FDR of " + repr(fdr*100) + "%.";
print(output);
elif (locResMap is None) & (modelMap is not None):
# apply the thresholded qMap to data
maskedMap = np.multiply(binMap, np.copy(locScaleMap));
minMapValue = np.min(maskedMap[np.nonzero(maskedMap)]);
output = "Calculated map threshold: " + repr(minMapValue) + " at a FDR of " + repr(fdr*100) + "%.";
print(output);
"""
binMap = None;
maskedMap = None;
......
......@@ -188,6 +188,7 @@ def calculate_scaled_map(emmap, modmap, mask, wn, wn_locscale, apix, locFilt, lo
frequencyMap_mapWindow = FDRutil.calculate_frequency_map(np.zeros((wn_locscale, wn_locscale, wn_locscale)));
numSteps = len(range(0, sizeMap[0] - int(wn_locscale), stepSize))*len(range(0, sizeMap[1] - int(wn_locscale), stepSize))*len(range(0, sizeMap[2] - int(wn_locscale), stepSize));
print("Sart LocScale. This might take a minute ...");
counterSteps = 0;
for k in range(0, sizeMap[0] - int(wn_locscale), stepSize):
for j in range(0, sizeMap[1] - int(wn_locscale), stepSize):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment