Question: biomaRt code giving me trouble
0
gravatar for chrisclarkson100
5.1 years ago by
European Union
chrisclarkson10080 wrote:

Trying to get task number 4.3 from biomaRt vignette to work for me. I have established ensembl as the database but from there nothing works for me.... hoping you could spot any mistakes in my code: 

go=c("GO:0051330", "GO:0000080", chrom=c(1,2,"Y"))

getBM(attributes = "hgnc_symbol",
+ filters=c("go","chromosome_name"),
+ values=list(go,chrom), mart=ensembl)

Error in getBM(attributes = "hgnc_symbol", filters = c("go", "chromosome_name"),  : 
  object 'chrom' not found

getBM(attributes="hgnc_symbol"
+ filters=c("go","chromosome_name")

Error: unexpected symbol in:
"getBM(attributes="hgnc_symbol"
filters"

values=list(go,chrom), mart=ensembl)

Error: unexpected ',' in "values=list(go,chrom),"
R • 1.5k views
ADD COMMENTlink modified 5.1 years ago by Neilfws48k • written 5.1 years ago by chrisclarkson10080

the command head(gene$hgnc) returns NULL.....? what do i have to do to give it a value?

ADD REPLYlink written 5.1 years ago by chrisclarkson10080

How did you create it in the first place (or did you)?

ADD REPLYlink written 5.1 years ago by Devon Ryan92k

For what it's worth, section 4.3 of that vignette doesn't seem to work because the example GO IDs in it no longer match to the genes. Presumably this is due to ensembl now using GRCh38 when the vignette was made for hg19 (this is just a guess). If you change the GO ids to GO:0000086 and GO:0051322 and change the "go" filter to "go_id" then you'll get at least partly similar results. If I get a chance, I'll look at the devel branch vignette and see if it's broken too.

ADD REPLYlink written 5.1 years ago by Devon Ryan92k

I've now alerted the package maintainer. The first error that you ran into has already been corrected for the next release of the package, but the GO ids and the filter are still wrong. Hopefully Steffen will have a chance to update things before the next release goes live, which shouldn't be long.

ADD REPLYlink written 5.1 years ago by Devon Ryan92k
1
gravatar for Devon Ryan
5.1 years ago by
Devon Ryan92k
Freiburg, Germany
Devon Ryan92k wrote:

It looks like you just merged two lines. Instead of this:

go=c("GO:0051330", "GO:0000080", chrom=c(1,2,"Y"))

Try this:

go=c("GO:0051330", "GO:0000080")
chrom=c("1","2","Y")
ADD COMMENTlink written 5.1 years ago by Devon Ryan92k

perfect thanks. how do i get the getBM command to work?

ADD REPLYlink written 5.1 years ago by chrisclarkson10080
1

By reading help(getBM) and showing us what gene$hgnc contains in the other thread you just started.

ADD REPLYlink written 5.1 years ago by Devon Ryan92k
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: 2029 users visited in the last hour