Skip to contents

supporting function for fastReseg_perFOV_full_process, makes dummy outputs based on input transcript_df in same format as the outputs of fastReseg_perFOV_full_process() but returns no modStats_ToFlagCells data.frame, used in case of no cells being flagged for cell segmentation error.

Usage

makeDummyOuts_perFOV(
  all_genes,
  transcript_df,
  transID_coln = "UMI_transID",
  transGene_coln = "target",
  cellID_coln = "UMI_cellID",
  spatLocs_colns = c("x", "y", "z"),
  return_intermediates = TRUE,
  return_perCellData = TRUE,
  includeAllRefGenes = FALSE
)

Arguments

all_genes

vector of all genes consider in the analysis as listed in rows of score_GeneMatrix in parent function

transcript_df

the data.frame for each transcript with columns for transcript_id, target or gene name, original cell_id, spatial coordinates, as well as tLLR_maxCellType and score_tLLR_maxCellType columns from earlier step in parent function

transID_coln

the column name of transcript_ID in transcript_df

transGene_coln

the column name of target or gene name in transcript_df

cellID_coln

the column name of cell_ID in transcript_df

spatLocs_colns

column names for 1st, 2nd and optional 3rd dimension of spatial coordinates in transcript_df

return_intermediates

flag to return intermediate outputs, including data.frame for spatial modeling statistics of each cell

return_perCellData

flag to return gene x cell count matrix and per cell DF with updated mean spatial coordinates and new cell type

includeAllRefGenes

flag to include all genes in score_GeneMatrix in the returned updated_perCellExprs with missing genes of value 0 (default = FALSE)

Value

a list

groupDF_ToFlagTrans

data.frame for the group assignment of transcripts within putative wrongly segmented cells, merged output of flag_bad_transcripts and groupTranscripts_Delaunay or groupTranscripts_dbscan functions, return when return_intermediates = TRUE

neighborhoodDF_ToReseg

a data.frame for neighborhood environment of low-score transcript groups, output of get_neighborhood_content function, return when return_intermediates = TRUE

reseg_actions

a list of 4 elements describing how the resegmenation would be performed on original transcript_df by the group assignment of transcripts listed in groupDF_ToFlagTrans, output of decide_ReSegment_Operations function, return when return_intermediates = TRUE

updated_transDF

the updated transcript_df with updated_cellID and updated_celltype column based on reseg_full_converter

updated_perCellDT

a per cell data.table with mean spatial coordinates, new cell type and resegmentation action after resegmentation, return when return_perCellData = TRUE

updated_perCellExprs

a gene x cell count sparse matrix for updated transcript data.frame after resegmentation, return when return_perCellData = TRUE