Skip to content

Commit

Permalink
chore: update expression accessor usage
Browse files Browse the repository at this point in the history
`get_expression_values()` -> `getExpression()`
  • Loading branch information
jiajic committed Jul 15, 2024
1 parent 4587f0e commit 1f4a6ce
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion R/NN_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ createNearestNetwork <- function(
expression_values
))
)
expr_obj <- get_expression_values(
expr_obj <- getExpression(
gobject = gobject,
feat_type = feat_type,
spat_unit = spat_unit,
Expand Down
2 changes: 1 addition & 1 deletion R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ aggregateStacksExpression <- function(gobject,
# aggregate matrices
matrix_list <- list()
for (spat_unit in spat_units) {
mat <- get_expression_values(gobject,
mat <- getExpression(gobject,
spat_unit = spat_unit,
feat_type = feat_type,
values = values,
Expand Down
12 changes: 6 additions & 6 deletions R/interoperability.R
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ giottoToAnnData <- function(

for (en in expr_names) {
if (en == "raw") {
raw_x <- get_expression_values(
raw_x <- getExpression(
gobject = gobject,
values = en,
spat_unit = su,
Expand All @@ -703,7 +703,7 @@ giottoToAnnData <- function(
} else {
ad_layer_name <- paste0(su, "_", ft, "_", en)

x <- get_expression_values(
x <- getExpression(
gobject = gobject,
values = en,
spat_unit = su,
Expand Down Expand Up @@ -1222,7 +1222,7 @@ giottoToSeuratV4 <- function(
expr_use <- lapply(
avail_expr[feat_type == assay_use, name],
function(x) {
get_expression_values(
getExpression(
gobject = gobject,
spat_unit = spat_unit,
feat_type = assay_use,
Expand Down Expand Up @@ -1503,7 +1503,7 @@ giottoToSeuratV5 <- function(
expr_use <- lapply(
avail_expr[feat_type == assay_use, name],
function(x) {
get_expression_values(
getExpression(
gobject = gobject,
spat_unit = spat_unit,
feat_type = assay_use,
Expand Down Expand Up @@ -2613,7 +2613,7 @@ giottoToSpatialExperiment <- function(giottoObj, verbose = TRUE) {
"' for spatial unit: '", spatialUnits[su], "'"
)
}
exprMat <- get_expression_values(
exprMat <- getExpression(
gobject = giottoObj,
spat_unit = spatialUnits[su],
feat_type = giottoExpr[1]$feat_type,
Expand Down Expand Up @@ -2657,7 +2657,7 @@ giottoToSpatialExperiment <- function(giottoObj, verbose = TRUE) {
spatialUnits[su]
),
withDimnames = FALSE
) <- get_expression_values(
) <- getExpression(
gobject = giottoObj,
spat_unit = spatialUnits[su],
feat_type = giottoExpr[i]$feat_type,
Expand Down
2 changes: 1 addition & 1 deletion R/join.R
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ joinGiottoObjects <- function(gobject_list,
} else {
for (exprObj_i in seq(nrow(avail_expr))) {
expr_list <- lapply(updated_object_list, function(gobj) {
get_expression_values(
getExpression(
gobject = gobj,
spat_unit = avail_expr$spat_unit[[exprObj_i]],
feat_type = avail_expr$feat_type[[exprObj_i]],
Expand Down
4 changes: 2 additions & 2 deletions R/slot_accessors.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ set_cell_id <- function(gobject,
# get cell ID values
if (spat_unit %in% expr_avail$spat_unit) { # preferred from expression

cell_IDs <- spatIDs(get_expression_values(
cell_IDs <- spatIDs(getExpression(
gobject = gobject,
spat_unit = spat_unit,
feat_type = expr_avail$feat_type[[1L]],
Expand Down Expand Up @@ -424,7 +424,7 @@ set_feat_id <- function(gobject,

if (feat_type %in% expr_avail$feat_type) { # preferred from expression

feat_IDs <- featIDs(get_expression_values(
feat_IDs <- featIDs(getExpression(
gobject = gobject,
spat_unit = expr_avail$spat_unit[[1L]],
feat_type = feat_type,
Expand Down
2 changes: 1 addition & 1 deletion R/slot_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
}

if (!nrow(avail_ex[spat_unit == su_i & feat_type == ft_i]) == 0L) {
IDs <- featIDs(get_expression_values(
IDs <- featIDs(getExpression(
gobject = gobject,
spat_unit = su_i,
feat_type = ft_i,
Expand Down
2 changes: 1 addition & 1 deletion R/slot_show.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ showGiottoExpression <- function(gobject, nrows = 4, ncols = 4) {
objPrints <- list()
for (obj_i in seq(nrow(available_data))) {
# get object
dataObj <- get_expression_values(
dataObj <- getExpression(
gobject = gobject,
values = available_data$name[[obj_i]],
spat_unit = available_data$spat_unit[[obj_i]],
Expand Down

0 comments on commit 1f4a6ce

Please sign in to comment.