natverse / fafbseg

Support functions for analysis of Drosophila connectomes especially the FAFB-FlyWire whole brain
https://natverse.org/fafbseg/
GNU General Public License v3.0
6 stars 4 forks source link

unique(ids) for flywire_partner_summary() #103

Closed YijieYin closed 3 years ago

YijieYin commented 3 years ago

When an id is passed in twice, the same connections show up twice. e.g.:

library(fafbseg)

partners <- flywire_partner_summary(c('720575940637457779','720575940637457779'))
partners[partners$weight>100,]
#> # A tibble: 8 x 4
#>   query              post_id            weight     n
#>   <chr>              <chr>               <int> <int>
#> 1 720575940637457779 720575940623936698    126     1
#> 2 720575940637457779 720575940654866305    126     1
#> 3 720575940637457779 720575940617511883    119     1
#> 4 720575940637457779 720575940619522821    114     1
#> 5 720575940637457779 720575940623936698    126     1
#> 6 720575940637457779 720575940654866305    126     1
#> 7 720575940637457779 720575940617511883    119     1
#> 8 720575940637457779 720575940619522821    114     1
jefferis commented 3 years ago

obviously you can do:

ids=c('720575940637457779','720575940637457779')
partners <- flywire_partner_summary(unique(ids))

but this isn't hard to catch inside the function either.