Mercurial > repos > artbio > lumpy_sv
comparison pairend_distro.py @ 5:6ae3a402b9af draft
"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy_sv commit e1bfc70a74f12ef8182d9afa0b3ab69d620fb3a8"
author | artbio |
---|---|
date | Sun, 24 May 2020 18:48:46 -0400 |
parents | 093bb151a0a8 |
children |
comparison
equal
deleted
inserted
replaced
4:093bb151a0a8 | 5:6ae3a402b9af |
---|---|
79 | 79 |
80 # warn if very few elements in distribution | 80 # warn if very few elements in distribution |
81 min_elements = 1000 | 81 min_elements = 1000 |
82 if len(L) < min_elements: | 82 if len(L) < min_elements: |
83 sys.stderr.write("Warning: only %s elements in distribution (min: %s)\n" % | 83 sys.stderr.write("Warning: only %s elements in distribution (min: %s)\n" % |
84 (len(L), min_elements)) | 84 (str(len(L)), str(min_elements))) |
85 mean = "NA" | 85 mean = "NA" |
86 stdev = "NA" | 86 stdev = "NA" |
87 | 87 |
88 else: | 88 else: |
89 # Remove outliers | 89 # Remove outliers |
92 med, umad = unscaled_upper_mad(L) | 92 med, umad = unscaled_upper_mad(L) |
93 upper_cutoff = med + options.mads * umad | 93 upper_cutoff = med + options.mads * umad |
94 L = L[L < upper_cutoff] | 94 L = L[L < upper_cutoff] |
95 new_len = len(L) | 95 new_len = len(L) |
96 removed = c - new_len | 96 removed = c - new_len |
97 sys.stderr.write("Removed %d outliers with isize >= %d\n" % | 97 sys.stderr.write("Removed %s outliers with isize >= %s\n" % |
98 (removed, upper_cutoff)) | 98 (str(removed), str(upper_cutoff))) |
99 c = new_len | 99 c = new_len |
100 | 100 |
101 mean = np.mean(L) | 101 mean = np.mean(L) |
102 stdev = np.std(L) | 102 stdev = np.std(L) |
103 | 103 |