Protool/PDBparser.py
def parseline(self,line):
        """
        # This function calls other routines to parse the line
        """
        import string
        type=string.strip(string.upper(line[:6]))
        if len(type)==0:
            return
        #
        # There are so many junk headers, so we simplify a bit
        #
        if self.junkheaders.has_key(type):
            type=self.junkheaders[type]
        #
        # Should we ignore this model?
        #
        
        if self.readmodel is False and type!='ENDMDL':
            #print 'Skipping model no: %d' %self.NMRmodel
            return
        #
        # Now call the appropritate function
        #
        if type=='ATOM':
            self.parseatom(line)
        elif type=='HETATM':
            self.parsehet(line)
        elif type=='HEADER':
            self.parseheader(line)
        elif type=='COMPND':
            self.parsecompnd(line)
        elif type=='SOURCE':
            self.parsesource(line)
        elif type=='AUTHOR':
            self.parseauthor(line)
        elif type=='REVDAT':
            self.parserevdat(line)
        elif type=='REMARK':
            self.parseremark(line)
        elif type=='SEQRES':
            self.parseseqres(line)
        elif type=='HELIX':
            self.parsehelix(line)
        elif type=='SHEET':
            self.parsesheet(line)
        elif type=='TURN':
            self.parseturn(line)
        elif type=='MDLTYP':
            pass
        elif type=='SSBOND':
            self.parsessbond(line)
        elif type=='CRYST1' or type=='CRYSTL' or type=='CRYST':
            self.parsecryst(line)
        elif type=='ORIGX1' or type=='ORIGX2' or type=='ORIGX3':
            self.parseorig(line)
        elif type=='SCALE1' or type=='SCALE2' or type=='SCALE3':
            self.parsescale(line)
        elif type=='CONECT':
            self.parseconnect(line)
        elif type=='MASTER':
            self.parsemaster(line)
        elif type=='TER':
            self.parseter(line)
        elif type=='JRNL':
            self.parsejournal(line)
        elif type=='FTNOTE':
            self.parsefootnote(line)
        elif type=='HET':
            self.parsehetheader(line)
        elif type=='FORMUL':
            self.parseformul(line)
        elif type=='MODEL':
            self.parsemodel(line)
        elif type=='ENDMDL':
            self.parseendmodel(line)
        elif type=='END':
            self.parseend(line)
        elif type=='EXPDTA':
            self.parseexpdta(line)
        elif type=='JUNK':
            pass
        elif type=='NUMMDL':
            pass
        else:
            #print 'Ignored header: %s' %type
            #raise ParseLineError, 'Unknown Header type: %s' %type
            pass
        return

        # This function calls other routines to parse the line
        
This function calls other routines to parse the line
This function calls other routines to parse the line
def parseline(self,line):
        import string
        type=string.strip(string.upper(line[:6]))
        if len(type)==0:
            return
         There are so many junk headers, so we simplify a bit
        if self.junkheaders.has_key(type):
            type=self.junkheaders[type]
         Should we ignore this model?
        if self.readmodel is False and type!='ENDMDL':
            print 'Skipping model no: %d' %self.NMRmodel
            return
         Now call the appropritate function
        if type=='ATOM':
            self.parseatom(line)
        elif type=='HETATM':
            self.parsehet(line)
        elif type=='HEADER':
            self.parseheader(line)
        elif type=='COMPND':
            self.parsecompnd(line)
        elif type=='SOURCE':
            self.parsesource(line)
        elif type=='AUTHOR':
            self.parseauthor(line)
        elif type=='REVDAT':
            self.parserevdat(line)
        elif type=='REMARK':
            self.parseremark(line)
        elif type=='SEQRES':
            self.parseseqres(line)
        elif type=='HELIX':
            self.parsehelix(line)
        elif type=='SHEET':
            self.parsesheet(line)
        elif type=='TURN':
            self.parseturn(line)
        elif type=='MDLTYP':
            pass
        elif type=='SSBOND':
            self.parsessbond(line)
        elif type=='CRYST1' or type=='CRYSTL' or type=='CRYST':
            self.parsecryst(line)
        elif type=='ORIGX1' or type=='ORIGX2' or type=='ORIGX3':
            self.parseorig(line)
        elif type=='SCALE1' or type=='SCALE2' or type=='SCALE3':
            self.parsescale(line)
        elif type=='CONECT':
            self.parseconnect(line)
        elif type=='MASTER':
            self.parsemaster(line)
        elif type=='TER':
            self.parseter(line)
        elif type=='JRNL':
            self.parsejournal(line)
        elif type=='FTNOTE':
            self.parsefootnote(line)
        elif type=='HET':
            self.parsehetheader(line)
        elif type=='FORMUL':
            self.parseformul(line)
        elif type=='MODEL':
            self.parsemodel(line)
        elif type=='ENDMDL':
            self.parseendmodel(line)
        elif type=='END':
            self.parseend(line)
        elif type=='EXPDTA':
            self.parseexpdta(line)
        elif type=='JUNK':
            pass
        elif type=='NUMMDL':
            pass
        else:
            print 'Ignored header: %s' %type
            raise ParseLineError, 'Unknown Header type: %s' %type
            pass
        return
def parseline ( self , line ) : import string type = string . strip ( string . upper ( line [ : 6 ] ) ) if len ( type ) == 0 : return if self . junkheaders . has_key ( type ) : type = self . junkheaders [ type ] if self . readmodel is False and type != 'ENDMDL' : return if type == 'ATOM' : self . parseatom ( line ) elif type == 'HETATM' : self . parsehet ( line ) elif type == 'HEADER' : self . parseheader ( line ) elif type == 'COMPND' : self . parsecompnd ( line ) elif type == 'SOURCE' : self . parsesource ( line ) elif type == 'AUTHOR' : self . parseauthor ( line ) elif type == 'REVDAT' : self . parserevdat ( line ) elif type == 'REMARK' : self . parseremark ( line ) elif type == 'SEQRES' : self . parseseqres ( line ) elif type == 'HELIX' : self . parsehelix ( line ) elif type == 'SHEET' : self . parsesheet ( line ) elif type == 'TURN' : self . parseturn ( line ) elif type == 'MDLTYP' : pass elif type == 'SSBOND' : self . parsessbond ( line ) elif type == 'CRYST1' or type == 'CRYSTL' or type == 'CRYST' : self . parsecryst ( line ) elif type == 'ORIGX1' or type == 'ORIGX2' or type == 'ORIGX3' : self . parseorig ( line ) elif type == 'SCALE1' or type == 'SCALE2' or type == 'SCALE3' : self . parsescale ( line ) elif type == 'CONECT' : self . parseconnect ( line ) elif type == 'MASTER' : self . parsemaster ( line ) elif type == 'TER' : self . parseter ( line ) elif type == 'JRNL' : self . parsejournal ( line ) elif type == 'FTNOTE' : self . parsefootnote ( line ) elif type == 'HET' : self . parsehetheader ( line ) elif type == 'FORMUL' : self . parseformul ( line ) elif type == 'MODEL' : self . parsemodel ( line ) elif type == 'ENDMDL' : self . parseendmodel ( line ) elif type == 'END' : self . parseend ( line ) elif type == 'EXPDTA' : self . parseexpdta ( line ) elif type == 'JUNK' : pass elif type == 'NUMMDL' : pass else : pass return
This function calls other routines to parse the line
This function calls other routines to parse the line
"""
        # This function calls other routines to parse the line
        """ # # There are so many junk headers, so we simplify a bit # # # Should we ignore this model? # #print 'Skipping model no: %d' %self.NMRmodel # # Now call the appropritate function # #print 'Ignored header: %s' %type #raise ParseLineError, 'Unknown Header type: %s' %type
self
line