Skip to content

Commit

Permalink
Merge pull request #27 from flyconnectome/fix-updatebodyids
Browse files Browse the repository at this point in the history
updatebodyids - backward compatibility
  • Loading branch information
jefferis authored Sep 8, 2021
2 parents ab2e65e + 5242f48 commit 3c8345a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: malevnc
Title: Support for Working with Janelia FlyEM Male VNC Dataset
Version: 0.1.1
Version: 0.1.2
Authors@R:
c(person(given = "Gregory",
family = "Jefferis",
Expand Down Expand Up @@ -55,7 +55,7 @@ Enhances:
URL: https://github.com/flyconnectome/malevnc
BugReports: https://github.com/flyconnectome/malevnc/issues
Depends:
R (>= 2.10)
R (>= 3.6.0)
Remotes:
natverse/nat,
natverse/neuprintr,
Expand Down
8 changes: 5 additions & 3 deletions R/annotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ updatebodyids <- function(x, update=TRUE, cache=FALSE, add_auto=TRUE) {
x$auto=TRUE
} else {
empty_field <- function(x) {
res=apply(x, 2, simplify = FALSE, function(y) {
if(is.list(y)) is.na(y) | lengths(y)==0 else is.na(y)
})
res = lapply(1:ncol(x), function(ny) {
y = x[,ny]
if(is.list(y)) is.na(y) | lengths(y)==0 else is.na(y)
})
names(res) <- colnames(x)
as.data.frame(res)
}
rs=rowSums(empty_field(x[, manualfields, drop=F]))
Expand Down

0 comments on commit 3c8345a

Please sign in to comment.