Mercurial > repos > iuc > genetrack
diff genetrack_util.py @ 1:df7ac50ade5d draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/genetrack commit 6cd0f93f4eb8649802683ae4c189c8ad48827a49
author | iuc |
---|---|
date | Fri, 13 Jan 2017 10:20:48 -0500 |
parents | 25cd59a002d9 |
children | 41887967ef14 |
line wrap: on
line diff
--- a/genetrack_util.py Tue Dec 22 17:03:27 2015 -0500 +++ b/genetrack_util.py Fri Jan 13 10:20:48 2017 -0500 @@ -257,7 +257,7 @@ lo, hi = get_range(data) rng = hi - lo shift = width - lo - return numpy.zeros(rng+width*2, numpy.float), shift + return numpy.zeros(rng + width * 2, numpy.float), shift def normal_array(width, sigma, normalize=True): @@ -274,7 +274,7 @@ values = numpy.array(values, numpy.float) # normalization if normalize: - values = 1.0/math.sqrt(2 * numpy.pi * sigma2) * values + values = 1.0 / math.sqrt(2 * numpy.pi * sigma2) * values return values @@ -292,7 +292,7 @@ if direction == 2: # Swap positive and negative widths pos, neg = neg, pos - peaks.append(Peak(int(index)-shift, pos, neg)) + peaks.append(Peak(int(index) - shift, pos, neg)) find_peaks() def calculate_reads(): @@ -313,8 +313,8 @@ for peak in peaks_by_value: peak.safe = True window = get_window(peaks, - peak.index-exclusion//2, - peak.index+exclusion//2, + peak.index - exclusion // 2, + peak.index + exclusion // 2, peak_keys) for excluded in window: if excluded.safe: @@ -346,9 +346,9 @@ index, forward, reverse = read # Add the normals to the appropriate regions if forward: - forward_array[index+forward_shift-width:index+forward_shift+width] += normal * forward + forward_array[index + forward_shift - width:index + forward_shift + width] += normal * forward if reverse: - reverse_array[index+reverse_shift-width:index+reverse_shift+width] += normal * reverse + reverse_array[index + reverse_shift - width:index + reverse_shift + width] += normal * reverse populate_array() forward_peaks = call_peaks(forward_array, forward_shift, data, keys, 1, down_width, up_width, exclusion) reverse_peaks = call_peaks(reverse_array, reverse_shift, data, keys, 2, down_width, up_width, exclusion)