MCPcopy
hub / github.com/google/deepvariant / _build_qual_histogram

Function _build_qual_histogram

deepvariant/vcf_stats_vis.py:157–180  ·  view source on GitHub ↗

Create the Quality(QUAL) histogram.

(data)

Source from the content-addressed store, hash-verified

155
156
157def _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
183def _build_gq_histogram(data):

Callers 1

_build_all_chartsFunction · 0.85

Calls 2

encodeMethod · 0.80

Tested by

no test coverage detected