Skip to contents

Adds Giotto points to an existing Giotto object

Usage

addGiottoPoints(gobject, gpoints)

addGiottoPoints3D(gobject, coords, feat_type = "rna")

Arguments

gobject

giotto object

gpoints

list of giotto point objects, see createGiottoPoints

coords

A data.frame or spatVector with at least xyz coordinates and feature ids.

feat_type

a character. The feat_type must previously exist in the Giotto object. Default = "rna".

Value

giotto object

Examples

x_points <- GiottoData::loadSubObjectMini("giottoPoints")
x_expression <- matrix(seq_len(337 * 2), nrow = 337)
rownames(x_expression) <- unique(x_points$feat_ID)
g <- createGiottoObject(expression = x_expression)
#> python already initialized in this session
#>  active environment : 'giotto_env'
#>  python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/share/miniconda/envs/giotto_env/bin/python"
#> There are non numeric or integer columns for the spatial location
#>  input at column position(s): 1
#>  The first non-numeric column will be considered as a cell ID
#>  to test for consistency with the expression matrix
#>  Other non numeric columns will be removed

g <- addGiottoPoints(gobject = g, gpoints = list(x_points))