Please use the function 'listAttributes' to get valid attribute names
Entering edit mode
al14 • 0
Last seen 5.1 years ago

I am new in this. I use biomart see the code below:

`mart = useMart("ensembl")
mart = useDataset("hsapiens_gene_ensembl", mart)
db = getBM(attributes = c("uniprot_swissprot", "uniprot_genename", "illumina_humanht_12_v4"), 
           filters = "uniprot_swissprot", values = prot, mart = mart)`


I . get this error


`Error in getBM(attributes = c("UniProtKB/Swiss-Prot", "UniProtKB Gene Name",  : 
  Invalid attribute(s): UniProtKB/Swiss-Prot, UniProtKB Gene Name 
Please use the function 'listAttributes' to get valid attribute names`


r biomart • 2.4k views
Entering edit mode
Mike Smith ★ 5.7k
Last seen 13 hours ago
EMBL Heidelberg / de.NBI

The error message tries to give you some hints as to what to do next:

  Invalid attribute(s): uniprot_swissprot, uniprot_genename 
Please use the function 'listAttributes' to get valid attribute names

The first line above tells you that both uniprot_swissprot and uniprot_genename are invalid attributes i.e. there is no column in the Ensembl database with that name, so you need to find the correct name. The second line above suggests using the function listAttributes to give you a set of all the possible attributes that can be retrieved from the dataset you're accessing. e.g.


Did you get those original names from a document somewhere?  Sometimes Ensembl changes the column names and examples go out of date, so if you found that in the biomaRt documentation let me know and I'll update it.

For your case I think the two attributes you actually want are uniprotswissprot and uniprot_gn e.g.


mart = useMart("ensembl")
mart = useDataset("hsapiens_gene_ensembl", mart)

prot <- c("P03891", "P03885")

db = getBM(attributes = c("uniprotswissprot", "uniprot_gn", "illumina_humanht_12_v4"), 
           filters = "uniprotswissprot", 
           values = prot, 
           mart = mart)
> db
  uniprotswissprot uniprot_gn illumina_humanht_12_v4
1           P03891     P03891                     NA
2           P03891     Q7GXY9                     NA
Entering edit mode

The names in my original script worked with biomart but probably Ensembl changed them. How can I know when and how names change in Ensembl?

Script now works thank you


Entering edit mode

Not easily is the short answer.  Ensembl usually list them in their release notes e.g. and Thomas Maurel generally mentions them in his Ensembl release posts here (Ensembl 88 is out!), but normally I find out when an existing script stops working with the error your posted.


Login before adding your answer.

Traffic: 437 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6