예제 #1
0
 def extractDomains(self, model=0, onlyBackbone=False, verbose=False):
     """1.-query the database to know every pair(pdbID, domainID)
        2.-for each domain of the family contained in the pdb, load its segments.
        3.-for each domain serialize it with the name domain.pdb
     """
     (db, cursor)      = queryCDDF.setUpDB(self.__host, self.__user, self.__passwd, self.__db)
     self.PDB_Domains  = queryCDDF.loadCATHfamilyDomains(self.cathcode, cursor)
     for (pdbID, domain) in self.PDB_Domains:
         validDomain =  True
         segments    = queryCDDF.loadSegments(domain, cursor)
         for segment in segments:
             if segment[1] != -1:
                 self.validSegments.append((pdbID, domain, segment))
             else:
                 self.notValidSegments.append((pdbID, domain, segment))
                 validDomain = False
                 
         if validDomain:
             try:
                 pdb = PDB(self.__composeLocalFileName(self.workingDirectory, pdbID, ".pdb"))
                 pdb.load_atoms_hetams()
             except IOError:
                 print "%s does not exist" %(self.__composeLocalFileName(self.workingDirectory, pdbID, ".pdb"),)
             else:
                 pdb.serializeSegments(segments, self.__composeLocalFileName(self.workingDirectory, domain, ".pdb"), model, onlyBackbone)
                 if verbose:
                     print ("%s domain extracted" % (domain,))
                 
     queryCDDF.tearDownDB(db, cursor)
예제 #2
0
 def getFamilyPDBS(self):
     """ downloads every pdb that contains a domain of the cath family  
     (a pdb can contain more than one domain of the same family)"""        
     (db, cursor) = queryCDDF.setUpDB(self.__host, self.__user, self.__passwd, self.__db)
     self.pdbIDs  = queryCDDF.loadCATHfamily(self.cathcode, cursor)
     queryCDDF.tearDownDB(db, cursor)