Skip to content

Commit

Permalink
1) Fixed issue macs3-project#76: information about broad cutoff and n…
Browse files Browse the repository at this point in the history
…arrow cutoff will

be correctly displayed in the output xls file.
2) Remove a 'print' line for debug.
  • Loading branch information
taoliu committed Apr 24, 2015
1 parent 8d266b2 commit 49aa2b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions MACS2/IO/CallPeakUnit.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Time-stamp: <2015-04-20 14:21:12 Tao Liu>
# Time-stamp: <2015-04-24 10:05:31 Tao Liu>

"""Module for Calculate Scores.
Expand Down Expand Up @@ -216,6 +216,7 @@ cdef float mean_from_value_length ( np.ndarray value, list length ):
int32_t tmp_l
float tmp_v, sum_v

sum_v = 0
tmp = zip( value, length )
l = sum( length )

Expand Down Expand Up @@ -256,7 +257,7 @@ cdef tuple find_optimal_cutoff( list x, list y ):
sst = sum( ( npy[:i] - np.mean( npy[:i] ) ) ** 2 )
sse = sum( ( npy[:i] - m*npx[:i] - c ) ** 2 )
rsq = 1 - sse/sst
print i, x[i], y[i], m, c, rsq
#print i, x[i], y[i], m, c, rsq
return ( 1.0, 1.0 )


Expand Down
17 changes: 13 additions & 4 deletions MACS2/OptValidator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Time-stamp: <2015-03-05 13:56:30 Tao Liu>
# Time-stamp: <2015-04-24 17:17:25 Tao Liu>

"""Module Description
Expand Down Expand Up @@ -173,10 +173,19 @@ def opt_validate ( options ):
))

if options.pvalue:
options.argtxt += "# pvalue cutoff = %.2e\n" % (options.pvalue)
options.argtxt += "# qvalue will not be calculated and reported as -1 in the final output.\n"
if options.broad:
options.argtxt += "# pvalue cutoff for narrow/strong regions = %.2e\n" % (options.pvalue)
options.argtxt += "# pvalue cutoff for broad/weak regions = %.2e\n" % (options.broadcutoff)
options.argtxt += "# qvalue will not be calculated and reported as -1 in the final output.\n"
else:
options.argtxt += "# pvalue cutoff = %.2e\n" % (options.pvalue)
options.argtxt += "# qvalue will not be calculated and reported as -1 in the final output.\n"
else:
options.argtxt += "# qvalue cutoff = %.2e\n" % (options.qvalue)
if options.broad:
options.argtxt += "# qvalue cutoff for narrow/strong regions = %.2e\n" % (options.qvalue)
options.argtxt += "# qvalue cutoff for broad/weak regions = %.2e\n" % (options.broadcutoff)
else:
options.argtxt += "# qvalue cutoff = %.2e\n" % (options.qvalue)

if options.downsample:
options.argtxt += "# Larger dataset will be randomly sampled towards smaller dataset.\n"
Expand Down

0 comments on commit 49aa2b7

Please sign in to comment.