switch_strand: Convert alleles to the opposing DNA strand

View source: R/switch_strand.R

switch_strandR Documentation

Convert alleles to the opposing DNA strand

Description

This function is a subroutine of QC_GWAS and match_alleles. It converts allele-pairs to the configuration on the opposing DNA strand.

Usage

switch_strand(input, strand_col = FALSE)

Arguments

input

table with the alleles in column 1 and 2, and (optionally) the strand-information (coded as "+" or "-") in column 3. Note: the alleles must be uppercase characters.

strand_col

logical; if strand-information is present, this switches the sign in column 3 as well.

Value

A table with two or three columns, depending on strand_col.

See Also

match_alleles

Examples

  data("gwa_sample")

  switched_data <- gwa_sample[ , c("MARKER", "EFFECT_ALL",
                                   "OTHER_ALL", "STRAND")]
  switched_data[1:10, ]

  switched_data[ , 2:4] <- switch_strand(input =
            switched_data[ , 2:4], strand_col = TRUE)
  switched_data[1:10, ]

QCGWAS documentation built on May 30, 2022, 5:05 p.m.