Skip to contents

group the flagged transcript within each cell based on spatial clustering using dbscan

Usage

groupTranscripts_dbscan(
  chosen_transcripts = NULL,
  distance_cutoff = "auto",
  transcript_df,
  cellID_coln = "CellId",
  transID_coln = "transcript_id",
  transSpatLocs_coln = c("x", "y", "z")
)

Arguments

chosen_transcripts

the transcript_id of chosen transcript

distance_cutoff

maximum molecule-to-molecule distance within same transcript group (default = "auto")

transcript_df

the data.frame with transcript_id, target/geneName, x, y and cell_id

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

data frame of connected transcripts among chosen_transcripts #'

  1. cellID_coln, orignal cell_ID

  2. transID_coln, connected transcripts among chosen_transcripts

  3. transSpatLocs_coln, spatial coordinates of transcript

  4. transcript_group, group of chosen_transcripts

Details

For query cell, group flagged transcripts only based on their molecular distance to each other. When distance cutoff = 'auto', use 20% average XY cell range as cutoff. In case of no more than 3 flagged transcripts per cell, determine the grouping based on distance cutoff directly. In case of more transcripts per cell, use dbscan to group transcripts with distance_cutoff as eps and minPts = 1.