Mercurial > repos > mheinzl > fsd_regions
comparison fsd_regions.py @ 8:6c2608e8d094 draft
planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd_regions commit 8833d1a8a49d7b6d4a9c849b0335d3260564b351-dirty
author | mheinzl |
---|---|
date | Tue, 20 Nov 2018 09:51:47 -0500 |
parents | 3b8a0e462021 |
children | eabfdc012d7b |
comparison
equal
deleted
inserted
replaced
7:3b8a0e462021 | 8:6c2608e8d094 |
---|---|
69 quant_ba = quant[numpy.where(tags == "ba")[0]] | 69 quant_ba = quant[numpy.where(tags == "ba")[0]] |
70 | 70 |
71 seqDic_ab = dict(zip(all_ab, quant_ab)) | 71 seqDic_ab = dict(zip(all_ab, quant_ab)) |
72 seqDic_ba = dict(zip(all_ba, quant_ba)) | 72 seqDic_ba = dict(zip(all_ba, quant_ba)) |
73 | 73 |
74 if re.search(r'_(\d)+_(\d)+$', str(mut_array[0,0])) is None: | 74 if re.search(r'(\d)+_(\d)+$', str(mut_array[0,0])) is None: |
75 seq_mut, seqMut_index = numpy.unique(numpy.array(mut_array[:, 1]), return_index=True) | 75 seq_mut, seqMut_index = numpy.unique(numpy.array(mut_array[:, 1]), return_index=True) |
76 group = mut_array[seqMut_index,0] | 76 group = mut_array[seqMut_index,0] |
77 mut_array = mut_array[seqMut_index,:] | 77 mut_array = mut_array[seqMut_index,:] |
78 length_regions = len(seq_mut)*2 | 78 length_regions = len(seq_mut)*2 |
79 | 79 |
154 s = 0 | 154 s = 0 |
155 index_array = 0 | 155 index_array = 0 |
156 for i, count in zip(groupUnique, quantAfterRegion): | 156 for i, count in zip(groupUnique, quantAfterRegion): |
157 index_of_current_region = numpy.where(group == i)[0] | 157 index_of_current_region = numpy.where(group == i)[0] |
158 plt.text(0.55, 0.14 - s, "{}=\n".format(i), size=11, transform=plt.gcf().transFigure) | 158 plt.text(0.55, 0.14 - s, "{}=\n".format(i), size=11, transform=plt.gcf().transFigure) |
159 if re.search(r'_(\d)+_(\d)+$', str(mut_array[0, 0])) is None: | 159 if re.search(r'(\d)+_(\d)+$', str(mut_array[0, 0])) is None: |
160 nr_tags_ab = len(numpy.unique(mut_array[index_of_current_region, 1])) | 160 nr_tags_ab = len(numpy.unique(mut_array[index_of_current_region, 1])) |
161 else: | 161 else: |
162 nr_tags_ab = len(mut_array[index_of_current_region, 1]) | 162 nr_tags_ab = len(mut_array[index_of_current_region, 1]) |
163 plt.text(0.75, 0.14 - s, "{:,}\n".format(nr_tags_ab), size=11, transform=plt.gcf().transFigure) | 163 plt.text(0.75, 0.14 - s, "{:,}\n".format(nr_tags_ab), size=11, transform=plt.gcf().transFigure) |
164 s = s + 0.02 | 164 s = s + 0.02 |