Skip to contents

Executes an integrated TME analysis on a gene expression matrix: performs immune/stromal cell deconvolution using multiple algorithms, computes signature scores, and aggregates results. Designed for exploratory immunogenomic profiling.

Usage

iobr_deconvo_pipeline(
  eset,
  project,
  array,
  tumor_type,
  path = NULL,
  permutation = 1000
)

Arguments

eset

Numeric matrix. Gene expression (TPM/log scale) with genes in rows.

project

Character. Project name (used in output naming).

array

Logical. Whether data originated from an array platform. Affects deconvolution choices.

tumor_type

Character. Tumor type code (e.g., "stad") used by certain methods.

path

Character. Output directory. Default is NULL (uses tempdir()).

permutation

Integer. Number of permutations for CIBERSORT (and similar). Default is 1000.

Value

Data frame integrating cell fractions and signature scores (also writes intermediate outputs to disk).

Author

Dongqiang Zeng

Examples

eset_stad <- load_data("eset_stad")
#>  Loading cached data: "eset_stad"
anno_grch38 <- load_data("anno_grch38")
#>  Loading cached data: "anno_grch38"
eset <- anno_eset(eset = eset_stad, annotation = anno_grch38, probe = "id")
#>  Row number of original eset: 60483
#>  100% of probes in expression set were annotated
#>  Found 2293 duplicate symbols, using "mean" method
#>  Row number after filtering duplicated gene symbol: 50181
# \donttest{
res <- iobr_deconvo_pipeline(
  eset = eset, project = "STAD",
  array = FALSE, tumor_type = "stad",
  path = tempdir(), permutation = 10
)
#>  Applied log2 transformation
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running CIBERSORT
#>  Loading cached data: "lm22"
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running EPIC deconvolution
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "TRef"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "mRNA_cell_default"
#> Warning: The optimization didn't fully converge for some samples:
#> TCGA-BR-6455; TCGA-FP-7916
#>  - check fit.gof for the convergeCode and convergeMessage
#> Warning: mRNA_cell value unknown for some cell types: CAFs, Endothelial - using the default value of 0.4 for these but this might bias the true cell proportions from all cell types.
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running MCP-counter deconvolution
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running xCell deconvolution
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "xCell.data"
#>  Number of genes: 10783
#>  GSVA version 2.6.0
#>  Searching for rows with constant values
#>  Calculating GSVA ranks
#>  kcdf='auto' (default)
#>  GSVA dense (classical) algorithm
#>  Row-wise ECDF estimation with Gaussian kernels
#>  Calculating row ECDFs
#>  Calculating column ranks
#>  GSVA dense (classical) algorithm
#>  Calculating GSVA scores for 489 gene sets
#>  Calculations finished
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running ESTIMATE
#>  Loading cached data: "common_genes"
#> Merged dataset includes 10148 genes (264 mismatched).
#>  Loading cached data: "SI_geneset"
#> 1 gene set: StromalSignature overlap=138
#> 2 gene set: ImmuneSignature overlap=140
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running TIMER deconvolution
#>  Enter batch mode
#>  Loading immune gene expression
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "immuneCuratedData"
#>  Outlier genes: ACTB ACTG1 CD74 COL1A1 EEF1A1 ERBB2 FLNA IGHG1 IGKC MT-CO1 MT-CO2 MT-ND4 MT-RNR2 MYH11
#>  Removing batch effects for stad
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "cancer_type_genes"
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running quanTIseq deconvolution
#>  Running quanTIseq deconvolution module
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "quantiseq_data"
#>  Gene expression normalization and re-annotation (arrays: FALSE)
#>  Loading cached data: "quantiseq_data"
#>  Removing 17 noisy genes
#>  Removing 15 genes with high expression in tumors
#>  Signature genes found in data set: 138/138 (100%)
#>  Mixture deconvolution (method: lsei)
#>  Deconvolution successful!
#> Warning: Data values appear small (< 50).
#>  Input should be in TPM/FPKM scale, not log-transformed
#>  Running IPS calculation
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "ips_gene_set"
#> [1] ">>>>> TME cell deconvolution was completed: STAD"
#>  Calculating signature scores using PCA, z-score, and ssGSEA methods
#>  Log2 transformation not necessary (data appears to already be log-scaled)
#>  Step 1/3: PCA method
#>  Step 2/3: z-score method
#>  Step 3/3: ssGSEA method
#>  GSVA version 2.6.0
#>  Searching for rows with constant values
#>  Calculating ssGSEA scores for 280 gene sets
#>  Normalizing ssGSEA scores
#>  Calculations finished
#> [1] ">>>>> Signature esitmation was completed: STAD"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "hallmark"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "go_bp"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "go_cc"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "go_mf"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "kegg"
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "reactome"
#>  Calculating signature scores using ssGSEA method
#>  Log2 transformation not necessary (data appears to already be log-scaled)
#>  Calculating scores for 12059 signature(s)
#>  GSVA version 2.6.0
#>  Searching for rows with constant values
#>  Calculating ssGSEA scores for 12059 gene sets
#>  Normalizing ssGSEA scores
#>  Calculations finished
#> [1] ">>>>> HALLMARK GO KEGG REACTOME esitmation was completed: STAD"
# }