Preprocess input GRanges object for splicing event calculation
Source:R/input_formatting.R
preprocess.RdThis function checks that the input is a valid GRanges object with required metadata columns, then adds a unique key, the number of exons per transcript, and an 'internal' flag for each exon. It also initializes an 'event' column for downstream splicing event annotation.
Arguments
- gr
A GRanges object with metadata columns: 'exon_rank', 'gene_id', 'tx_id', 'coef'.
- coef_col
The name of the metadata column indicating upregulated (+1) and downregulated (-1) exons.
- method_string
The Differential Transcript Usage (DTU) method used to obtain the coef_col, for annotation purposes (optional).
Examples
# create mock data and run preprocessing
gr <- create_mock_data(n_genes = 2, n_tx = 4, n_exons = 4) |>
preprocess(coef_col = "estimate", method_string = "mock_method")