get_name_transfertab: Convert Original Gene ID into Target Gene ID

View source: R/pipeline_functions.R

get_name_transfertabR Documentation

Convert Original Gene ID into Target Gene ID

Description

get_name_transfertab converts the original gene IDs into target gene IDs, with conversion table provided.

Usage

get_name_transfertab(
  use_genes = NULL,
  transfer_tab = NULL,
  from_type = NULL,
  to_type = NULL,
  ignore_version = FALSE,
  ignore_order = FALSE
)

Arguments

use_genes

a vector of characters, the genes for ID conversion.

transfer_tab

data.frame, the conversion table. Users can create it by calling get_IDtransfer.

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 see all available attributes in the selected dataset. If NULL, will use the first column of transfer_tab.

to_type

character, the attribute name to convert into. If NULL, will use the second column of transfer_tab.

ignore_version

logical, if TRUE and from_type is "ensembl_gene_id_version" or "ensembl_transcript_id_version", the version will be ignored. Default is FALSE.

ignore_order

logical, whether need to ignore the output order to match the input list of use_genes. Default is FALSE.

Value

Return a vector of converted gene IDs.

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=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.