Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::PDB::PDBList::PDBList::retrieve_pdb_file (   self,
  pdb_code,
  compression = '.Z',
  uncompress = "gunzip",
  write = 1 
)

Retrieves a PDB structure file from the PDB server and
stores it in a local file tree (if 'write' is set true).
The PDB structure is returned as a single string.
The compression should be '.Z' or '.gz'. 'uncompress' is
the command called to uncompress the files.

Definition at line 156 of file PDBList.py.

00156                                                                                         :
        """Retrieves a PDB structure file from the PDB server and
        stores it in a local file tree (if 'write' is set true).
        The PDB structure is returned as a single string.
        The compression should be '.Z' or '.gz'. 'uncompress' is
        the command called to uncompress the files.
        """
        # get the structure
        code=string.lower(pdb_code)
        url = self.pdb_server+'/pub/pdb/data/structures/divided/pdb/%s/pdb%s.ent%s'%(code[1:3],code,compression)
        lines = urllib.urlopen(url).read()

        # save the structure
        path = self.local_pdb + os.sep + code[1:3]
        filename = path + os.sep+"pdb%s.ent%s"%(code,compression)
        if not os.access(path,os.F_OK):
            os.mkdir(path)
        open(filename,'w').write(lines)

        # uncompress the file
        os.system("%s %s" % (uncompress, filename))

        return lines
            

    def update_pdb(self):


Generated by  Doxygen 1.6.0   Back to index