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
734df776
Commit
734df776
authored
Oct 22, 2019
by
Maximilian Beckers
Browse files
made pyFFTW optional
parent
df86bcb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
confidenceMapUtil/FDRutil.py
View file @
734df776
...
...
@@ -4,8 +4,7 @@ import math
import
gc
import
os
import
sys
import
pyfftw
import
multiprocessing
#Author: Maximilian Beckers, EMBL Heidelberg, Sachse Group
...
...
@@ -530,20 +529,23 @@ def lowPassFilter(mapFFT, frequencyMap, cutoff, shape):
sizeMap
=
mapFFT
.
shape
;
#get number of cpus
numCores
=
multiprocessing
.
cpu_count
();
#do filtering of the map
filterMap
=
tanh_filter
(
frequencyMap
,
cutoff
);
filteredftMap
=
filterMap
*
mapFFT
;
#do ifft and get real parts
#filteredMap = np.fft.irfftn(filteredftMap, shape);
#filteredMap = np.real(filteredMap);
#do iverse FFT
fftObject
=
pyfftw
.
builders
.
irfftn
(
filteredftMap
,
shape
,
threads
=
numCores
);
filteredMap
=
fftObject
();
try
:
#optional with pyfftw
import
pyfftw
import
multiprocessing
# get number of cpus
numCores
=
multiprocessing
.
cpu_count
();
fftObject
=
pyfftw
.
builders
.
irfftn
(
filteredftMap
,
shape
,
threads
=
numCores
);
filteredMap
=
fftObject
();
except
:
filteredMap
=
np
.
fft
.
irfftn
(
filteredftMap
,
shape
);
filteredMap
=
np
.
real
(
filteredMap
);
...
...
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