Fraction of Native Contacts

An error occurred while executing the following cell: ------------------ # pull a random protein from the PDB # (The unitcell info happens to be wrong) traj = md.load_pdb('http://www.rcsb.org/pdb/files/2MI7.pdb') # just for example, use the first frame as the 'native' conformation q = best_hummer_q(traj, traj[0]) ------------------ --------------------------------------------------------------------------- ConnectionRefusedError Traceback (most recent call last) /usr/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)  1349 try: -> 1350 h.request(req.get_method(), req.selector, req.data, headers,  1351 encode_chunked=req.has_header('Transfer-encoding')) /usr/lib/python3.8/http/client.py in request(self, method, url, body, headers, encode_chunked)  1254 """Send a complete request to the server.""" -> 1255 self._send_request(method, url, body, headers, encode_chunked)  1256  /usr/lib/python3.8/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)  1300 body = _encode(body, 'body') -> 1301 self.endheaders(body, encode_chunked=encode_chunked)  1302  /usr/lib/python3.8/http/client.py in endheaders(self, message_body, encode_chunked)  1249 raise CannotSendHeader() -> 1250 self._send_output(message_body, encode_chunked=encode_chunked)  1251  /usr/lib/python3.8/http/client.py in _send_output(self, message_body, encode_chunked)  1009 del self._buffer[:] -> 1010 self.send(msg)  1011  /usr/lib/python3.8/http/client.py in send(self, data)  949 if self.auto_open: --> 950 self.connect()  951 else: /usr/lib/python3.8/http/client.py in connect(self)  920 """Connect to the host and port specified in __init__.""" --> 921 self.sock = self._create_connection(  922 (self.host,self.port), self.timeout, self.source_address) /usr/lib/python3.8/socket.py in create_connection(address, timeout, source_address)  807 try: --> 808 raise err  809 finally: /usr/lib/python3.8/socket.py in create_connection(address, timeout, source_address)  795 sock.bind(source_address) --> 796 sock.connect(sa)  797 # Break explicitly a reference cycle ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: URLError Traceback (most recent call last)  in   1 # pull a random protein from the PDB  2 # (The unitcell info happens to be wrong) ----> 3 traj = md.load_pdb('http://www.rcsb.org/pdb/files/2MI7.pdb')  4   5 # just for example, use the first frame as the 'native' conformation ~/projects/debichem/build/mdtraj/.pybuild/cpython3_3.8_mdtraj/build/mdtraj/formats/pdb/pdbfile.py in load_pdb(filename, stride, atom_indices, frame, no_boxchk, standard_names)  151   152 filename = str(filename) --> 153 with PDBTrajectoryFile(filename, standard_names=standard_names) as f:  154 atom_slice = slice(None) if atom_indices is None else atom_indices  155 if frame is not None: ~/projects/debichem/build/mdtraj/.pybuild/cpython3_3.8_mdtraj/build/mdtraj/formats/pdb/pdbfile.py in __init__(self, filename, mode, force_overwrite, standard_names)  255   256 if _is_url(filename): --> 257 self._file = urlopen(filename)  258 if filename.lower().endswith('.gz'):  259 if six.PY3: /usr/lib/python3.8/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)  220 else:  221 opener = _opener --> 222 return opener.open(url, data, timeout)  223   224 def install_opener(opener): /usr/lib/python3.8/urllib/request.py in open(self, fullurl, data, timeout)  523   524 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method()) --> 525 response = self._open(req, data)  526   527 # post-process response /usr/lib/python3.8/urllib/request.py in _open(self, req, data)  540   541 protocol = req.type --> 542 result = self._call_chain(self.handle_open, protocol, protocol +  543 '_open', req)  544 if result: /usr/lib/python3.8/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)  500 for handler in handlers:  501 func = getattr(handler, meth_name) --> 502 result = func(*args)  503 if result is not None:  504 return result /usr/lib/python3.8/urllib/request.py in http_open(self, req)  1377   1378 def http_open(self, req): -> 1379 return self.do_open(http.client.HTTPConnection, req)  1380   1381 http_request = AbstractHTTPHandler.do_request_ /usr/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)  1351 encode_chunked=req.has_header('Transfer-encoding'))  1352 except OSError as err: # timeout error -> 1353 raise URLError(err)  1354 r = h.getresponse()  1355 except: URLError: URLError:

(native-contact.ipynb; native-contact_eval.ipynb; native-contact.py)