<jupyter_start><jupyter_text>Quantile Normalize<jupyter_code>quantileNormalize <- function(
  seqFISH_expression,
  scRNAseq_expression,
  normalize_scRNAseq = TRUE
){

  seqFISH_genes <- colnames(seqFISH_expression)
  seqFISH_cells <- rownames(seqFISH_expression)
  scRNAseq_genes <- colnames(scRNAseq_expression)
  scRNAseq_cells <- rownames(scRNAseq_expression)

  if(normalize_scRNAseq) scRNAseq_expression <- normalize.quantiles(scRNAseq_expression)

  scRNAseq_target <- normalize.quantiles.determine.target(t(scRNAseq_expression))
  seqFISH_expression <- normalize.quantiles.use.target(seqFISH_expression, scRNAseq_target)

  seqFISH_expression <- round(seqFISH_expression, 4)
  scRNAseq_expression <- round(scRNAseq_expression, 4)

  colnames(seqFISH_expression) <- seqFISH_genes
  rownames(seqFISH_expression) <- seqFISH_cells
  colnames(scRNAseq_expression) <- scRNAseq_genes
  rownames(scRNAseq_expression) <- scRNAseq_cells

  result <- list(seqFISH_expression = seqFISH_expression, scRNAseq_expression = scRNAseq_expression)

  return(result)

}
qn_data <- quantileNormalize(
  seqFISH_expression = methods::as(object_t, 'matrix'),
  scRNAseq_expression = methods::as(object_r, 'matrix'),
)
seqFISH_expression <- qn_data$seqFISH_expression
scRNAseq_expression <- qn_data$scRNAseq_expression<jupyter_output><empty_output><jupyter_text>save objects to file<jupyter_code>object <- CreateSeuratObject(t(seqFISH_expression),meta.data = <EMAIL>)
SaveH5Seurat(object, filename = '../Data/Tabula_Sapiens/adata_predict_qnorm.h5seurat')
Convert('../Data/Tabula_Sapiens/adata_predict_qnorm.h5seurat', dest = "h5ad")
object <- CreateSeuratObject(t(scRNAseq_expression),meta.data = <EMAIL>)
SaveH5Seurat(object, filename = '../Data/Tabula_Sapiens/adata_train_qnorm.h5seurat')
Convert('../Data/Tabula_Sapiens/adata_train_qnorm.h5seurat', dest = "h5ad")<jupyter_output>Creating h5Seurat file for version 3.1.5.9900

Adding counts for RNA

Adding data for RNA

No variable features found for RNA

No feature-level metadata found for RNA

Validating h5Seurat file

Adding data from RNA as X

Adding counts from RNA as raw

Transfering meta.data to obs
{'fraction_non_alphanumeric': 0.09641360037261294, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 7.044943820224719, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '475012', 'license': 'MIT', 'n_tokens_mistral': 828, 'n_tokens_neox': 748, 'n_words': 119, 'path': 'benchmarking/Benchmarking_Tabula_Sapiens/Tabula_Sapiens_Preprocessing_Part_III.ipynb', 'repo_name': 'sameelab/STANN', 'size': '2169'}