check_sex: Sex check

View source: R/check_sex.R

check_sexR Documentation

Sex check

Description

Predicts sex using k nearest neighbour classification based on expression of sex specific genes.

Usage

check_sex(
  se,
  assay = 1,
  gene.column = "symbol",
  info.sex.genes,
  sex.column = "sex",
  col = c("red", "blue"),
  title = NULL,
  ellipse = TRUE,
  ellipse.type = "norm"
)

Arguments

se

RangedSummarizedExperiment-class object

assay

Character or integer. Name or number of assay containing expression data to be used for sex check.

gene.column

Character. Column in rowData containing gene symbols (default: "symbol") or "rownames" if rownames should be used.

info.sex.genes

data.frame. Information about sex chromosomal genes (see info.sex.genes).

sex.column

Character. Column in colData containing sex information.

col

Character vector. Colours to be used for coloring sex in MDS plot (default: red and blue).

title

Character. Title of the plot. If NULL title will be set to "MDS (sex specific genes)".

ellipse

Logical. Should ellipses around points be drawn? (default: TRUE).

ellipse.type

Character. Type of ellipse as given in ggscatter (default: "norm").

genes

Character vector. Symbols of sex specific genes to be used in classification (default: genes collected from the literature, see details).

Value

List with the following components:

  • info: data.frame with information about samples with wrong sex or NULL

  • plot: MDS plot as returned by plot_mds_pca_2d

Examples

data("se.gene")
data("info.sex.genes")

check_sex(se = se.gene,
          info.sex.genes = info.sex.genes,
          gene.column = "Gene.symbol",
          sex.column = "Sex")

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.