Skip to content

Commit

Permalink
WIP prefer foreign types for malecns co-clustering
Browse files Browse the repository at this point in the history
* i.e. if we are co-clustering malecns with another dataset we may prefer flywire or manc types
  • Loading branch information
jefferis committed Oct 29, 2024
1 parent 99be929 commit c5eefab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/cosine.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ multi_connection_table <- function(ids, partners=c("inputs", "outputs"),
threshold=1L,
group='type', check_missing=TRUE) {
partners=match.arg(partners, several.ok = T)
kk=keys(ids)
if(length(partners)>1) {
kk=keys(ids)
l=sapply(partners, simplify = F, function(p)
multi_connection_table(kk, partners=p, threshold = threshold, group=group,
check_missing=F))
Expand All @@ -314,8 +314,12 @@ multi_connection_table <- function(ids, partners=c("inputs", "outputs"),

return(l)
}
kk=keys(ids)
x <- cf_partners(kk, threshold = threshold, partners = partners)
kdf=keys2df(kk)
datasets=unique(kdf$dataset)
MoreArgs=list()
if(length(datasets)>1 && "malecns" %in% datasets)
MoreArgs=list(malecns=list(prefer.foreign=TRUE))

Check warning on line 321 in R/cosine.R

View check run for this annotation

Codecov / codecov/patch

R/cosine.R#L321

Added line #L321 was not covered by tests
x <- cf_partners(kk, threshold = threshold, partners = partners, MoreArgs = MoreArgs)
if(is.character(group))
x <- match_types(x, group, partners=partners)
# mark which column was used for the query
Expand Down

0 comments on commit c5eefab

Please sign in to comment.