Spaces:
Sleeping
Sleeping
from DNAseq import DNAseq | |
import plotly.graph_objects as go | |
# Derived class (subclass) | |
class DNAgrapher(DNAseq): | |
def pie_chart(self): | |
labels = ['Guanine', 'Cytosine', 'Thymine', 'Adenine'] | |
values = [self.get_unit_count('g'), | |
self.get_unit_count('c'), | |
self.get_unit_count('t'), | |
self.get_unit_count('a'), | |
] | |
fig = go.Figure(data=[go.Pie(labels=labels, values=values)]) | |
return fig | |