Extracting gene list from chromosome number and location


Hi All,

I am trying to extract gene list from chromosome number and position, for that I am using biomaRt in R but I am getting error messages as shown below. Also below is the code I am using for extraction.


ensembl <- useMart("ensembl")
datasets <- listDatasets(ensembl)
ensembl = useDataset("rnorvegicus_gene_ensembl",mart=ensembl)
AT_AC_Gene <- read.csv("AT-AC-methylkit_biomart-4-7-21.csv",header=T)
attributes <- c("external_gene_name","ensembl_gene_id","start_position","end_position","rgd_symbol","chromosome_name")
filters <- c("chromosome_name","start","end")
values <- list(AT_AC_Gene$chr,AT_AC_Gene$start,AT_AC_Gene$end)
final_1 <- getBM(attributes=attributes, filters=filters, values=values, mart=ensembl)
Error message: Batch submitting query [==>---------------------------------------------------------------------]   5% eta: 35sError in .processResults(postRes, mart = mart, sep = sep, fullXmlQuery = fullXmlQuery,  : 
  Query ERROR: caught BioMart::Exception::Database: Error during query execution: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (main.seq_region_end_1020 >= '15108600' OR main.seq_region_end_1020 >= '9115' at line 1

Any help will be highly appreciated in resolving this issue.

Thanks in Advance.




Source link