Example #1
0
 def get_pdbml_object(self, pdb_id, acceptable_sequence_percentage_match = 90.0):
     self.log_lookup('PDBML object {0}'.format(pdb_id))
     pdb_id = pdb_id.upper()
     if not self.pdbml_objects.get(pdb_id):
         if not self.pdbml_contents.get(pdb_id):
             if self.cache_dir:
                 self.add_pdbml_contents(pdb_id, download_pdbml(pdb_id, self.cache_dir, silent = True))
             else:
                 self.add_pdbml_contents(pdb_id, retrieve_pdbml(pdb_id, silent = True))
         self.add_pdbml_object(pdb_id, PDBML.retrieve(pdb_id, cache_dir = self.cache_dir, bio_cache = self))
     return self.pdbml_objects[pdb_id]
Example #2
0
 def get_pdbml_contents(self, pdb_id):
     self.log_lookup('PDBML {0}'.format(pdb_id))
     pdb_id = pdb_id.upper()
     if not self.pdbml_contents.get(pdb_id):
         if self.pdbml_objects.get(pdb_id):
             self.add_pdbml_contents(pdb_id, self.pdbml_objects[pdb_id].xml_contents)
         elif self.cache_dir:
             self.add_pdbml_contents(pdb_id, download_pdbml(pdb_id, self.cache_dir, silent = True))
         else:
             self.add_pdbml_contents(pdb_id, retrieve_pdbml(pdb_id, silent = True))
     return self.pdbml_contents[pdb_id]