Skip to content
Snippets Groups Projects
Commit 763931b8 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Remove extra sort from rescaling causing issues.

parent 9ca5c5ff
1 merge request!13Resolve "Add in Macs2 support"
...@@ -7,6 +7,7 @@ import shlex ...@@ -7,6 +7,7 @@ import shlex
import logging import logging
import subprocess import subprocess
import sys import sys
import os
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -109,10 +110,12 @@ def rescale_scores(filename, scores_col, new_min=10, new_max=1000): ...@@ -109,10 +110,12 @@ def rescale_scores(filename, scores_col, new_min=10, new_max=1000):
b = max_score b = max_score
x = new_min x = new_min
y = new_max y = new_max
if min_score == max_score: # give all peaks new_min if min_score == max_score: # give all peaks new_min
rescale_formula = "x" rescale_formula = "x"
else: # n is the unscaled score from scores_col else: # n is the unscaled score from scores_col
rescale_formula = "((n-a)*(y-x)/(b-a))+x" rescale_formula = "((n-a)*(y-x)/(b-a))+x"
out, err = run_pipe( out, err = run_pipe(
[ [
'cat %s' % (sorted_fn), 'cat %s' % (sorted_fn),
...@@ -122,4 +125,7 @@ def rescale_scores(filename, scores_col, new_min=10, new_max=1000): ...@@ -122,4 +125,7 @@ def rescale_scores(filename, scores_col, new_min=10, new_max=1000):
% (scores_col, rescale_formula) % (scores_col, rescale_formula)
], ],
rescaled_fn) rescaled_fn)
os.remove(sorted_fn)
return rescaled_fn return rescaled_fn
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