Create the Quality(QUAL) histogram.
(data)
| 155 | |
| 156 | |
| 157 | def _build_qual_histogram(data): |
| 158 | """Create the Quality(QUAL) histogram.""" |
| 159 | width = 200 |
| 160 | height = 200 |
| 161 | title = 'Quality score' |
| 162 | qual_data = pd.DataFrame(data) |
| 163 | qual_histogram = _placeholder_for_empty_chart( |
| 164 | 'No entries in VCF', width=width, height=height, title=title |
| 165 | ) |
| 166 | if not qual_data.empty: |
| 167 | # s = bin_start, e = bin_end, c = count |
| 168 | domain = [min(0, data[0]['s']), max(150, data[-1]['e'])] |
| 169 | qual_histogram = ( |
| 170 | alt.Chart(qual_data) |
| 171 | .mark_bar(color=BAR_COLOR_QUAL) |
| 172 | .encode( |
| 173 | x=alt.X('s', title='QUAL', scale=alt.Scale(domain=domain)), |
| 174 | x2='e', |
| 175 | y=alt.Y('c', title='Count', stack=True, axis=alt.Axis(format='s')), |
| 176 | ) |
| 177 | .properties(width=width, height=height, title=title) |
| 178 | .interactive(bind_y=False) |
| 179 | ) |
| 180 | return qual_histogram |
| 181 | |
| 182 | |
| 183 | def _build_gq_histogram(data): |
no test coverage detected