Description Usage Arguments Value Examples
View source: R/spatial_helpers.R
Makes a marked point pattern (spatstat.geom::ppp
) for the cells
of the specified phenotype in the
specified tissue categories and field.
1 |
csd |
Cell seg data, may contain multiple fields |
export_path |
Path to a directory containing composite and component image files from inForm |
pheno |
Phenotype definition. Either a (possibly named) character
vector to be parsed by |
field_name |
Sample Name or Annotation ID for the field of interest.
May be omitted if |
tissue_categories |
Tissue categories of interest. If supplied, the
returned |
Returns a marked point pattern (spatstat.geom::ppp
object)
with a single mark value.
1 2 3 4 5 6 7 8 9 10 11 12 | # ppp for CD8+ cells in the sample data
suppressPackageStartupMessages(library(spatstat))
pp <- make_ppp(sample_cell_seg_data, sample_cell_seg_folder(),
"CD8+", tissue_categories="Tumor")
plot(pp, show.window=FALSE, main='')
# To include multiple phenotypes in a single point pattern,
# create them separately and join them with [spatstat.geom::superimpose()].
pp2 <- make_ppp(sample_cell_seg_data, sample_cell_seg_folder(),
"CK+", tissue_categories="Tumor")
plot(superimpose(pp2, pp), cols=c('red', 'blue'), show.window=FALSE, main='')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.