createGiottoPolygonsFromDfr: Create giotto polygons from dataframe

createGiottoPolygonsFromDfrR Documentation

Create giotto polygons from dataframe

Description

Creates Giotto polygon object from a structured dataframe-like object. Three of the columns should correspond to x/y vertices and the polygon ID. Additional columns are set as attributes

Usage

createGiottoPolygonsFromDfr(
  segmdfr,
  name = "cell",
  calc_centroids = FALSE,
  verbose = TRUE,
  skip_eval_dfr = FALSE,
  copy_dt = TRUE
)

Arguments

segmdfr

data.frame-like object with polygon coordinate information (x, y, poly_ID) with x and y being vertex information for the polygon referenced by poly_ID. See details for how columns are selected for coordinate and ID information.

name

name for the giottoPolygon object

calc_centroids

(default FALSE) calculate centroids for polygons

verbose

be verbose

skip_eval_dfr

(default FALSE) skip evaluation of provided dataframe

copy_dt

(default TRUE) if segmdfr is provided as dt, this determines whether a copy is made

Details

When determining which column within the tabular data is intended to provide polygon information, Giotto first checks the column names for 'x', 'y', and 'poly_ID'. If any of these are discovered, they are directly selected. If this is not discovered then Giotto checks the data type of the columns and selects the first ''character'‘ type column to be ’poly_ID' and the first two ''numeric'' columns as 'x' and 'y' respectively. If this is also unsuccessful then poly_ID defaults to the 3rd column. 'x' and 'y' then default to the 1st and 2nd columns.

Value

giotto polygon object


drieslab/Giotto_site_suite documentation built on April 26, 2023, 11:51 p.m.