Entering edit mode
6.7 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?
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.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
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.