Accessing Cyanobase With The Biomart / Getbm Method
1
1
Entering edit mode
14.7 years ago
John ▴ 790

I'm trying to access Cyanobase through BiomaRt, but failing:

library(biomaRt)
cyanobase <- useMart("cyanobase_1",dataset="Synechocystis")
Checking attributes ... ok
Checking filters ... ok

attributes <- listAttributes(cyanobase)  # this shows me there is an attribute called "CDS" for example.

getBM(attribute=("CDS"), mart = cyanobase)
Error in getBM(attribute = ("CDS"), mart = cyanobase) : 
  Invalid attribute(s): CDS 
Please use the function 'listAttributes' to get valid attribute names

I have checked the attributes list and CDS is there but I don't know why the getBM function fails to find it. I tried changing the dataset to another cyanobacteria and it still fails, I've also tried other attributes, but no luck. I also tried the human example using ensemble in the biomaRt manual and this works fine. When I change to cyanobase, it fails with this error. Any ideas? Thanks.

biomart r • 4.2k views
ADD COMMENT
1
Entering edit mode

Your code is not reproducible for us because you are missing the difinition of how you get to cyanobase. Please provide a reproducible example.

ADD REPLY
1
Entering edit mode

Thanks, I added the cyanobase line so it can be run. Actually, the problem was simpler than the vector answer you gave below. the description was "CDS" but the name was "coding". R printed out the attributes as a single column due to my screen width, which made it looks like all of the list were the names, but half were descriptions too. It now works with or without the c("... but thanks all the same.

ADD REPLY
0
Entering edit mode

Yep, works and returns a bunch of sequences. And I should have seen that cyanobase was in listMarts(), I tried but overlooked that, sorry.

listMarts() .... 30 cyanobase_1 CYANOBASE 1 (KAZUSA JAPAN)

ADD REPLY
1
Entering edit mode
14.7 years ago
Michael 55k

Hi John,

you are asking a very "special interest" question without providing even a reproducible code example, I really wonder how someone can assume to get an answer. Where do you find the cyanobase mart? (http://genome.kazusa.or.jp/cyanobase/ ). I found the site by google but didn't find a link to the mart service, I cannot even see, if such exists.

Such questions would be better posed to the bioconductor mailing list or the operators of this mart site, including a reproducible example. But in this case it is maybe just a simple R-syntax error so I can help you anyway:

The attributes arg requires a character vector, ("CDS") is not a character vector, so you just forgot a c("CDS"). Try to replace:

getBM(attribute=("CDS"), mart = cyanobase)

by

getBM(attribute=c("CDS"), mart = cyanobase)
ADD COMMENT
1
Entering edit mode

See comments above, it should be 'coding' rather than 'CDS', both above now work.

ADD REPLY
0
Entering edit mode

I don't think there should be any difference between these two inputs:-

a <- ("CDS");

and

a <- c("CDs");

they are equivalent in R, both of class character i.e:-

a == a2 # is TRUE

(not that you should 'really' check string equivalence in this way)

ADD REPLY

Login before adding your answer.

Traffic: 2776 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