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

Allow more than 1 filter.identity level in 'clonalNetwork()' #324

Closed
wants to merge 2 commits into from

Conversation

ycl6
Copy link
Contributor

@ycl6 ycl6 commented Feb 26, 2024

Not sure if this is the behaviour you would like to add to the clonalNetwork function.

This PR allow the filter.identity to accept one or more identity levels, so that users can show relevant interactions of the chosen levels (for example, clusters belonging to the same supercluster).

@ycl6
Copy link
Contributor Author

ycl6 commented Feb 27, 2024

Based on the output from filter.identity = NULL and also how weights were calculated in L182 when filter.identity = NULL, the weights should be the average values of the same to/from combinations, or the deduplicated edge.list1 data.frame.

for (x in seq_len(nrow(grid))) {
summary <- c(to = as.vector(grid[x,1]),
from = as.vector(grid[x,2]),
weight = num[grid[x,2]]/total.number[as.vector(grid[x,1])])
edge.list <- rbind(edge.list, summary)
}

Therefore, I remove unique() from my previous commit and change the way the weights of the edge.list1 is calculated in L209 from sum to mean.

edge.list1 <- edge.list %>%
group_by(to, from) %>%
summarise(weight = sum(as.numeric(weight)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants