Skip to content

Commit

Permalink
Added update statement to familiarData and familiarCollection objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzwanenburg committed Sep 20, 2024
1 parent 23ae842 commit 5a83d15
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions R/FamiliarObjectUpdate.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ setMethod(
})
}

if (tail(object@familiar_version, n = 1L) < "1.5.0") {
# Update feature_expressions slot by iterating over its contents. This is
# to account for changes in transformation objects, introduced with 1.5.0.
object@feature_expressions <- lapply(
object@feature_expressions,
function(x) {
x@feature_info <- update_object(x@feature_info)

return(x)
}
)
}

if (!methods::validObject(object)) {
stop("Could not update the familiarData object to the most recent definition.")
}
Expand Down Expand Up @@ -377,6 +390,19 @@ setMethod(
})
}

if (tail(object@familiar_version, n = 1L) < "1.5.0") {
# Update feature_expressions slot by iterating over its contents. This is
# to account for changes in transformation objects, introduced with 1.5.0.
object@feature_expressions <- lapply(
object@feature_expressions,
function(x) {
x@feature_info <- update_object(x@feature_info)

return(x)
}
)
}

if (!methods::validObject(object)) {
stop("Could not update the familiarCollection object to the most recent definition.")
}
Expand Down

0 comments on commit 5a83d15

Please sign in to comment.