Skip to content

Commit

Permalink
Tune optimal parameter searching for robust processes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeshik committed Sep 9, 2016
1 parent d643539 commit 3298bdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ polyA_seeder:
polya_sampling_gap: 3
dist_sampling_bins: 1000
cutoff_score_search_low: 0.0
cutoff_score_search_high: 0.6
cutoff_score_search_high: [0.4, 0.6]
minimum_spots_for_dist_sampling: 300
favored_spots_for_dist_sampling: 500
kde_bandwidth_for_dist: 0.1
Expand Down
16 changes: 11 additions & 5 deletions scripts/calculate-optimal-parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ def find_eqodds_point(poscounts, negcounts, xsamples):
logLRfun = lambda x: np.log(max(VERY_SMALL_PROBABILITY, poskde(x)) /
max(VERY_SMALL_PROBABILITY, negkde(x)))

try:
return optimize.bisect(logLRfun, CUTOFF_RANGE_LOW, CUTOFF_RANGE_HIGH)
except ValueError:
return
for cutoff_limit_high in CUTOFF_RANGE_HIGH:
try:
r = optimize.bisect(logLRfun, CUTOFF_RANGE_LOW, cutoff_limit_high)
if CUTOFF_RANGE_LOW < r < cutoff_limit_high:
return r
except ValueError:
pass
return

def find_all_eqodds_point(poscounts, negcounts, xsamples):
cycles_to_try = np.where((poscounts.sum(axis=1) >= MIN_SPOTS_FOR_DIST) &
Expand Down Expand Up @@ -156,7 +160,9 @@ def calculate_optimal_cutoffs(sigdists, tiles):
tile_cutoffs_inferred = {}
for tileid, tile_cutoffs in tile_cutoffs.items():
cutoffs = tile_cutoffs.copy()
for c in set(all_cycles) - set(tile_cutoffs.keys()):
determined_cycles = set(cycle for cycle, cutoff in cutoffs.items()
if cutoff is not None)
for c in set(all_cycles) - determined_cycles:
cutoffs[c] = runwide_cutoffs_inferred[c]
tile_cutoffs_inferred[tileid] = cutoffs

Expand Down

0 comments on commit 3298bdb

Please sign in to comment.