Entering edit mode
G M
▴
20
@g-m-3388
Last seen 10.4 years ago
Hi all,
I'm currently trying to write a script allowing me to get some
informations about several (actually about 18000 per file) sequence
intervals. My query works, but I can't throw it all my file long.
Basically, I throw my request with getBM as many as my file got lines,
but after a while, the connection cuts, and i have this error message
:
Erreur dans postForm(paste(martHost(mart), "?", sep = ""), query =
xmlQuery) :
couldn't connect to host
Is there a way to "test" the postForm method or the connection with
biomaRt from R before throwing the request ?
Here is my script :
file="/myfile"
chr=9
db=useMart("ensembl")
ensembl=useDataset("hsapiens_gene_ensembl",mart=db)
filtres = c("chromosome_name","start","end")
attributs = c("ensembl_gene_id","embl","description","start_position",
"end_position")
data <- read.table(file, sep="\t", header=T)
query <- function (chr,start, end) {
valeurs = list(chr, start, end)
genes=getBM(mart=ensembl,
filters=filtres,values=valeurs,attributes=attributs)
martDisconnect(ensembl)
}
genes=c()
for(i in 1:nrow(data)){
genes=query(chr,data[i,1],data[i,2])
}
Thanks for your help,
Marion
[[alternative HTML version deleted]]