View source: R/prep.gene.lsn.data.R
| prep.gene.lsn.data | R Documentation |
Prepares and indexes gene and lesion data for downstream GRIN (Genomic Random Interval) analysis. The function merges and orders gene and lesion coordinates to support efficient computation of overlaps between genes and genomic lesions. When requested, it also prepares gene- and chromosome-level exon target sizes for lesion types restricted to exonic regions.
prep.gene.lsn.data(lsn.data,
gene.data,
exons.annotation = NULL,
exon.chrom.size = NULL,
exon_level = NULL,
mess.freq = 10)
lsn.data |
A
|
gene.data |
A
|
exons.annotation |
An optional
|
exon.chrom.size |
An optional
The chromosome-level exon sizes should be derived from a genome-wide exon
annotation using the same genome assembly and representative-transcript
selection procedure used to construct |
exon_level |
An optional character vector specifying the lesion types
that should use exon-level target sizes in downstream GRIN probability
calculations. Lesions belonging to these types must be restricted to exonic
regions before analysis. For example, when mutations are specified for
exon-level analysis, exonic variants such as missense, nonsense, frameshift,
and synonymous mutations may be included, whereas intronic and other
non-coding mutations should be excluded before running the analysis.
The default is |
mess.freq |
Integer specifying the frequency of progress messages. The default is 10. |
The function first orders and indexes the lesion data by lesion type, chromosome, and subject and orders the gene annotation by chromosome and genomic position. Gene and lesion boundaries are then combined into a unified genomic position table.
The cty column in the combined table identifies the boundary represented
by each row:
Gene start.
Lesion start.
Lesion end.
Gene end.
The resulting table and index objects are used by
find.gene.lsn.overlaps() to identify gene-lesion overlaps.
When exon_level is specified, exon lengths are calculated from
exons.annotation and summed to determine the exon target size for each
matched gene. Chromosome-level exon target sizes are not calculated by
this function and must instead be supplied through exon.chrom.size.
exons.annotation may contain all genes in gene.data or only a subset.
Genes without matching exon annotations remain available for lesion types
analyzed using standard genomic coordinates, but their gene-level exon
target sizes are recorded as missing and exon-level probabilities are not
computed for those genes.
Gene-lesion overlaps continue to be determined using the complete genomic
coordinates of each gene, including when exon_level is specified.
Exon annotation is used only to calculate exon-based target sizes for
downstream probability calculations. Therefore, lesion types specified in
exon_level must contain only exonic lesions; non-exonic lesions must be
removed by the user before running the analysis.
Lesion types not included in exon_level continue to use the standard
chromosome-level GRIN workflow.
Exact duplicate exon records are removed before gene-level exon sizes are calculated. Incomplete or malformed exon records are excluded with a warning.
A list with the following components:
Processed lesion data, including indices identifying the
range of rows in gene.lsn.data corresponding to each lesion.
Processed gene annotation data, including indices
identifying the range of rows in gene.lsn.data corresponding to each
gene.
Combined and ordered data.frame of gene and lesion
positions. The cty column encodes the position type: 1 = gene start,
2 = lesion start, 3 = lesion end, and 4 = gene end.
Index data.frame indicating the ordered start and end
rows for each chromosome in the gene data.
Index data.frame indicating the ordered start and end
rows for lesion groups defined by lesion type, chromosome, and subject.
Numeric vector containing the total annotated exon
target size for each gene, aligned by gene.row. Genes without a valid
matching exon annotation receive NA and are excluded from probability
calculations for lesion types specified in exon_level. Returned as
NULL when exon_level = NULL.
A data.frame containing chromosome identifiers
in the chrom column and total genome-wide annotated exon target sizes in
the size column. Returned as NULL when exon_level = NULL.
The character vector of lesion types designated for
exon-level analysis. Returns NULL when exon-level preprocessing is not
requested.
Abdelrahman Elsayed abdelrahman.elsayed@stjude.org and Stanley Pounds stanley.pounds@stjude.org
Pounds, S., et al. (2013). A genomic random interval model for statistical analysis of genomic lesion data.
Cao, X., Elsayed, A. H., & Pounds, S. B. (2023). Statistical Methods Inspired by Challenges in Pediatric Cancer Multi-omics.
order.index.gene.data,
order.index.lsn.data,
find.gene.lsn.overlaps
data(lesion_data)
data(hg38_gene_annotation)
data(example_exon_annotation)
data(hg38_exon_chrom_size)
# Prepare gene and lesion data using the optional arguments
# for exon-level analysis
prep.gene.lsn <- prep.gene.lsn.data(
lsn.data = lesion_data,
gene.data = hg38_gene_annotation,
exons.annotation = example_exon_annotation,
exon.chrom.size = hg38_exon_chrom_size,
exon_level = "mutation"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.