getSequence() biomaRt R function using plant ensembl mart
1
1
Entering edit mode
6.0 years ago
gaby_santos ▴ 10

Hi! I want to retrieve the cdna sequences of Glycine max using the getSequence function but when I try I get this error:

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.

My code is this:

library(biomaRt)

#I define the soybean dataset using the plants_mart
ensembl_soybean = useMart(host="plants.ensembl.org", "plants_mart", 
                          dataset = "gmax_eg_gene")

#As I want all the genes I filter according to the chromosome name, which I obtain it using this instruction
chrom = keys(ensembl_soybean, keytype = "chromosome_name") 

#I get soybean gene and transcripts info
Soybean_Seq_Info = getBM(attributes = c("ensembl_gene_id","ensembl_transcript_id",
                                        "external_gene_name"), filters = "chromosome_name",
                         values = chrom, mart = ensembl_soybean)


#I define an object of GenesIDs from the retrieved data

GenesID = unique(Soybean_Seq_Info$ensembl_gene_id)

#With the ensembl genes IDs I retrieve I want to get the cdna sequences, for a test I only use the first 10 genes
Soybean_Genes = getSequence(id = GenesID[1:10],
                            type="ensembl",
                            seqType = "cdna",
                            mart=ensembl_soybean)

But then I get the error I showed at the beginning, how can I obtain the cdna sequences according to their ensembl gene ID?

R • 3.4k views
ADD COMMENT
0
Entering edit mode

For future reference: Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
Formatting bar

ADD REPLY
0
Entering edit mode

Mmmm... I am afraid this means that you cannot use getSequence in a mart that is not ENSEMBL_MART_ENSEMBL, i.e. the first output of the command

listMarts()

You might find some workaround for this, but I wouldn't know how to do.

Maybe you will have to move to some other tools such as bedtools getfasta or gffread.

Other solutions can be found here, but none of them is through biomaRt, sorry.

ADD REPLY
2
Entering edit mode
4.5 years ago
yichangyuycy ▴ 20

Hi I found you just need to add one command as below before you run getsequence:

ensembl_soybean@biomart <- 'ENSEMBL_MART_ENSEMBL'

ADD COMMENT

Login before adding your answer.

Traffic: 3022 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.6