@@ -376,18 +376,26 @@ banctable_updateids <- function(){
376
376
377
377
# Get cell info table
378
378
cat(' reading cell info cave table...' )
379
- info <- banc_cell_info() %> %
379
+ info <- banc_cell_info(rawcoords = TRUE ) %> %
380
+ dplyr :: mutate(pt_position = xyzmatrix2str(pt_position )) %> %
380
381
dplyr :: select(pt_root_id , pt_supervoxel_id ,pt_position ) %> %
381
382
rbind(banc_backbone_proofread() %> %
382
- dplyr :: select(pt_root_id , pt_supervoxel_id ,pt_position )) %> %
383
+ dplyr :: select(pt_root_id , pt_supervoxel_id ,pt_position ) %> %
384
+ dplyr :: mutate(pt_position = xyzmatrix2str(pt_position ))) %> %
385
+ rbind(banc_neck_connective_neurons() %> %
386
+ dplyr :: select(pt_root_id , pt_supervoxel_id ,pt_position ) %> %
387
+ dplyr :: mutate(pt_position = xyzmatrix2str(pt_position ))) %> %
383
388
dplyr :: mutate(pt_root_id = as.character(pt_root_id ),
384
389
pt_supervoxel_id = as.character(pt_supervoxel_id )) %> %
385
- dplyr :: distinct(pt_supervoxel_id , .keep_all = TRUE )
390
+ dplyr :: distinct(pt_supervoxel_id , .keep_all = TRUE ) %> %
391
+ dplyr :: rowwise()
386
392
387
393
# Get current table
388
394
cat(' reading banc meta table...' )
389
395
bc <- banctable_query(sql = ' select _id, root_id, supervoxel_id, position from banc_meta' ) %> %
390
396
dplyr :: select(root_id , supervoxel_id , position , `_id` )
397
+ bc [bc == " 0" ] <- NA
398
+ bc [bc == " " ] <- NA
391
399
392
400
# Update
393
401
bc.new <- bc %> %
@@ -398,8 +406,8 @@ banctable_updateids <- function(){
398
406
dplyr :: select(- pt_root_id ,- pt_position )
399
407
400
408
# Update root IDs directly where needed
401
- bc.new.rup <- banc_updateids(bc.new )
402
- bc.new.rup.joined <- bc.new.rup %> %
409
+ bc.new <- banc_updateids(bc.new )
410
+ bc.new <- bc.new %> %
403
411
dplyr :: left_join(info %> % dplyr :: distinct(pt_root_id , .keep_all = TRUE ),
404
412
by = c(" root_id" = " pt_root_id" )) %> %
405
413
dplyr :: mutate(supervoxel_id = ifelse(is.na(supervoxel_id ),pt_supervoxel_id ,supervoxel_id )) %> %
@@ -408,6 +416,8 @@ banctable_updateids <- function(){
408
416
409
417
# Update
410
418
cat(' updating banc meta table...' )
419
+ bc.new [is.na(bc.new )] <- ' '
420
+ bc.new [bc.new == " 0" ] <- ' '
411
421
banctable_update_rows(df = bc.new ,
412
422
base = " banc_meta" ,
413
423
table = " banc_meta" ,
@@ -417,7 +427,6 @@ banctable_updateids <- function(){
417
427
418
428
# Return
419
429
invisible ()
420
-
421
430
}
422
431
423
432
0 commit comments