File size: 489 Bytes
7ef4de5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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