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

def Bio::SCOP::Scop::getDomainFromSQL (   self,
  sunid = None,
  sid = None 

Load a node from the SQL backend using sunid or sid

Definition at line 325 of file __init__.py.

00325                                                     :
        """Load a node from the SQL backend using sunid or sid"""
        if sunid==sid==None: return None

        cur = self.db_handle.cursor()
        if sid:
            cur.execute("SELECT sunid FROM cla WHERE sid=%s", sid)
            res = cur.fetchone()
            if res is None:
                return None
            sunid = res[0]

        cur.execute("SELECT * FROM des WHERE sunid=%s", sunid)
        data = cur.fetchone()

        if data is not None:
            n = None
            #determine if Node or Domain
            if data[1] != "px":
                n = Node(scop=self)

                cur.execute("SELECT child FROM hie WHERE parent=%s", sunid)
                children = []
                for c in cur.fetchall():
                n.children = children
                n = Domain(scop=self)
                cur.execute("select sid, residues, pdbid from cla where sunid=%s",
                [n.sid,n.residues,pdbid] = cur.fetchone()
                n.residues = Residues(n.residues)
                self._sidDict[n.sid] = n
            [n.sunid,n.type,n.sccs,n.description] = data

            if data[1] != 'ro':
                cur.execute("SELECT parent FROM hie WHERE child=%s", sunid)
                n.parent = cur.fetchone()[0]

            n.sunid = int(n.sunid)

            self._sunidDict[n.sunid] = n

    def getAscendentFromSQL(self, node, type):

Generated by  Doxygen 1.6.0   Back to index