Entering edit mode
Hi, I am trying to use the code given below but I am getting this error Error: disk I/O error
I was wondering what might be going wrong.
getGenePositions= function(gene.names,ensembl.version="nov2020.archive.ensembl.org",species="human"){
if (species=="human"){
ensembl = biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl",
host=ensembl.version)
gene.positions <- biomaRt::getBM(attributes=c('ensembl_gene_id','hgnc_symbol','chromosome_name','start_position','end_position'),
filters ='hgnc_symbol', values =gene.names, mart = ensembl)
}
else {
ensembl = biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL", dataset = "mmusculus_gene_ensembl",
host=ensembl.version)
gene.positions <- biomaRt::getBM(attributes=c('ensembl_gene_id','mgi_symbol','chromosome_name','start_position','end_position'),
filters ='mgi_symbol', values =gene.names, mart = ensembl)
}
gene.positions=gene.positions[!duplicated(gene.positions[,2]),]
gene.positions[which(gene.positions[,3]=="X"),3]=23
gene.positions[which(gene.positions[,3]=="Y"),3]=24
gene.positions[which(gene.positions[,3]=="MT"),3]=0
gene.positions[which(nchar(gene.positions[,3])>2),3]=0
gene.positions=gene.positions[order(as.numeric(gene.positions[,3]),decreasing=F),]
return(gene.positions)
}
gene.pos=getGenePositions(genes)
Thanks!
It would be great to see the complete error message that get printed. This might give more of a clue as to where it's coming from. Please also include the output from
sessionInfo()
so we can see what versions of R and biomaRt you are using.