Skip to content

Commit db019c2

Browse files
committed
outputs: Add gene score (= max transcript score)
1 parent 77648ce commit db019c2

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/geneml/outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_end_coordinate(end_value, offset=offset):
3434
"gene",
3535
get_start_coordinate(gene.start),
3636
get_end_coordinate(gene.end),
37-
".",
37+
f"{gene.score:.3f}",
3838
strand,
3939
".",
4040
f"ID={gene_id}",

src/geneml/produce_genes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ def assign_transcripts_to_genes(transcripts_by_contig_id: dict[str, list[Transcr
355355
end=max(t.end for t in group),
356356
strand=group[0].strand,
357357
transcripts=tuple(group),
358+
score=max(t.score for t in group),
358359
)
359360
genes_by_contig[contig_id].append(gene)
360361

src/geneml/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Gene:
9292
end: int
9393
strand: int
9494
transcripts: tuple[Transcript, ...]
95+
score: float
9596

9697
def __post_init__(self):
9798
if not self.transcripts:

0 commit comments

Comments
 (0)