GeneratePanelSize: Generate a panel-context matrix

View source: R/L_matrix_Generation.R

GeneratePanelSizeR Documentation

Generate a panel-context matrix

Description

Generate a panel-context matrix from panel-coordinate information.

Usage

 GeneratePanelSize(genomic_information, Class = c("SBS", "DBS"), 
          SBS_order = c("COSMIC", "signeR"), ref.genome="hg19")

Arguments

genomic_information

Data frame of panel information (see details).

Class

A character string specifying the mutation class. Must be either "SBS" (for single base substitutions) or "DBS" (for double base substitutions). If "DBS" is selected, the SBS_order argument is ignored.

SBS_order

Mutation-type order, either "COSMIC" or "signeR" (see details).

ref.genome

The reference genome, either "hg19" or "hg38".

Details

The first argument genomic_information must contain the columns Chromosome, Start_Position, End_Position and SEQ_ASSAY_ID. The Chromosome column identifies the chromosome, Start_Position and End_Position define the targeted interval, and SEQ_ASSAY_ID identifies the sequencing assay or panel. These column names must be provided exactly. BED target-region files can first be converted into this format with ReadBEDAsPanelInfo.

For SBS analyses, SBS_order = "COSMIC" returns the COSMIC-style SBS96 mutation-channel order and SBS_order = "signeR" returns the order used by the signeR package. This argument controls the row order of the returned mutation-opportunity matrix only; the COSMIC reference-signature version used for mapping is controlled separately by MappingSignature.

Note: The result of GeneratePanelSize() may not be an L matrix. For the standard preprocessing workflow, users can call GenerateLMatrix directly with panel-coordinate and sample-panel annotation data. GeneratePanelSize() is retained as a lower-level helper for users who want to inspect or reuse panel-level context counts. The resulting panel-level matrix can be used as the opportunity matrix for signeR() or expanded to a sample-level L matrix with GenerateLMatrix. The mutation-channel row order must match the row order of the mutation-count matrix V.

Value

A data frame of P by S, where P is the number of mutation channels (96 for SBS or 78 for DBS) and S is the number of sequencing panels (SEQ_ASSAY_ID). Entries denote mutation opportunities per million base pairs for each panel.

Author(s)

Donghyuk Lee <dhyuklee@pusan.ac.kr> and Bin Zhu <bin.zhu@nih.gov>

See Also

GenerateLMatrix, GenerateVMatrix, ReadBEDAsPanelInfo, EstimateSigActivity

Examples

  data(SimData, package="SATS")
  keep <- match(SimData$PatientInfo$SEQ_ASSAY_ID,
                unique(SimData$PanelEx$SEQ_ASSAY_ID), nomatch=0) > 0
  PatientInfo <- SimData$PatientInfo[keep, ]

  ## For the single base substitution (SBS) case:
  Panel_context1 <- GeneratePanelSize(genomic_information = SimData$PanelEx, Class = "SBS",  
                                      SBS_order = "COSMIC", ref.genome="hg19")
  L_mat1 <- GenerateLMatrix(Panel_context1, PatientInfo)
  Panel_context2 <- GeneratePanelSize(genomic_information = SimData$PanelEx, Class = "SBS",  
                                      SBS_order = "signeR", ref.genome="hg19")
  L_mat2 <- GenerateLMatrix(Panel_context2, PatientInfo)

  ## For the double base substitution (DBS) case:
  Panel_context_DBS <- GeneratePanelSize(genomic_information = SimData$PanelEx, Class = "DBS", 
                                         ref.genome = "hg19")
  L_mat_DBS  <- GenerateLMatrix(Panel_context_DBS, PatientInfo)

  # For more detailed usage, please refer to README and the user manual
  # in https://github.com/binzhulab/SATS/tree/main 

SATS documentation built on Sept. 16, 2026, 1:06 a.m.