% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/de_util.R
\name{diff_expr_biomart}
\alias{diff_expr_biomart}
\title{Function to retrieve additional information from biomart}
\usage{
diff_expr_biomart(
  d3,
  biom.data.set = "hsapiens_gene_ensembl",
  biom.mart = "ensembl",
  host = "https://www.ensembl.org",
  biom.filter = "ensembl_gene_id",
  biom.attributes = c("ensembl_gene_id", "hgnc_symbol", "description"),
  biom.cache = NULL,
  use.cache = FALSE,
  sym.col = "hgnc_symbol",
  rm.dups = FALSE,
  force.ensg = FALSE,
  verbose = FALSE
)
}
\arguments{
\item{d3}{data frame to be annotated with biomart; annotated output table generated by performing pair-wise comparisons and
corresponding statistical tests.}

\item{biom.data.set}{\code{character} of length one. Biomart data set to use.}

\item{biom.mart}{\code{character} vector. Biomart to use (uses the first element of the vector), defaults to "ensembl".}

\item{host}{\code{character} of length one. Host URL.}

\item{biom.filter}{\code{character} of length one. Name of biomart filter, i.e., type of query ids, defaults to "ensembl_gene_id".}

\item{biom.attributes}{\code{character} vector. Biomart attributes, i.e., type of desired result(s); make sure query id type is included!}

\item{biom.cache}{\code{character}. Path name giving the location of the cache \command{getBM()} uses if \code{use.cache=TRUE}. Defaults to the value in the \emph{BIOMART_CACHE} environment variable.}

\item{use.cache}{(\code{logical}). Should \command{getBM()} use the cache? Defaults to \code{TRUE} as in the \command{getBM()} function and is passed on to that.}

\item{sym.col}{\code{character}. Name of the column in the query result with gene symbols.}

\item{rm.dups}{\code{logical}. Should duplicated input IDs (\option{biom.filter}) be removed from the result?}

\item{force.ensg}{\code{logical}. Should Ensembl Gene IDs be checked for (and stripped of) Ensembl version numbers? Defaults to \code{FALSE}.}

\item{verbose}{\code{logical}. Passed to \code{convert.bm()}/\code{getBM()} to show query and
chunk progress for large BioMart queries. Defaults to \code{FALSE}.}
}
\value{
A \code{data.frame}: the input table \option{d3} merged with the annotation retrieved from
  biomart. The column holding gene symbols is renamed to \code{gene_symbol}.
}
\description{
Function to retrieve additional information from biomart
}
\examples{
\donttest{
# Needs network access to Ensembl BioMart. The query is wrapped in tryCatch() so that an
# unreachable or slow server reports the problem instead of failing the example.
if (requireNamespace("biomaRt", quietly = TRUE)) {
  d3 <- data.frame(ID = c("ENSG00000141510", "ENSG00000012048"))
  ann <- tryCatch(diff_expr_biomart(d3, biom.data.set = "hsapiens_gene_ensembl"),
                  error = function(e) {
                    message("BioMart not reachable: ", conditionMessage(e))
                    NULL
                  })
  if (!is.null(ann)) nrow(ann)
}
}
}
