from bioservices import *
s = BioMart()
datasets = s.databases("ensembl")
I can create a Biomart object with BioMart(), but whenever I try to call a function I get the following error message (in this case databases()):
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-9687ac9ee893> in <module>()
1 s = BioMart()
----> 2 datasets = s.databases("ensembl")
/home/nic/anaconda3/envs/py27/lib/python2.7/site-packages/bioservices/biomart.pyc in _get_databases(self)
394 def _get_databases(self):
395 if self._databases is None:
--> 396 ret = self.registry()
397 names = sorted([x.get("database", "?") for x in ret])
398 self._databases = names[:]
/home/nic/anaconda3/envs/py27/lib/python2.7/site-packages/bioservices/biomart.pyc in registry(self)
214 """
215 ret = self.http_get("?type=registry", frmt="xml")
--> 216 ret = self.easyXML(ret)
217 # the XML contains list of children called MartURLLocation made
218 # of attributes. We parse the xml to return a list of dictionary.
/home/nic/anaconda3/envs/py27/lib/python2.7/site-packages/bioservices/services.pyc in easyXML(self, res)
183 """
184 from bioservices import xmltools
--> 185 return xmltools.easyXML(res)
186
187
/home/nic/anaconda3/envs/py27/lib/python2.7/site-packages/bioservices/xmltools.pyc in __init__(self, data, encoding)
77 # self.data = x.fixed_string.encode("utf-8")
78 #else:
---> 79 self.data = data[:]
80
81 try:
TypeError: 'int' object has no attribute '__getitem__'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-9687ac9ee893> in <module>()
1 s = BioMart()
----> 2 datasets = s.databases("ensembl")
/home/nic/anaconda3/lib/python3.5/site-packages/bioservices/biomart.py in _get_databases(self)
394 def _get_databases(self):
395 if self._databases is None:
--> 396 ret = self.registry()
397 names = sorted([x.get("database", "?") for x in ret])
398 self._databases = names[:]
/home/nic/anaconda3/lib/python3.5/site-packages/bioservices/biomart.py in registry(self)
214 """
215 ret = self.http_get("?type=registry", frmt="xml")
--> 216 ret = self.easyXML(ret)
217 # the XML contains list of children called MartURLLocation made
218 # of attributes. We parse the xml to return a list of dictionary.
/home/nic/anaconda3/lib/python3.5/site-packages/bioservices/services.py in easyXML(self, res)
183 """
184 from bioservices import xmltools
--> 185 return xmltools.easyXML(res)
186
187
/home/nic/anaconda3/lib/python3.5/site-packages/bioservices/xmltools.py in __init__(self, data, encoding)
77 # self.data = x.fixed_string.encode("utf-8")
78 #else:
---> 79 self.data = data[:]
80
81 try:
TypeError: 'int' object is not subscriptable