Skip to content

Commit

Permalink
fix foldchange formatting in py3
Browse files Browse the repository at this point in the history
  • Loading branch information
zj-zhang committed Jul 10, 2019
1 parent d4ae4db commit e7a82ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CLAM/peakcaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ def _neg_loglik_constrain(par, data):
alpha_ip_vec = np.empty(intv_bin_ip.shape[0])
alpha_con_vec = np.empty(intv_bin_con.shape[0])
if norm_lib and tot_count_dict is not None:
try:
if 'mbam.ip' in tot_count_dict:
ip_sum = np.array(tot_count_dict['ubam.ip']) + np.array(tot_count_dict['mbam.ip'] )
except KeyError:
else:
ip_sum = np.array(tot_count_dict['ubam.ip'])
try:
if 'mbam.con' in tot_count_dict:
con_sum = np.array(tot_count_dict['ubam.con']) + np.array(tot_count_dict['mbam.con'])
except KeyError:
else:
con_sum = np.array(tot_count_dict['ubam.con'])
else:
ip_sum = np.apply_along_axis(np.sum, 1, intv_bin_ip)
Expand Down Expand Up @@ -375,7 +375,7 @@ def call_gene_peak(bam_dict, gene, unique_only=False, with_control=False, binsiz
## "narrowPeak" format from
## https://genome.ucsc.edu/FAQ/FAQformat.html#format12
## chr start end name 1000 strand signalValue pVal qVal peak
narrowPeak_formatter = "%s\t%i\t%i\t%s\t1000\t%s\t%s\t%.3e\t%.3e\t.\n"
narrowPeak_formatter = "%s\t%i\t%i\t%s\t1000\t%s\t%.3f\t%.3e\t%.3e\t.\n"
BED = ''
if len(fold_change)==1:
lb = np.log(fold_change[0]) if with_control else fold_change[0]
Expand Down

0 comments on commit e7a82ed

Please sign in to comment.