From 7c6a60d62389fa945f5a7264cde31cf00ddf9fc4 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 4 May 2021 23:46:00 +0300 Subject: base: species: Rewrite IndChromosome using a dataclass --- wqflask/base/species.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/species.py b/wqflask/base/species.py index ce646538..628bcc56 100644 --- a/wqflask/base/species.py +++ b/wqflask/base/species.py @@ -20,14 +20,15 @@ class TheSpecies: self.chromosomes = Chromosomes(dataset=self.dataset) +@dataclass class IndChromosome: - def __init__(self, name, length): - self.name = name - self.length = length + """Data related to IndChromosome""" + name: str + length: int @property def mb_length(self): - """Chromosome length in megabases""" + """Chromosome length in mega-bases""" return self.length / 1000000 -- cgit v1.2.3