Error running ensembl via Biomart disk I/O error
0
Entering edit mode
@saadmurtazakhan-6782
Last seen 6 days ago
United States

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!

biomaRt conicsmat • 65 views
ADD COMMENTlink
0
Entering edit mode

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.

ADD REPLYlink
1
Entering edit mode
@u16406
Last seen 1 hour ago
Republic of Ireland

It may genuinely be a disk I/O error, i.e., you have no more disk space, or your quota has been exceeded, or your TMPDIR is full. Can you inform us about the system on which you are running R?

You see, biomaRt caches results. If you try getBM(..., useCache = FALSE), does that work?

Kevin

ADD COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Traffic: 222 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.4