Skip to content

Commit

Permalink
Change homologs to orthologs
Browse files Browse the repository at this point in the history
  • Loading branch information
memgonzales committed Dec 17, 2023
1 parent 0c97b25 commit fd5cba1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions callbacks/summary/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ def get_liftover_summary(genomic_interval):
NB_IDX = 1
NB_PREFIX = 'LOC_Os'

gene_to_homologs_map = defaultdict(set)
gene_to_orthologs_map = defaultdict(set)
for row in all_genes:
if row[NB_IDX].startswith(NB_PREFIX):
# Subtract 2 (i.e., subtract OGI)
for gene in row:
if gene != NULL_PLACEHOLDER:
gene_to_homologs_map[row[NB_IDX]].add(gene)
gene_to_orthologs_map[row[NB_IDX]].add(gene)

gene_to_count = []
for gene, homologs in gene_to_homologs_map.items():
for gene, orthologs in gene_to_orthologs_map.items():
# Subtract 2 to remove OGI and Nipponbare
gene_to_count.append([gene, len(homologs) - 2])
gene_to_count.append([gene, len(orthologs) - 2])

gene_to_count_df = pd.DataFrame(
gene_to_count, columns=['Gene', '# Homologs'])
gene_to_count, columns=['Gene', '# Orthologs'])
return gene_to_count_df


Expand Down

0 comments on commit fd5cba1

Please sign in to comment.