Commit ae5179de authored by Maximilian Beckers's avatar Maximilian Beckers

Hochberg procedure integrated, update tutorial

parent 1e43234c
......@@ -446,7 +446,10 @@ def pAdjust(pValues, method):
pAdjust[i] = max(prevPVal, tmpPVal);
prevPVal = pAdjust[i];
pAdjust[pAdjust>1.0] = 1.0;
elif method == "Hochberg":
for i in range(numPVal-1, -1, -1):
pAdjust[i] = min(prevPVal, pSort[i]*(numPVal-i));
prevPVal = pAdjust[i];
else:
print('Please specify a method. Execution is stopped ...');
quit();
......
......@@ -103,12 +103,12 @@ 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 = 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 = FDRutil.studentizeMap(em_map, mean, var);
locScaleMap = em_map;
locFiltMap = None;
......@@ -137,10 +137,6 @@ def calculateConfidenceMap(em_map, apix, noiseBox, testProc, ecdf, lowPassFilter
fdr = 0.01;
binMap = FDRutil.binarizeMap(qMap, fdr);
# apply the thresholded qMap to data
maskedMap = np.multiply(binMap, np.copy(em_map));
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));
......@@ -148,19 +144,18 @@ def calculateConfidenceMap(em_map, apix, noiseBox, testProc, ecdf, lowPassFilter
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);
# 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);
# 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;
......
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