Commit 069d11cf authored by Martin Larralde's avatar Martin Larralde
Browse files

Add `Gene.score` property to get a gene score as reported in the score data

parent 1f1528ee
......@@ -162,6 +162,8 @@ class Gene:
def tscore(self) -> float: ...
@property
def uscore(self) -> float: ...
@property
def score(self) -> float: ...
def confidence(self) -> float: ...
def sequence(self) -> str: ...
def translate(self, translation_table: Optional[int] = None, unknown_residue: str = "X") -> str: ...
......
......@@ -2380,7 +2380,7 @@ cdef class Gene:
def _score_data(self):
return "conf={:.2f};score={:.2f};cscore={:.2f};sscore={:.2f};rscore={:.2f};uscore={:.2f};tscore={:.2f}".format(
self.confidence(),
self.cscore + self.sscore,
self.score,
self.cscore,
self.sscore,
self.rscore,
......@@ -2554,6 +2554,16 @@ cdef class Gene:
"""
return self.owner.nodes.nodes[self.gene.start_ndx].uscore
@property
def score(self):
"""`float`: The gene score, sum of the coding and start codon scores.
.. versionadded:: 0.7.3
"""
cdef _node* node = &self.owner.nodes.nodes[self.gene.start_ndx]
return node.cscore + node.sscore
@property
def start_node(self):
"""`~pyrodigal.Node`: The start node at the beginning of this gene.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment