Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monarch_semsim doesn't handle identical ID phenotypes well #31

Open
oneilsh opened this issue Jul 29, 2024 · 0 comments
Open

monarch_semsim doesn't handle identical ID phenotypes well #31

oneilsh opened this issue Jul 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@oneilsh
Copy link
Collaborator

oneilsh commented Jul 29, 2024

This example should produce two pairs of nodes best matching each other in both directions:

phenos1 <- monarch_engine() |> 
	fetch_nodes(query_ids = c("HP:0001763", "HP:0006316")) |>
	activate(nodes) |>
	mutate(source = "phenos1")

phenos2 <- monarch_engine() |> 
	fetch_nodes(query_ids = c("HP:0001763", "HP:0000678")) |>
	activate(nodes) |>
	mutate(source = "phenos2")


semsim <- monarch_semsim(phenos1, 
                         phenos2, 
                         include_reverse = TRUE, 
                         keep_unmatched = TRUE)

plot(semsim, node_color = source)

However, the identical node present in both sets has a self loop in phenos1 and no connection to phenos2.

Diagnosis: this comes down to how graph joins work in tidygraph (which is natural, over all matching columns) when the two node sets disagree in one of the columns. I think the desired behavior is right and desired with respect to that, we're just not keeping the original node sets properly in creating the join.

@oneilsh oneilsh added the bug Something isn't working label Jul 29, 2024
@oneilsh oneilsh self-assigned this Jul 29, 2024
@oneilsh oneilsh changed the title monarch_semsim doesn't handle identical ID phenotypes with monarch_semsim doesn't handle identical ID phenotypes well Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant