Skip to contents

[Experimental]

This helper function queries BioMart for lengths of genes by adding up all exon lengths after reducing overlaps.

Usage

h_get_size_biomart(gene_ids, id_var, mart)

Arguments

gene_ids

(character)
gene IDs, e.g. 10329, i.e. already without the Entrez GeneID prefix, or ENSG00000241644 for Ensembl gene ID.

id_var

(string)
corresponding gene ID variable name in BioMart, i.e. entrezgene_id or ensembl_gene_id.

mart

(Mart)
given biomaRt::Mart object.

Value

Named integer vector indicating the gene lengths.

Examples

if (interactive()) {
  mart <- biomaRt::useMart("ensembl", dataset = "hsapiens_gene_ensembl")
  h_get_size_biomart("11185", "entrezgene_id", mart)
  h_get_size_biomart("ENSG00000215417", "ensembl_gene_id", mart)
  h_get_size_biomart(c("11185", "10677"), "entrezgene_id", mart)
  h_get_size_biomart(c("ENSG00000135407", "ENSG00000215417"), "ensembl_gene_id", mart)
}