Question: Mapping genome regions to gene symbols in two ways get weird results
0
gravatar for Na Sed
4.4 years ago by
Na Sed280
United States
Na Sed280 wrote:

I have some genome regions which I am gonna map them to gene symbols.

To do that there are two methods which have different result. I have mentioned one example below:

1) Using 'Homo.sapeins' package    

library(Homo.sapiens)
geneRanges <- function(db, column="ENTREZID")
{
  g <- genes(db, columns=column)
  col <- mcols(g)[[column]]
  genes <- granges(g)[rep(seq_along(g), elementLengths(col))]
  mcols(genes)[[column]] <- as.character(unlist(col))
  genes
}

gns <- geneRanges(Homo.sapiens, column="SYMBOL")

splitColumnByOverlap <-  function(query, subject, column="ENTREZID", ...)
{
  olaps <- findOverlaps(query, subject, ...)
  
  f1 <- factor(subjectHits(olaps), levels=seq_len(subjectLength(olaps)))
  
  splitAsList(mcols(query)[[column]][queryHits(olaps)], f1)
}

library(GenomicRanges)

cnv <- makeGRangesFromDataFrame(data.frame(chr="chr2", start=109993208, end=109993264))

gene.Symbol <- splitColumnByOverlap(gns, cnv, "SYMBOL")

The obtained gene symbol is 'SH3RF3'.

2) using 'biomaRt' package

library(GenomicRanges)
library(biomaRt)

mart <- useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl")
region <- "2:109993208:109993264"
gene.Symbol <- getBM(attributes = c("hgnc_symbol", "chromosome_name", "start_position","end_position"),
            filters = c("chromosomal_region"), values=region, mart=mart)


The obtained result is:

hgnc_symbol chromosome_name start_position end_position
1   LINC01123               2      109987063    109996140

Anyone knows why the results are different from each other?

Thanks.

ADD COMMENTlink modified 4.4 years ago by Devon Ryan92k • written 4.4 years ago by Na Sed280
3
gravatar for Devon Ryan
4.4 years ago by
Devon Ryan92k
Freiburg, Germany
Devon Ryan92k wrote:

You're using two different genome versions. Biomart is giving you overlaps on GRCh38. The Homo.Sapiens package is giving you overlaps on GRCh37.

ADD COMMENTlink written 4.4 years ago by Devon Ryan92k

Oh, I didn't notice to it.

Do you know which of them is suitable for hg19? How can I find that?

ADD REPLYlink modified 4.4 years ago • written 4.4 years ago by Na Sed280

hg19 is GRCh37.

ADD REPLYlink written 4.4 years ago by Devon Ryan92k

How you know Homo.sapiens is GRCh37?

ADD REPLYlink written 4.4 years ago by Na Sed280

I looked at the genes overlapping the region you specified in GRCh37 and GRCh38. The results from those matched perfectly what you described. It's unfortunate that that R package doesn't mention its genome version.

ADD REPLYlink written 4.4 years ago by Devon Ryan92k

Thank you so much.

ADD REPLYlink written 4.4 years ago by Na Sed280
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1854 users visited in the last hour