Commit 05952f70 authored by Akdel's avatar Akdel

with jit time

parent e3fdeb07
......@@ -3,6 +3,7 @@ import numba as nb
from math import sqrt
from OptiAsm import assembly_utils as au
from scipy import ndimage
import time
def clip_by_zoom(mol, reduce_to=0.66):
return ndimage.zoom(mol, reduce_to, order=1)
......@@ -26,6 +27,7 @@ def section_vs_section(section1, section2, fft_molecules, fft_rev_molecules, max
section2 = np.array(list(section2)).astype(int)
db_molecules = fft_molecules[section2[0]:section2[1]]
for i in range(section1[0], section1[1], width):
t = time.time()
print(i)
subject_molecules = fft_molecules[i:i+width]
rev_subject_molecules = fft_rev_molecules[i:i+width]
......@@ -42,6 +44,7 @@ def section_vs_section(section1, section2, fft_molecules, fft_rev_molecules, max
numba_normalize_molecule_correlation_array(multiple_top_corrs, maxes, section2, mol_range, normalized_top_corrs)
del multiple_top_corrs, mol_range
numba_arg_sort(normalized_top_corrs, results[i:i+width], top, int(section2[0]))
print(time.time() - t)
return results[section1[0]:section1[1]]
......@@ -161,7 +164,7 @@ def detect_repeat(nick_coordinates, diff_thr=1., num_thr=5):
def run_section_for_all_vs_all(fft_molecules: np.ndarray, fft_rev_molecules: np.ndarray, maxes: np.ndarray,
mol_range: (int, int), output_folder: str, file_prefix: str):
file_name = file_prefix + ("_%s-%s.npy" % mol_range)
section = section_vs_section(mol_range, (0, fft_molecules.shape[0]), fft_molecules, fft_rev_molecules, maxes, width=1, top=300)
section = section_vs_section(mol_range, (0, fft_molecules.shape[0]), fft_molecules, fft_rev_molecules, maxes, width=5, top=300)
np.save(output_folder + file_name, section)
......
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