Mercurial > repos > mvdbeek > dapars
diff dapars.py @ 22:4309798bfb61 draft default tip
planemo upload for repository https://github.com/mvdbeek/dapars commit b1b007c561ea6c9db145c88b6b128d66ecd05e24-dirty
author | mvdbeek |
---|---|
date | Fri, 30 Oct 2015 12:30:22 -0400 |
parents | eace1635959a |
children |
line wrap: on
line diff
--- a/dapars.py Fri Oct 30 12:08:20 2015 -0400 +++ b/dapars.py Fri Oct 30 12:30:22 2015 -0400 @@ -43,7 +43,7 @@ help="minimum coverage in each aligment to be considered for determining breakpoints") parser.add_argument("-b", "--breakpoint_bed", required=False, type=argparse.FileType('w'), help="Write bedfile with coordinates of breakpoint positions to supplied path.") - parser.add_argument("-v", "--version", action='version', version='%(prog)s 0.2.3') + parser.add_argument("-v", "--version", action='version', version='%(prog)s 0.2.4') parser.add_argument("-p", "--plot_path", default=None, required=False, type=directory_path, help="If plot_path is specified will write a coverage plot for every UTR in that directory.") parser.add_argument("-html", "--html_file", default=None, required=False, type=argparse.FileType('w'), @@ -195,9 +195,9 @@ tasks = [ (self.utr_coverages[utr], self.plot_path, utr, utr_d, self.coverage_weights, len(self.control_alignments), len(self.treatment_alignments), self.search_start, self.local_minimum, self.coverage_threshold) \ for utr, utr_d in self.utr_dict.iteritems() ] - #processed_tasks = [ pool.apply_async(calculate_all_utr, t) for t in tasks] - #result_list = [res.get() for res in processed_tasks] - result_list = [calculate_all_utr(*t) for t in tasks] # uncomment for easier debugging + processed_tasks = [ pool.apply_async(calculate_all_utr, t) for t in tasks] + result_list = [res.get() for res in processed_tasks] + #result_list = [calculate_all_utr(*t) for t in tasks] # uncomment for easier debugging for res_control, res_treatment in result_list: if not res_control: continue @@ -354,8 +354,6 @@ mse_treatment = np.array([mse[1] for mse in mse_list]) control_breakpoints = list(get_minima(mse_control, local_minimum)) treatment_breakpoints = list(get_minima(mse_treatment, local_minimum)) - print control_breakpoints - print treatment_breakpoints control_abundances = [estimate_abundance(normalized_utr_coverage, bp, num_samples) for bp in control_breakpoints] treatment_abundances = [estimate_abundance(normalized_utr_coverage, bp, num_samples) for bp in treatment_breakpoints] return control_breakpoints, control_abundances, treatment_breakpoints, treatment_abundances @@ -365,7 +363,6 @@ get minima for numpy array a. If local is false, only return absolute minimum """ if not local_minimum: - print np.where(a == a.min())[0] return np.where(a == a.min())[0] else: return np.where(np.r_[True, a[1:] < a[:-1]] & np.r_[a[:-1] < a[1:], True])[0]+1