convert.pgs.to.bed: Convert PGS data to BED format

View source: R/convert-pgs-to-bed.R

convert.pgs.to.bedR Documentation

Convert PGS data to BED format

Description

Convert imported and formatted PGS compnent SNP coordinate data to BED format.

Usage

convert.pgs.to.bed(
  pgs.weight.data,
  chr.prefix = TRUE,
  numeric.sex.chr = FALSE,
  slop = 0
)

Arguments

pgs.weight.data

A data.frame containing SNP coordinate data with standardized CHROM and POS columns.

chr.prefix

A logical indicating whether the 'chr' prefix should be used when formatting chromosome name.

numeric.sex.chr

A logical indicating whether the sex chromosomes should be formatted numerically, as opposed to alphabetically.

slop

An integer indicating the number of base pairs to add to the BED interval on either side.

Value

A data.frame containing the PGS component SNP coordinate data in BED format and any other columns provided in pgs.weight.data.

Examples

pgs.weight.data <- data.frame(
    CHROM = c('chr1', 'chrX'),
    POS = c(10, 20)
    );
convert.pgs.to.bed(pgs.weight.data);

# Switch between different chromosome notations
convert.pgs.to.bed(pgs.weight.data, chr.prefix = FALSE, numeric.sex.chr = TRUE);

# Add slop to BED intervals
convert.pgs.to.bed(pgs.weight.data, slop = 10);

ApplyPolygenicScore documentation built on April 4, 2025, 12:18 a.m.