removeSNPs {trio} | R Documentation

## Remove SNPs or Trios

### Description

Functions for removing SNPs with a low minor allele frequency or a high percentage of missing values, for removing trios in which at least one member shows a high percentage of missing values, for ordering the SNPs by their position in the genome, and for computing the minor allele frequencies of the SNPs based on only the genotypes of the parents, where each parent is only used once in this computation, even if this person is part of more than one of the trios.

### Usage

    removeSNPs(geno, maf = NA, perc.na = NA)

    removeTrios(geno, perc.na = 1)

    orderSNPs(geno, map, snp = "SNP", orderBy = c("Chr", "Position"))

    colMAFtrio(geno, changeMinor = FALSE)

### Arguments

`geno` | a matrix in genotype format, i.e.\ the output of `ped2geno` or `read.pedfile` with `p2g` set to `TRUE`.
`maf` | a numeric value. If specified, i.e.\ not `NA`, all SNPs with a minor allele frequency less than `maf` are removed, where `maf` can range from 0 and 0.2. If, e.g., `maf = 0`, monomorphic SNPs are removed.
`perc.na` | a numeric value between 0 and 1 specifying a cutoff for the percentage of missing values that a SNP or a subject is allowed to have. If more than 100 * `perc.na`% of the genotypes of a SNP or a subject is missing, then this SNP or the trio to which this subject belong, respectively, is removed `geno`.
`map` | a data frame containing the chromosome and the position for all the SNPs in `geno`.
`snp` | a character string giving the (case-sensitive) name of the column of `map` containing the SNP IDs used as column names in `geno`.
`orderBy` | character string of length 2 specifying the (case-sensitive) names of the columns of `map` containing the chromosomes and the positions of the SNPs in `geno`.
`changeMinor` | logical specifying whether 1 - minor allele frequency should be returned when the MAF is larger than 0.5. The MAF might be larger than 0.5, if the minor allele was specified on another data set than the one considered in `colMAFtrio`.

### Value

For `removeSNPs`, `removeTrios`, and `orderSNPs`, a reduced or ordered version of `geno`. For `colMAFtrio`, a vector containing the minor allele frequencies of the SNPs in `geno`.

### Author(s)

Holger Schwender, holger.schwender@udo.edu

### Examples

    # Load the simulated data.
    data(trio.data)

    # All SNPs with a minor allele frequency smaller than 0.1
    # can be removed from mat.test by
    mat2 <- removeSNPs(mat.test, maf = 0.1)

    # The minor allele frequencies for all SNPs can be
    # determined (based on the genotypes of the parents) by
    maf <- colMAFtrio(mat.test)

[Package trio version 3.24.3 Index]