tagCell: Filtrar cdata usando gráficos y dibujando regiones

View source: R/tagCell.R

tagCellR Documentation

Filtrar cdata usando gráficos y dibujando regiones

Description

Filtrar cdata usando gráficos y dibujando regiones

Usage

tagCell(
  cdata,
  pdata,
  paths,
  cell_tags,
  randomize_ucids = FALSE,
  tag_box_size = 50,
  cell_resize = NULL,
  tag_channels_select = c("BF"),
  n_max = 10,
  seed = 1,
  tmp_output_file = NULL,
  tag_ggplot = NULL,
  equalize_images = F,
  normalize_images = F,
  debug_messages = F
)

Arguments

cdata

dataframe of "cell data"

pdata

dataframe "position data"

paths

dataframe of image paths

cell_tags

list of named vectors corresponding to tag groups and tags: list(named_item1 = c(option1, option2, ...), named_item2 ...)

randomize_ucids

Randomize ucid order.

tag_box_size

size of the image crop in pixels (integer)

cell_resize

resize of the image crop in pixels (integer)

tag_channels_select

a vector giving names for the image channels: c("BF", "YFP.out", etc....)

n_max

max number of boxes in the image

seed

seed for random sampling of images

tmp_output_file

File path into which tagging information will be dumped by user request. NULL by default, to automatically create and append to a tmp file.

tag_ggplot

a ggplot object to display in the second tab, may be used for something someday.

equalize_images

Use magick's function to "equalize" the images.

normalize_images

Use magick's function to "normalize" the images.

debug_messages

print debug messages

Value

Lots of stuff.

Examples

path <- "/mac/apesta/trololololol/"

cell.data <- rcell2::cell.load.alt(path = path)

image.paths <- cell.data$d.paths  # Si usaste load_cell es: image.paths <- rcell2::magickPaths(cell.data)

pdata <- read_tsv(paste0(path, "pdata.csv"))

cdata <- left_join(cell.data$d, pdata)

p <- ggplot() + 
  geom_line(aes(x=t.frame, y=cf.y, group=ucid))

tag_channels_select <- c("BF", "BF.out", "YFP", "YFP.out")

saved <- rcell2::tagCell(cdata,
                         pdata, 
                         image.paths,
                         cell_tags = list(far1_drop = c(TRUE,
                                                        FALSE),
                                          budding =   c("emergence",
                                                        "division", 
                                                        "shmoo_o_algo"),
                                          artifact =  c("segmentation",
                                                        "crowding",
                                                        "out_of_focus",
                                                        "interesante",
                                                        "death",
                                                        "flown_away",
                                                        "not_a_cell")
                         ),
                         tag_channels_select = tag_channels_select,
                         .equalize = T,
                         .normalize = F,
                         n_max = 50,
                         tag_box_size = 75,
                         cell_resize = 300,
                         tag_ggplot = p,
                         tmp_output_file = "../output/annotations/progress.csv", 
                         debug_messages = F,
                         annotation_params = c(color = "none", background = "none")
                         )
                         

gerbeldo/tidycell documentation built on Aug. 15, 2022, 2:35 p.m.