Skip to content

Commit

Permalink
Fixed how overlapping genes are identified during training (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmc297 committed Feb 27, 2024
1 parent f84dda5 commit a86816f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gecco/cli/commands/_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def _label_genes(self, genes: List["Gene"], clusters: "ClusterTable") -> List["G
for seq_id, seq_genes in itertools.groupby(genes, key=operator.attrgetter("source.id")):
for gene in seq_genes:
if any(
cluster_start <= gene.start and gene.end <= cluster_end
cluster_start <= gene.end and gene.start <= cluster_end
for (cluster_start, cluster_end) in cluster_by_seq[seq_id]
):
gene = gene.with_probability(1)
Expand Down Expand Up @@ -496,7 +496,7 @@ def _extract_clusters(self, genes: List["Gene"], clusters: "ClusterTable") -> Li
for seq_id, seq_genes in itertools.groupby(genes, key=operator.attrgetter("source.id")):
for gene in seq_genes:
for cluster_start, cluster_end, cluster_id in cluster_by_seq[seq_id]:
if cluster_start <= gene.start and gene.end <= cluster_end:
if cluster_start <= gene.end and gene.start <= cluster_end:
genes_by_cluster[cluster_id].append(gene)

return [
Expand Down

0 comments on commit a86816f

Please sign in to comment.