compute.gw.coordinates {GRIN2} | R Documentation |
Compute Genome-wide Plotting Coordinates
Description
Computes and assigns genome-wide plotting coordinates to lesion, gene, and chromosome data for use in genome-wide lesion plots.
Usage
compute.gw.coordinates(grin.res, scl = 1e+06)
Arguments
grin.res |
GRIN results, typically the output of the |
scl |
Chromosome unit length in base pairs. Default is 1,000,000, meaning each chromosome is divided into segments of 1 million base pairs for plotting. |
Details
This function processes the GRIN results to add genome-wide x-axis coordinates necessary for plotting lesions and genes across all chromosomes. It divides each chromosome into segments based on the specified scl
value and computes cumulative start and end positions across chromosomes to ensure a continuous x-axis. Specifically:
Chromosome sizes are updated to include
x.start
andx.end
columns, where each chromosome starts where the previous one ends.Gene and lesion data are similarly updated with
x.start
andx.end
coordinates, scaled byscl
, and adjusted for cumulative chromosome positions.
Value
A list identical in structure to the original grin.res
object, with the following additions:
- gene.hits
Unchanged. GRIN gene-level summary statistics, including hit counts and p/q-values.
- gene.lsn.data
Unchanged. Gene-lesion overlaps showing which lesion affects which gene for each patient.
- lsn.data
Input lesion data with added
x.start
andx.end
columns for genome-wide coordinates.- gene.data
Input gene annotation data with added
x.start
andx.end
columns for genome-wide coordinates.- chr.size
Chromosome size table (22 autosomes + X and Y) with added
x.start
andx.end
columns for plotting.- gene.index
Mapping of
gene.lsn.data
rows to their corresponding chromosomes.- lsn.index
Mapping of
gene.lsn.data
rows to their corresponding lesions.
Author(s)
Abdelrahman Elsayed abdelrahman.elsayed@stjude.org, Stanley Pounds stanley.pounds@stjude.org
References
Cao, X., Elsayed, A. H., & Pounds, S. B. (2023). Statistical Methods Inspired by Challenges in Pediatric Cancer Multi-omics.
See Also
Examples
data(lesion_data)
data(hg38_gene_annotation)
data(hg38_chrom_size)
# Run GRIN model
grin.results <- grin.stats(lesion_data,
hg38_gene_annotation,
hg38_chrom_size)
# Assign genome-wide coordinates for plotting
genome.coord <- compute.gw.coordinates(grin.results)