trying to retrieve data on go term from ensembl through biomaRt
1
0
Entering edit mode
9.6 years ago

Trying to retrieve data on genes pertaining to the GO term mentioned.... it won't work...

ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl")
go=c("GO:0006306")
getBM(attributes="hgnc_symbol", "hgnc_id"
       filters=c("go", "chromosome_name"),
       values=list(go, chrom), mart=ensembl)

Returns:

getBM(attributes="hgnc_symbol", "hgnc_id"
+        filters=c("go", "chromosome_name"),
Error: unexpected symbol in:
"getBM(attributes="hgnc_symbol", "hgnc_id"
       filters"
>        values=list(go, chrom), mart=ensembl)
Error: unexpected ',' in "       values=list(go, chrom),"
> getBM(attributes="hgnc_symbol", "hgnc_id"
+        filters=c("go", "chromosome_name"),
Error: unexpected symbol in:
"getBM(attributes="hgnc_symbol", "hgnc_id"
       filters"
>        values=list(go, chrom))

any tips?

Thanks

R • 2.6k views
ADD COMMENT
2
Entering edit mode
9.6 years ago

You forgot an enclosure.

getBM(attributes="hgnc_symbol", "hgnc_id"

should be

getBM(attributes=c("hgnc_symbol", "hgnc_id"),
ADD COMMENT
0
Entering edit mode

Also,

filters=c("go", "chromosome_name"),

should be:

filters=c("go_id", "chromosome_name"),
ADD REPLY
0
Entering edit mode

Hey Devon Ryan,

So my new code is:

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

and it returns:

getBM(attributes="hgnc_symbol", "hgnc_id")
Error in martCheck(mart) : 
  You must provide a valid Mart object. To create a Mart object use the function: useMart.  Check ?useMart for more information.
>        filters=c("go", "chromosome_name"),
Error: unexpected ',' in "       filters=c("go", "chromosome_name"),"
>        values=list(go, chrom),
Error: unexpected ',' in "       values=list(go, chrom),"
>        mart=ensembl)
Error: unexpected ')' in "       mart=ensembl)"
ADD REPLY
0
Entering edit mode

You forgot a comma on the first line :)

ADD REPLY

Login before adding your answer.

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