cis.vs.trans.classification: Cis/trans classification of pQTL signals

View source: R/cis.vs.trans.classification.R

cis.vs.trans.classificationR Documentation

Cis/trans classification of pQTL signals

Description

Classify genetic association signals as cis or trans relative to the gene encoding the target protein.

Usage

cis.vs.trans.classification(
  hits,
  panel,
  id = "uniprot",
  radius = 1e+06,
  verbose = TRUE
)

Arguments

hits

Data frame of association signals containing at least:

  • identifier column (specified by id)

  • chromosome column Chr

  • position column bp

panel

Annotation data frame containing:

  • uniprot (or other id column)

  • gene, chr, start, end

id

Join key (default: "uniprot").

radius

Cis window size in base pairs (default: 1e6).

verbose

Logical; print summary if TRUE.

Details

A variant is classified as cis if it lies on the same chromosome as the gene and within a specified window around the gene boundaries.

Value

A list containing:

  • data: annotated data frame with cis/trans classification

    • p.gene, p.chr, p.start, p.end

    • cis (logical)

    • cis.trans ("cis" / "trans")

    • cis.start, cis.end

  • table: gene × cis/trans contingency table

  • total: named vector of total cis and trans counts

Examples

#----------------------------------------------------------
# minimal reproducible example
#----------------------------------------------------------

hits <- data.frame(
  uniprot = c("P1", "P2", "P3", "P1"),
  Chr = c("1", "1", "2", "1"),
  bp = c(100000, 2000000, 500000, 105000)
)

panel <- data.frame(
  uniprot = c("P1", "P2", "P3"),
  gene = c("G1", "G2", "G3"),
  chr = c("1", "1", "2"),
  start = c(90000, 1500000, 400000),
  end = c(110000, 2500000, 600000)
)

ct <- cis.vs.trans.classification(hits, panel)

ct$total
head(ct$data)
with(ct$data, table(p.gene, cis.trans))


gap documentation built on Oct. 27, 2026, 1:07 a.m.