knitr::opts_chunk$set(collapse=TRUE, comment = "#>", fig.width=9, fig.height=6, eval=TRUE, echo=TRUE, results="verbatim", dpi=75) layout(1, respect=TRUE)
RiTMIC
(RegulatIon of Tumor MIcroenvironment Composition) is an open-access R package to study the link between the gene expression in a tumor and the microenvironment composition.
The pipeline is in 4 steps:
This vignette allows to apply the step 2, the step of extraction of the variability due to cancer.
For this step, we use D_rna, the transcriptome of each bulk samples. We also use the A matrix with the proportion of each cell type in each sample, and the T matrix with the cell type profiles. A and T matrices was obtained with the vignette 1_deconvolution.Rmd.
D_rna = readRDS("data_example/D_rna.rds") A_calc = readRDS("data_example/res_edec.rds")$A T_calc = readRDS("data_example/res_edec2.rds")
The first part of this step is to identify the cancer cell type. For that, we can use different methods like cell markers, comparison with identified cell lines, etc. Here, as we don't use real cell types, we can assume for example than the cancer cell type is the type 4.
pos_tum = 4
Once the cancer type is identified, we can removed of the bulk samples D the signal of the micro-environment (ME). The equation is:
$D_{cancer} = (D_{RNAseq} - T_{ME} * A_{ME}) / A_{cancer}$
D_cancer = (D_rna - T_calc[, -pos_tum] %*% A_calc[-pos_tum, ]) / rep(A_calc[pos_tum,])
To optimize the next step, we can preatreat D cancer to remove negative expression and samples with too few cancer cells.
D_cancer_preatreat = Ritmic::pre_treat_Dcancer(D_cancer, A_cancer = A_calc[pos_tum,], prop_cancer_threshold = 0.1) if(!file.exists("data_example/D_cancer_pretreat.rds")){ saveRDS(D_cancer_preatreat, file = "data_example/D_cancer_pretreat.rds") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.