switch_strand: Convert alleles to the opposing DNA strand

Description Usage Arguments Value See Also Examples

View source: R/switch_strand.R

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

1
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

1
2
3
4
5
6
7
8
9
  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, ]

Example output

QCGWAS library, version 1.0-8

A quick start guide (and other documentation)
can be found in the 'R/library/QCGWAS/doc' folder
         MARKER EFFECT_ALL OTHER_ALL STRAND
266    rs941531          G         A      +
531   rs2843127          G         A      +
797   rs6680392          G         A      +
1060  rs2817159          G         A      +
1320  rs4648505          T         C      +
1584  rs7522227          G         A      +
1846  rs4233257          G         A      +
2111 rs12691488          T         C      +
2371  rs1109048          T         C      +
2631   rs171221          T         C      +
         MARKER EFFECT_ALL OTHER_ALL STRAND
266    rs941531          C         T      -
531   rs2843127          C         T      -
797   rs6680392          C         T      -
1060  rs2817159          C         T      -
1320  rs4648505          A         G      -
1584  rs7522227          C         T      -
1846  rs4233257          C         T      -
2111 rs12691488          A         G      -
2371  rs1109048          A         G      -
2631   rs171221          A         G      -

QCGWAS documentation built on May 2, 2019, 3:19 p.m.