Skip to content

Commit

Permalink
Merge pull request #93 from natverse/extraRoiInfoFields
Browse files Browse the repository at this point in the history
Add "upstream" and "downstream" fields in extract_connectivity_df
  • Loading branch information
romainFr authored Mar 2, 2020
2 parents bcf5977 + 09679a5 commit b456d41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/connectivity.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ extract_connectivity_df <- function(rois, json){
}
rois <- unique(rois) #this takes care if both the input and output ROIs are same..
a <- unlist(jsonlite::fromJSON(json))
roicols <- c(t(outer(rois, c("pre", "post"), paste, sep=".")))
roicols <- c(t(outer(rois, c("pre", "post","upstream","downstream"), paste, sep=".")))
values <- tibble::as_tibble(as.list(structure(rep(0, length(roicols)), .Names=roicols)))
for(roi in rois){
thisroicols <- paste0(roi,c(".pre",".post"))
thisroicols <- paste0(roi,c(".pre",".post",".upstream",".downstream"))
if (!is.null(a)){
b <- a[startsWith(names(a),paste0(roi,"."))]
values[names(b)] <- b
Expand Down

0 comments on commit b456d41

Please sign in to comment.