infer_feature_type: Guesses the type of feature identifiers from a character...

View source: R/feature-types.R

infer_feature_typeR Documentation

Guesses the type of feature identifiers from a character vector.

Description

We rely on meta-information about our data types than "usual", and its useful to know what types of identifiers we are using for different assay. This function tries to guess whether an identifier is an ensembl gene identifier, entrez id, etc.

Usage

infer_feature_type(x, with_organism = FALSE, ...)

Arguments

x

a character vector of ids

Details

A two-column data.frame is returned for id_type and organism. Organism is "unknown" for identifiers where there this can't be inferred (like Refseq).

If an identifier matches more than one id_type, the id_type is set to "ambiguous". If the identifier doesn't match any guesses, then "unknown".

Value

data.frame with id (x) and id_type. If with_organism = TRUE, a third organism column is added with a guess for the organism.

Examples

fids <- c("NC_000023", "ENSG00000101811", "ENSMUSG00000030088.2", "85007")
infer_feature_type(fids)

facileverse/FacileData documentation built on Feb. 24, 2024, 7:59 a.m.