I am trying to get the snp associated to the phenotype Crohn's disease using biomaRt:
getBM(attributes = c('refsnp_id','allele','chrom_start','chrom_strand'),
filters = "phenotype_description",
values = "Crohn's disease',
mart = ensembl)
But I have this error:
Error in getBM(attributes = c("refsnp_id", "allele", "chrom_start", "chrom_strand"), :
Query ERROR: caught BioMart::Exception: non-BioMart die():
not well-formed (invalid token) at line 1, column 394, byte 394 at /nfs/services/ensweb-software/sharedsw/2018_08_22/linuxbrew/Cellar/perl/5.26.2_2/lib/perl5/site_perl/5.26.2/x86_64-linux-thread-multi/XML/Parser.pm line 187.
XML::Simple called at /nfs/public/release/ensweb/latest/live/mart/www_94/biomart-perl/lib/BioMart/Query.pm line 1935.
I thing it is a problem with the apostrophe because when I use "Crohn disease" it works. Any idea about how to fix it?

biomaRt version 2.39.2 now contain the functions
listFilterValuesandsearchFilterValues. You can use these to try and determine the appropriate values to supply to a filter likephenotype_description. Here's an example of how they work: