Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maximilian Beckers
FDRthresholding
Commits
ae5179de
Commit
ae5179de
authored
Feb 05, 2019
by
Maximilian Beckers
Browse files
Hochberg procedure integrated, update tutorial
parent
1e43234c
Changes
3
Hide whitespace changes
Inline
Side-by-side
confidenceMapUtil/FDRutil.py
View file @
ae5179de
...
...
@@ -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
();
...
...
confidenceMapUtil/confidenceMapMain.py
View file @
ae5179de
...
...
@@ -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_m
ap = FDRutil.studentizeMap(em_map, mean, var);
#
locFiltM
ap = 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_m
ap = FDRutil.studentizeMap(em_map, mean, var);
#
locScaleM
ap = 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
;
...
...
confidenceMaps_tutorial.pdf
View file @
ae5179de
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment