get_IDtransfer: Creates Data Frame for ID Conversion

View source: R/pipeline_functions.R

get_IDtransferR Documentation

Creates Data Frame for ID Conversion

Description

get_IDtransfer creates a data frame for ID conversion using biomaRt. For example, to convert Ensembl ID into gene symbol.

Usage

get_IDtransfer(
  from_type = NULL,
  to_type = NULL,
  add_type = NULL,
  use_genes = NULL,
  dataset = NULL,
  ignore_version = FALSE,
  useCache = TRUE
)

Arguments

from_type

character, the attribute name match the current ID type (the type of use_genes). Such as "ensembl_gene_id", "ensembl_gene_id_version", "ensembl_transcript_id", "ensembl_transcript_id_version" or "refseq_mrna". The "attribute" is inherited from the biomaRt package. For details, user can call biomaRt::listAttributes() to display all available attributes in the selected dataset.

to_type

character, the attribute name to convert into.

add_type

character, the additional attribute name to add into the conversion data frame.

use_genes

a vector of characters, the genes for ID conversion. If NULL, all genes will be selected.

dataset

character, name of the dataset used for ID conversion. For example, "hsapiens_gene_ensembl". If NULL, db_info[1] will be used. db_info requires the calling of db.preload in the previous steps. Default is NULL.

ignore_version

logical, if it is set to TRUE and from_type is "ensembl_gene_id_version" or "ensembl_transcript_id_version", the version of the original ID will be ignored in ID mapping. Default is FALSE.

useCache

Boolean, parameter pass to getBM() indicating whether the results cache should be used. Setting to FALSE will disable reading and writing of the cache.

Value

Return a data frame for ID conversion.

Examples

use_genes <- c("ENST00000210187","ENST00000216083","ENST00000216127",
             "ENST00000216416","ENST00000217233","ENST00000221418")
transfer_tab <- get_IDtransfer(from_type = 'ensembl_transcript_id',
                               to_type='external_gene_name',
                               use_genes=use_genes,
                               dataset='hsapiens_gene_ensembl')
                               ## get transfer table !!!
res1 <- get_name_transfertab(use_genes,transfer_tab=transfer_tab)
transfer_tab_withtype <- get_IDtransfer2symbol2type(from_type = 'ensembl_transcript_id',
                                                   use_genes=use_genes,
                                                   dataset='hsapiens_gene_ensembl')
                                                   ## get transfer table !!!
## Not run: 


jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.