convert.variants.to.numeric: convert.variants.to.numeric

Description Usage Arguments Details Value Author(s) Examples

View source: R/convert.variants.to.numeric.R

Description

Given a matrix or data frame with character ACGT SNP values, convert them to numeric values with the major allele coded as 0 and the minor allele as 1.

Usage

1

Arguments

variants

Data frame with four header columns. The SNPs must be in ACGT format in columns 5 through ncol(snps).

Details

This function is used before calling plot.alleles() to convert the SNPs into a numeric form suitable for plotting.

Value

Data.frame of the same dimentions as the snps argument, but with the alleles converted to 0 or 1.

Author(s)

Daniel Gatti

Examples

1
2

Example output

Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: Biostrings
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Loading required package: Rsamtools

SNPtools documentation built on May 29, 2017, 3:12 p.m.