convert_ensembl: convert_ensembl

View source: R/convert_ensembl.R

convert_ensemblR Documentation

convert_ensembl

Description

Converts an Ensemble data.table into other gene types using a conversion table

Usage

convert_ensembl(
  my_dt,
  conversion_table_path = get_human_ensembl_to_hgnc_entrez_path(),
  convert_to_column = "hgnc_symbol",
  gene_biotypes = NULL,
  function_for_combining_counts = sum,
  readme_path = NULL,
  this_script_path = NULL,
  thread_num = 1
)

Arguments

my_dt

Input data.table with transcript counts. Should have samples by row, first columns should be the sample id with all subsequent columns headers in the Ensembl ENST format (no version). Assumes the first column is the sample_key.

conversion_table_path

Table to convert ensembl to other types

convert_to_column

If using get_human_ensembl_to_hgnc_entrez_path, choose from: gene_id, hgnc_symbol, entrez_id or hgnc_entrez (eg, hgnc_symbol|entrez_id; not recommended, gene counts will be used several times when HGNC1|1 & HGNC2|1 map to the same ENST)

gene_biotypes

The type of biomaRt gene_biotypes that should be output to the gene level output. Recommend you keep all of them. Many gene signature use lots of different biotypes. Our bgvlab sigs use 18 types which is 228322/234393 of the ENST and 54367/59453 of the HGNC.

function_for_combining_counts

Name of function to use to combine the genes. FWIW Joel Parker recommends that transcript colunt columns should be added to get gene level counts and microarrays should be averaged.

readme_path

Optional path to which the comments will be appended.

this_script_path

Path to script that runs this function for documentation purposes

Details

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ convert_ensembl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ToDos Make this take start from different types(eg: go from ensg to hgnc etc)

Value

Returns a data.table with isoforms converted to genes.


Benjamin-Vincent-Lab/PostRNASeqAlign documentation built on Feb. 14, 2024, 8:31 a.m.