Question: Accessing Cyanobase With The Biomart / Getbm Method
1
gravatar for John
9.4 years ago by
John770
John770 wrote:

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 • 2.5k views
ADD COMMENTlink modified 11 months ago by RamRS23k • written 9.4 years ago by John770
1

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 REPLYlink written 9.4 years ago by Michael Dondrup46k
1

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 REPLYlink written 9.4 years ago by John770

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 REPLYlink written 9.4 years ago by Michael Dondrup46k
1
gravatar for Michael Dondrup
9.4 years ago by
Bergen, Norway
Michael Dondrup46k wrote:

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 COMMENTlink modified 11 months ago by RamRS23k • written 9.4 years ago by Michael Dondrup46k
1

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

ADD REPLYlink written 9.4 years ago by John770

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 REPLYlink modified 11 months ago by RamRS23k • written 9.4 years ago by Ian Simpson930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1623 users visited in the last hour