assess.pgs.vcf.allele.match {ApplyPolygenicScore}R Documentation

Assess PGS allele match to VCF allele

Description

Assess whether PGS reference and effect alleles match provided VCF reference and alternative alleles. Mismatches are checked for potential switching of effect and reference PGS alleles (cases where the effect allele is the REF VCF allele) and are evaluated for DNA strand flips (by flipping the PGS alleles). INDEL alleles are not supported for strand flip assessment.

Usage

assess.pgs.vcf.allele.match(
  vcf.ref.allele,
  vcf.alt.allele,
  pgs.ref.allele,
  pgs.effect.allele,
  return.indels.as.missing = FALSE,
  return.ambiguous.as.missing = FALSE
)

Arguments

vcf.ref.allele

A character vector of singular VCF reference (REF) alleles.

vcf.alt.allele

A character vector of VCF alternative (ALT) alleles. Multiple alleles at a multiallelic site must be separated by commas.

pgs.ref.allele

A character vector of singular PGS reference alleles aka "non-effect" or "other" alleles.

pgs.effect.allele

A character vector of singular PGS effect alleles.

return.indels.as.missing

A logical value indicating whether to return NA for INDEL alleles with detected mismatches. Default is FALSE.

return.ambiguous.as.missing

A logical value indicating whether to return NA for ambiguous cases where both a strand flip and effect switch are possible, or no strand flip is detected and a mismatch cannot be resolved. Default is FALSE.

Value

A list containing the match assessment, a new PGS effect allele, and a new PGS other allele.

Output Structure

The outputed list contains the following elements:

The match.status output indicates the following:

Examples

# Example data demonstrating the following cases in each vector element:
# 1. no strand flips
# 2. effect allele switch
# 3. strand flip
# 4. effect allele switch AND strand flip
# 5. palindromic (ambiguous) alleles
# 6. unresolved mismatch
vcf.ref.allele <- c('A', 'A', 'A', 'A', 'A', 'A');
vcf.alt.allele <- c('G', 'G', 'G', 'G', 'T', 'G');
pgs.ref.allele <- c('A', 'G', 'T', 'C', 'T', 'A');
pgs.effect.allele <- c('G', 'A', 'C', 'T', 'A', 'C');
assess.pgs.vcf.allele.match(vcf.ref.allele, vcf.alt.allele, pgs.ref.allele, pgs.effect.allele);

[Package ApplyPolygenicScore version 3.0.1 Index]