Commit df86bcb9 authored by Maximilian Beckers's avatar Maximilian Beckers
Browse files

added pyFFTW in FDRutil.py and bug fix in mapUtil.py

parent e6533745
......@@ -4,6 +4,8 @@ import math
import gc
import os
import sys
import pyfftw
import multiprocessing
#Author: Maximilian Beckers, EMBL Heidelberg, Sachse Group
......@@ -527,14 +529,24 @@ 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.fft.irfftn(filteredftMap, shape);
#filteredMap = np.real(filteredMap);
#do iverse FFT
fftObject = pyfftw.builders.irfftn(filteredftMap, shape, threads = numCores);
filteredMap = fftObject();
filteredMap = np.real(filteredMap);
return filteredMap;
#---------------------------------------------------------------------------------
......
......@@ -48,7 +48,7 @@ def localFiltration(map, locResMap, apix, localVariance, windowSize, boxCoord, E
locResMapData = np.around(locResMapData, 3);
#set resolution search range, 3 decimals exact
locResArray = np.arange(0, 0.5 , 0.001);
locResArray = np.arange(0, 0.5+0.001 , 0.001);
#set maximum resolution, important as ResMap is masking
limRes = np.min(locResMapData);
......
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