get_IDtransfer2symbol2type: Create Data Frame for ID Conversion With Biotype Information

View source: R/pipeline_functions.R

get_IDtransfer2symbol2typeR Documentation

Create Data Frame for ID Conversion With Biotype Information

Description

get_IDtransfer2symbol2type creates a data frame to convert original ID into gene symbol and gene biotype (gene level), or into transcript symbol and transcript biotype (transcript level).

Usage

get_IDtransfer2symbol2type(
  from_type = NULL,
  use_genes = NULL,
  dataset = NULL,
  use_level = "gene",
  ignore_version = FALSE
)

Arguments

from_type

character, the attribute name matches 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() function to display all available attributes in the selected dataset.

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.

use_level

character, users can chose between "transcript" and "gene". Default is "gene".

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.

Value

Return a data frame for ID conversion, from ID to gene symbol and gene biotype.

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',
                                                   use_level='transcript')
                                                   ## get transfer table !!!
## Not run: 


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