Forums

BioPython

Is there any way to get BioPython installed? It requires gcc, so easy_install and "python setup.py build" choke at that point.

Thanks, Andreas

Hi Andreas,

We are about to release it. Not sure if we have all the pieces so would love it if you gave it a try when we do.

Cheers

Hi, I just have tried Biopython and I wonder if you need to whitelist some of the places it accesses such as: http://eutils.ncbi.nlm.nih.gov and http://www.rcsb.org/pdb/files/
?

See below my attempts following instructions at http://biopython.org/DIST/docs/cookbook/biopdb_faq.pdf They get denied.

Thanks, Wayne

My attempts:

>>> from Bio.PDB import*                                                                                                                                
>>> pdbl=PDBList()                                                                                                                                      
>>> pdbl.retrieve_pdb_file('1D66')                                                                                                                      
Downloading PDB structure '1D66'...                                                                                                                     
Traceback (most recent call last):                                                                                                                      
  File "<stdin>", line 1, in <module>                                                                                                                   
      File "/usr/local/lib/python2.7/site-packages/biopython-1.60-py2.7-linux-x86_64.egg/Bio/PDB/PDBList.py", line 241, in         retrieve_pdb_file                
    lines = _urlopen(url).read()

File "/usr/local/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/local/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 1387, in ftp_open
fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 1409, in connect_ftp
persistent=False)
File "/usr/local/lib/python2.7/urllib.py", line 864, in init
self.init()
File "/usr/local/lib/python2.7/urllib.py", line 870, in init
self.ftp.connect(self.host, self.port, self.timeout)
File "/usr/local/lib/python2.7/ftplib.py", line 132, in connect
self.sock = socket.create_connection((self.host, self.port), self.timeout)
File "/usr/local/lib/python2.7/socket.py", line 571, in create_connection
raise err
urllib2.URLError: <urlopen error ftp error: [Errno 111] Connection refused>

I have opened up rcsb.org and nih.gov. You can download the PDB you wanted by changing the PDBList line to:

pdbl=PDBList(server='http://www.rcsb.org/pdb/files')

Thanks!
Plus I just found it also now works using Biopython's interface to access NCBI's Entrez databses as described at http://www.bio-cloud.info/Biopython/en/ch8.html .

Hi Glenn, I was working through more of the examples at http://www.bio-cloud.info/Biopython/en/ch8.html and was finding the parser for Biopython isn't working as the examples show? Could this be related to the package installation or another network issue?

Specifically, I follow section 8.2 at http://www.bio-cloud.info/Biopython/en/ch8.html:

from Bio import Entrez
handle = Entrez.einfo()
record = Entrez.read(handle)

And then I get an error in the parser saying it isn't XML but if I enter:

result = handle.read()
print result

I see clearly it is XML beginning with "<?xml version="1.0"?> "

Thanks, Wayne

That's weird. I can run the 3 lines fine on a free account. I get a record that looks OK. Could you post the full stack-trace, please?

Yes, in a new console it works. So far everything has worked. Thus I'll stop doubting the installation. I think I must have defined something previously and could not clear it even though I started the series of commands again. I should have known to test it in a new console first before bothering you.

Thanks, Wayne

Hi All, I'm trying to make a tree and identify some 16s rRNA sequencing with genbank using biopython, but I have no Idea how can I start. Could you please help me?

Hi Eleiloon,

If you've already got basic Python scripts running in your PythonAnywhere account, then next you may want to look into the BioPython Tutorial and Cookbook. Section 7.2.3. seems particularly pertinent. Were you able to work through some of the documentation exercises? Also this link might help.

Hopefully one of those links helps.