annotateBMFeatures {scater} | R Documentation

## Get feature annotation information from Biomart

### Description

Use the biomaRt package to add feature annotation information to an `SingleCellExperiment`.

### Usage

    annotateBMFeatures(ids, biomart = "ENSEMBL_MART_ENSEMBL",
      dataset = "mmusculus_gene_ensembl", id.type = "ensembl_gene_id",
      symbol.type, attributes = c(id.type, symbol.type, "chromosome_name",
      "gene_biotype", "start_position", "end_position"), filters = id.type,
      ...)

    getBMFeatureAnnos(x, ids = rownames(x), ...)

### Arguments

`ids` | A character vector containing feature identifiers.
`biomart` | String defining the biomaRt to be used, to be passed to `useMart`.
`dataset` | String defining the dataset to use, to be passed to `useMart`.
`id.type` | String specifying the type of identifier in `ids`.
`symbol.type` | String specifying the type of symbol to retrieve. If missing, this is set to `"mgi_symbol"` if `dataset="mmusculus_gene_ensembl"`, or to `"hgnc_symbol"` if `dataset="hsapiens_gene_ensembl"`,
`attributes` | Character vector defining the attributes to pass to `getBM`.
`filters` | String defining the type of identifier in `ids`, to be used as a filter in `getBM`.
`...` | For `annotateBMFeatures`, further named arguments to pass to `biomaRt::useMart`. For `getBMFeatureAnnos`, further arguments to pass to `annotateBMFeatures`.
`x` | A SingleCellExperiment object.

### Details

These functions provide convenient wrappers around biomaRt to quickly obtain annotation in the required format.

### Value

For `annotateBMFeatures`, a DataFrame containing feature annotation, with one row per value in `ids`.

For `getBMFeatureAnnos`, `x` is returned containing the output of `annotateBMFeatures` appended to its `rowData`.

### Author(s)

Aaron Lun, based on code by Davis McCarthy

### Examples

    ## Not run:
    # Making up Ensembl IDs for demonstration purposes.
    mock_id <- paste0("ENSMUSG", sprintf("%011d", seq_len(1000)))
    anno <- annotateBMFeatures(ids=mock_id)

    ## End(Not run)

[Package scater version 1.14.0 Index]