Create a function to convert gene or protein IDs

Description

Creates a function based on an AnnotationDb package. This package accepts a vector of input IDs and returns a vector of output IDs. If an input ID cannot be mapped to an output ID, to output vector will be one element shorter. This behaviour can be changed by setting the additional na.rm argument to FALSE. Likewise, if an input ID maps to multiple output IDs, the output vector will contain all of the latter. If you really need the output vector to have the same length as the input vector, you can set the drop.ambiguous argument to TRUE

Usage

1
createIDConverter(annotationPackageName, from, to)

Arguments

annotationPackageName

The name of the AnnotationDb package that will be used to create the conversion function. The package will be loaded automically if necessary.

from

The ID type to convert from. This should be one of the available keytypes in the AnnotationDb package. Use the keytypes function to find out which keytypes can be used.

to

The ID type to convert to. This should be one of the available columns in the AnnotationDb package. Use the cols function to find out which column names can be used.

Value

A function which takes a vector of input IDs as single argument and returns another vector with the converted IDs.

Author(s)

Cedric Simillion