View source: R/grin.oncoprint.mtx.R
| grin.oncoprint.mtx | R Documentation |
Creates a gene-by-subject lesion matrix from GRIN analysis results for use
with the oncoPrint() function from the ComplexHeatmap package.
Each matrix cell contains the lesion type or lesion types affecting a
selected gene in a given subject.
grin.oncoprint.mtx(grin.res, oncoprint.genes)
grin.res |
A GRIN results object, typically generated by
|
oncoprint.genes |
A character vector of Ensembl gene IDs specifying the genes to include in the OncoPrint. Genes are retained in the order supplied by the user when lesion records are available. |
The function filters grin.res$gene.lsn.data to the requested genes
and constructs a gene-by-subject character matrix. Rows represent genes,
columns represent subjects, and each matrix cell contains the lesion type
or lesion types observed for that gene-subject combination. Multiple lesion
types are separated by semicolons.
Gene symbols from grin.res$gene.data are used as row labels when
available. If a gene symbol is missing or empty, the corresponding Ensembl
gene ID is used instead. If multiple Ensembl gene IDs share the same gene
symbol, row labels are made unique automatically.
Genes without lesion records in grin.res$gene.lsn.data are not
included in the returned matrix.
The resulting matrix can be supplied directly to
oncoPrint.
A character matrix with genes as rows and subjects as columns. Matrix entries contain semicolon-separated lesion types for affected gene-subject combinations and empty strings for unaffected combinations. Row names contain gene symbols when available and otherwise Ensembl gene IDs.
Abdelrahman Elsayed abdelrahman.elsayed@stjude.org and Stanley Pounds stanley.pounds@stjude.org
Cao, X., Elsayed, A. H., & Pounds, S. B. (2023). Statistical Methods Inspired by Challenges in Pediatric Cancer Multi-omics.
grin.stats,
oncoPrint
data(lesion_data)
data(hg38_gene_annotation)
data(hg38_chrom_size)
# Run GRIN analysis
grin.results <- grin.stats(
lesion_data,
hg38_gene_annotation,
hg38_chrom_size
)
# Define genes to include in the OncoPrint
oncoprint.genes <- c(
"ENSG00000148400",
"ENSG00000171862",
"ENSG00000171843",
"ENSG00000156531"
)
# Generate an OncoPrint-compatible lesion matrix
oncoprint.mtx <- grin.oncoprint.mtx(
grin.results,
oncoprint.genes
)
# Genes can also be selected directly from GRIN results
genes.const <- grin.results$gene.hits[
grin.results$gene.hits$q2.nsubj < 0.01,
]
selected.genes <- genes.const$gene
oncoprint.mtx <- grin.oncoprint.mtx(
grin.results,
selected.genes
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.