Hi,
I am trying to convert "chromosome postions" to "hgnc_symbol" using R. I referred the below site. http://statisticalrecipes.blogspot.com/2012/08/biomart-find-gene-name-using-chromosome.html
The code is below.
Load the library
library(biomaRt)
Define biomart object
mart <- useMart(biomart="ensembl", dataset="hsapiensgeneensembl")
Gives a list of all possible annotations; Currently there are 1668 listed
listAttributes(mart)
I chose to filter by: chromosome_name, start, end
listFilters(mart)
Read in tab-delimited file with three columns: chromosome number, start position and end position
positions <- read.table("positions.txt")
Extract HGNC gene symbol
results <- getBM(attributes = c("hgncsymbol", "chromosomename", "startposition", "endposition"), filters = c("chromosome_name", "start", "end"), values = list(positions[,1], positions[,2], positions[,3]), mart = mart)
================================================================================ After I got to run the code, I got this error message
*"Error in getBM(attributes = c("hgnc_symbol", "chromosome_name", "start_position", : Query ERROR: caught BioMart::Exception::Usage: Wrong format value for Start "*
My Input file format(positions.txt) start like below; chromosome_name startend 1 62920 16855942 1 16863509 16932568 ....
Would you advise to fix the error message? I appreciate for your help alot.
Thanks in advance!
Kelly
Mike, It works perfectly. Thanks alot!
One more, how can I check the reference genome version? If the reference genome version is different, can I put a command line in this R script?
I appreciate for your help!
The currently used reference sequence versions for all vertebrates can be found on this page: https://www.ensembl.org/info/about/species.html
By default, when you don't provide a
host
to theuseEnsembl()
function, it will usewww.ensembl.org
and that will then use the most recent refence geneome. This means that you results could change over time, as Ensembl make new releases every 3 months where some fraction of the data will change.You can fix on using a specific version by providing the URL to the host argument for the version you want e.g. https://sep2019.archive.ensembl.org
You can view a full list of all available archive with
listEnsemblArchives()
I am trying to find modifications in genomic location. Now, the output I am getting is in the chromosome and location of the modification (attached file). I am not sure how to convert it into a gene name using biomart or any other tool. Would you mind if you please helping me in fixing this issue?
Please don't add comments on three year old posts. Instead, ask a new question.
I have asked a new question. If possible, please help me figure it out. Thanks
Convert Chromosome postion to gene symbol