Flexible function for fetching partner data across datasets
Usage
cf_partners(
ids,
threshold = 1L,
partners = c("inputs", "outputs"),
bind.rows = TRUE
)
Arguments
- ids
A list of ids named by the relevant datasets (see examples) or any other input that can be processed by the
keys
function (including ahclust
dendrogram object.)- threshold
return only edges with at least this many matches. 0 is an option since neuprint sometimes returns 0 weight edges.
- partners
Whether to return inputs or outputs
- bind.rows
Whether to bind data.frames for each dataset together, keeping only the common columns (default
TRUE
for convenience but note that some columns will be dropped).
Examples
# \donttest{
da2ds=cf_partners(list(hemibrain='DA2_lPN'), threshold=5)
library(dplyr)
da2ds %>%
count(type, wt=weight, sort=TRUE)
#> type n
#> 1 ORN_DA2 667
#> 2 DA2_lPN 89
#> 3 lLN10 85
#> 4 lLN2S 85
#> 5 v2LN30 72
#> 6 LHPV4b3 56
#> 7 lLN2T_a 48
#> 8 lLN2P_c 46
#> 9 l2LN18 23
#> 10 hb1795799176 22
#> 11 hb1859224229 16
#> 12 LHCENT3 14
#> 13 hb1828530446 14
#> 14 APL 12
#> 15 hb1828194121 12
#> 16 lLN2T_d 12
#> 17 lLN2T_e 11
#> 18 LHPD5c1 10
#> 19 hb1827852654 10
#> 20 hb1859224808 10
#> 21 lLN1_b 10
#> 22 hb1828189572 9
#> 23 hb1859220700 9
#> 24 hb1796813596 7
#> 25 LHPV12a1 6
#> 26 hb1890268815 6
#> 27 hb1921298843 6
#> 28 CSD 5
#> 29 LHPV2b5_a 5
#> 30 hb1920258429 5
#> 31 hb1921307609 5
#> 32 lLN12A 5
#> 33 lLN1_c 5
# }
if (FALSE) {
cf_partners(list(flywire='DA2_lPN'))
DA2_lPN=cf_partners(list(flywire='DA2_lPN', malecns='DA2_lPN'))
}