Skip to contents

find neighbor cells of chosen_cells and return the relevant transcript data.frame for both query

Usage

getNeighbors_transDF(
  chosen_cells = NULL,
  neighbor_distance_xy = NULL,
  transcript_df,
  cellID_coln = "CellId",
  transID_coln = "transcript_id",
  transSpatLocs_coln = c("x", "y", "z")
)

Arguments

chosen_cells

the cell_ID of chosen cells need to be evaluate for re-segmentation

neighbor_distance_xy

maximum cell-to-cell distance in x, y between the center of query cells to the center of neighbor cells with direct contact, same unit as input spatial coordinate. Default = NULL to use the 2 times of average cell diameter.

transcript_df

the data.frame with transcript_id, cell_id and spatial coordinates

cellID_coln

the column name of cell_ID in transcript_df

transID_coln

the column name of transcript_ID in transcript_df

transSpatLocs_coln

the column name of 1st, 2nd, optional 3rd spatial dimension of each transcript in transcript_df

Value

a data.frame

  1. transcript_id, transcript id of all transcript near chosen cell's neighborhood

  2. transSpatLocs_coln, coordinates

  3. in_query_cell, flag whether current transcript is in the query cell, false means in neighbor cells

  4. CellId, original cell id of each transcript

  5. query_CellId, original query cell id of transcript's neighborhood

Details

get neighborhood transcript data frame for visualization

Locate neighbor cells of each query cell in 1st and 2nd dimension via cell-to-cell distance within neighbor_distance_xy. If no neighbor cells found for query cell, return query cell information only. Do not consider extracellular transcripts.