getSex: Estimating sample sex based on methylation data

View source: R/getSex.R

getSexR Documentation

Estimating sample sex based on methylation data

Description

Estimates samples sex based on methylation data.

Usage

getSex(object = NULL, cutoff = -2)
addSex(object, sex = NULL)
plotSex(object, id = NULL)

Arguments

object

An object of class [Genomic]MethylSet.

cutoff

What should the difference in log2 copynumber be between males and females.

sex

An optional character vector of sex (with values M and F).

id

Text used as plotting symbols in the plotSex function. Used for sample identification on the plot.

Details

Estimation of sex is based on the median values of measurements on the X and Y chromosomes respectively. If yMed - xMed is less than cutoff we predict a female, otherwise male.

Value

For getSex, a DataFrame with columns predictedSex (a character with values M and F), xMed and yMed, which are the chip-wide medians of measurements on the two sex chromosomes.

For addSex, an object of the same type as object but with the output of getSex(object) added to the pheno data.

For plotSex, a plot of xMed vs. yMed, which are the chip-wide medians of measurements on the two sex chromosomes, coloured by predictedSex.

Author(s)

Rafael A. Irizarry, Kasper D. Hansen, Peter F. Hickey

Examples

if(require(minfiData)) {
  GMsetEx <- mapToGenome(MsetEx)
  estSex <- getSex(GMsetEx)
  GMsetEx <- addSex(GMsetEx, sex = estSex)
}

hansenlab/minfi documentation built on May 3, 2024, 3:49 p.m.