Protool/ligand.py
def parse_mol2lines(self,lines):
        """This parses a single ligand and inserts it as a new chain in Protool"""
        #
        # Find the chain ID
        #
        fail=True
        for cid in ['L','I','J','K','L','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
            if not self.PI.chains.has_key(cid):
                chainid=cid
                fail=False
                break
        if fail:
            print 'I ran out of alternative chain ID names'
            raise Exception()
        #
        # We got the chain ID
        # Residue number is 1
        #
        shortened_message={}
        resnumber='0001'
        for atomline in lines:
            sline=atomline.split()
            if sline==[]:
                continue
            atomnumber=0
            atomname=sline[1]
            x=float(sline[2])
            y=float(sline[3])
            z=float(sline[4])
            resname=sline[7]
            if len(resname)>3:
                if not shortened_message.has_key(resname):
                    print 'Shortened residue name from "%s" to "%s"' %(resname,resname[:3])
                    shortened_message[resname]=1
                resname=resname[:3]

            sybyltype=sline[5]
            charge=float(sline[-1])
            uniqueid='%s:%s:%s' %(cid,resnumber,atomname)
            self.PI.add_atom(uniqueid,
                             atomnumber=atomnumber,atomname=atomname,
                             chainid=chainid,residuename=resname,residuenumber=resnumber,
                             xcoord=x,ycoord=y,zcoord=z,update=None,
                             BFACTOR=0.0,OCCUPANCY=1.0,CHARGE=charge,RADIUS=None,tag=self.tag,accept_duplicate=True)
        self.PI.Update()
        return
This parses a single ligand and inserts it as a new chain in Protool
This parses a single ligand and inserts it as a new chain in Protool
This parses a single ligand and inserts it as a new chain in Protool
def parse_mol2lines(self,lines):
         Find the chain ID
        fail=True
        for cid in ['L','I','J','K','L','M','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
            if not self.PI.chains.has_key(cid):
                chainid=cid
                fail=False
                break
        if fail:
            print 'I ran out of alternative chain ID names'
            raise Exception()
         We got the chain ID
         Residue number is 1
        shortened_message={}
        resnumber='0001'
        for atomline in lines:
            sline=atomline.split()
            if sline==[]:
                continue
            atomnumber=0
            atomname=sline[1]
            x=float(sline[2])
            y=float(sline[3])
            z=float(sline[4])
            resname=sline[7]
            if len(resname)>3:
                if not shortened_message.has_key(resname):
                    print 'Shortened residue name from "%s" to "%s"' %(resname,resname[:3])
                    shortened_message[resname]=1
                resname=resname[:3]
            sybyltype=sline[5]
            charge=float(sline[-1])
            uniqueid='%s:%s:%s' %(cid,resnumber,atomname)
            self.PI.add_atom(uniqueid,
                             atomnumber=atomnumber,atomname=atomname,
                             chainid=chainid,residuename=resname,residuenumber=resnumber,
                             xcoord=x,ycoord=y,zcoord=z,update=None,
                             BFACTOR=0.0,OCCUPANCY=1.0,CHARGE=charge,RADIUS=None,tag=self.tag,accept_duplicate=True)
        self.PI.Update()
        return
def parse_mol2lines ( self , lines ) : fail = True for cid in [ 'L' , 'I' , 'J' , 'K' , 'L' , 'M' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' ] : if not self . PI . chains . has_key ( cid ) : chainid = cid fail = False break if fail : print 'I ran out of alternative chain ID names' raise Exception ( ) shortened_message = { } resnumber = '0001' for atomline in lines : sline = atomline . split ( ) if sline == [ ] : continue atomnumber = 0 atomname = sline [ 1 ] x = float ( sline [ 2 ] ) y = float ( sline [ 3 ] ) z = float ( sline [ 4 ] ) resname = sline [ 7 ] if len ( resname ) > 3 : if not shortened_message . has_key ( resname ) : print 'Shortened residue name from "%s" to "%s"' % ( resname , resname [ : 3 ] ) shortened_message [ resname ] = 1 resname = resname [ : 3 ] sybyltype = sline [ 5 ] charge = float ( sline [ - 1 ] ) uniqueid = '%s:%s:%s' % ( cid , resnumber , atomname ) self . PI . add_atom ( uniqueid , atomnumber = atomnumber , atomname = atomname , chainid = chainid , residuename = resname , residuenumber = resnumber , xcoord = x , ycoord = y , zcoord = z , update = None , BFACTOR = 0.0 , OCCUPANCY = 1.0 , CHARGE = charge , RADIUS = None , tag = self . tag , accept_duplicate = True ) self . PI . Update ( ) return
This parses a single ligand and inserts it as a new chain in Protool
This parses a single ligand and inserts it as a new chain in Protool
"""This parses a single ligand and inserts it as a new chain in Protool""" # # Find the chain ID # # # We got the chain ID # Residue number is 1 #
self
lines