5
$\begingroup$

I am experiencing an error while using getSequence() in biomaRt.

The code is given below:

library("biomaRt")
ensemblp <- useMart(biomart="plants_mart",host="plants.ensembl.org")
osj = useDataset("osativa_eg_gene", mart = ensemblp)
genes <- read.csv("osj.csv")
osj_id <- genes$ensembl_transcript_id

os_genes <- getSequence(id = osj_id, type = "ensembl_transcript_id", seqType = "peptide", mart = ensemblp)

The error message I am getting is :

Error in martCheck(mart, c("ensembl", "ENSEMBL_MART_ENSEMBL")) :   
This function only works when used with the ensembl BioMart.This
function only works when used with the ENSEMBL_MART_ENSEMBL BioMart.

Did I make any mistake in code? Please help me fix the error. I tried asking this in Bioconductor support, but no one responded yet.

$\endgroup$
  • $\begingroup$ It doesn't seem to be a mistake in the code, but simply what you try to do isn't working in that BioMart $\endgroup$ – llrs Nov 7 '17 at 7:58
  • $\begingroup$ Did you find and review this post on bioconductor? Does it help you? support.bioconductor.org/p/74761 $\endgroup$ – Bioathlete Nov 7 '17 at 20:05
9
$\begingroup$

getSequence has only been enabled for the main Ensembl (vertebrates) biomaRt. This is all at the Bioconductor end. You'll need to use a getBM instead, for example:

os_genes <- getBM(attributes =c("ensembl_transcript_id", "peptide"), filters = "ensembl_transcript_id", values = osj_id, mart = osj)
$\endgroup$
1
$\begingroup$

Biomart seems to be down most of the time so i think you can parse the ensemble ID and names from the annotation file which i did as i was having similar problem .

You can use this to make a file with ensemble ID and gene names for you use

awk '{                                
    for (i = 1; i <= NF; i++) {
        if ($i ~ /gene_id|gene_name/) {
            printf "%s ", $(i+1)
        }
    }
    print ""
}' Homo_sapiens.GRCh37.70.gtf | sed -e 's/"//g' -e 's/;//g' -e 's/ /\t/' | sort -k1,1 | uniq > Homo_sapiens.GRCh37.70.txt
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.