Skip to content

Commit

Permalink
batch rootid lookup when partners=="both"
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Jan 26, 2021
1 parent 602b102 commit cfaf915
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/autosyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ flywire_partners <- function(rootid, partners=c("outputs", "inputs", "both"),
resdf$pre_id=flywire_rootid(resdf$pre_svid, integer64 = T, cloudvolume.url=cloudvolume.url)
resdf$post_id=as.integer64(rootid)
} else {
resdf$pre_id=flywire_rootid(resdf$pre_svid, integer64 = T, cloudvolume.url=cloudvolume.url)
resdf$post_id=flywire_rootid(resdf$post_svid, integer64 = T, cloudvolume.url=cloudvolume.url)
nrows=nrow(resdf)
combined_svids=c(resdf$pre_svid, resdf$post_svid)
stopifnot(length(combined_svids)==nrows*2)
combined_rootids=flywire_rootid(combined_svids, integer64 = T,
cloudvolume.url=cloudvolume.url)

resdf$pre_id=combined_rootids[seq_len(nrows)]
resdf$post_id=combined_rootids[seq_len(nrows)+nrows]
resdf$prepost = ifelse(as.character(resdf$pre_id)%in%rootid,0,1)
}
}
Expand Down

0 comments on commit cfaf915

Please sign in to comment.