Protool/structure.py
def readpdb(self,filename=None,data=None,parse=1,readmodels=1,use_NMRnumber=True):
        """
        # Reads a pdb file and lets PDBparser.parse do the parsing
        """
        import os
        if data != None:
            import StringIO
            stream = StringIO.StringIO(data)            
            self.lines = stream.readlines()            
        elif os.path.isfile(filename):
            if not silent:
                print 'Reading: ',filename
            fd=open(filename)
            self.lines=fd.readlines()
            fd.close()
        else:
            raise FileNotFoundError(filename)            
        if parse:
            import PDBparser
            Y=PDBparser.PDBparser(self.lines,self.parse_terms)
            Y.readmodels=readmodels
            if not use_NMRnumber:
                Y.ignore_NMRmodel=True
            #
            Y.parse()
            self.atoms=Y.atoms
            if hasattr(Y,'spacegroup'):
                self.spacegroup=Y.spacegroup # Transfer spacegroup info
            else:
                self.spacegroup='Unknown'
            self.header=''
            if hasattr(Y,'header'):
                self.header=Y.header
            #
            # Transfer crystal symmetry info
            #
            self.scale=Y.scale
            self.orig=Y.orig
            self.cryst=Y.cryst
            #
            # Update
            #
            self.Update()
            self.attribute=Y.attribute
            if not silent:
                print 'Read file with %3d residues and %5d atoms' %(len(self.residues.keys()),len(self.atoms.keys()))
        return

        # Reads a pdb file and lets PDBparser.parse do the parsing
        
Reads a pdb file and lets PDBparser.parse do the parsing
Reads a pdb file and lets PDBparser . parse do the parsing
def readpdb(self,filename=None,data=None,parse=1,readmodels=1,use_NMRnumber=True):
        import os
        if data != None:
            import StringIO
            stream = StringIO.StringIO(data)            
            self.lines = stream.readlines()            
        elif os.path.isfile(filename):
            if not silent:
                print 'Reading: ',filename
            fd=open(filename)
            self.lines=fd.readlines()
            fd.close()
        else:
            raise FileNotFoundError(filename)            
        if parse:
            import PDBparser
            Y=PDBparser.PDBparser(self.lines,self.parse_terms)
            Y.readmodels=readmodels
            if not use_NMRnumber:
                Y.ignore_NMRmodel=True
            Y.parse()
            self.atoms=Y.atoms
            if hasattr(Y,'spacegroup'):
                self.spacegroup=Y.spacegroup  Transfer spacegroup info
            else:
                self.spacegroup='Unknown'
            self.header=''
            if hasattr(Y,'header'):
                self.header=Y.header
             Transfer crystal symmetry info
            self.scale=Y.scale
            self.orig=Y.orig
            self.cryst=Y.cryst
             Update
            self.Update()
            self.attribute=Y.attribute
            if not silent:
                print 'Read file with %3d residues and %5d atoms' %(len(self.residues.keys()),len(self.atoms.keys()))
        return
def readpdb ( self , filename = None , data = None , parse = 1 , readmodels = 1 , use_NMRnumber = True ) : import os if data != None : import StringIO stream = StringIO . StringIO ( data ) self . lines = stream . readlines ( ) elif os . path . isfile ( filename ) : if not silent : print 'Reading: ' , filename fd = open ( filename ) self . lines = fd . readlines ( ) fd . close ( ) else : raise FileNotFoundError ( filename ) if parse : import PDBparser Y = PDBparser . PDBparser ( self . lines , self . parse_terms ) Y . readmodels = readmodels if not use_NMRnumber : Y . ignore_NMRmodel = True Y . parse ( ) self . atoms = Y . atoms if hasattr ( Y , 'spacegroup' ) : self . spacegroup = Y . spacegroup else : self . spacegroup = 'Unknown' self . header = '' if hasattr ( Y , 'header' ) : self . header = Y . header self . scale = Y . scale self . orig = Y . orig self . cryst = Y . cryst self . Update ( ) self . attribute = Y . attribute if not silent : print 'Read file with %3d residues and %5d atoms' % ( len ( self . residues . keys ( ) ) , len ( self . atoms . keys ( ) ) ) return
Reads a pdb file and lets PDBparser.parse do the parsing
Reads a pdb file and lets PDBparser . parse do the parsing
"""
        # Reads a pdb file and lets PDBparser.parse do the parsing
        """ # # Transfer spacegroup info # # Transfer crystal symmetry info # # # Update #
self
filename
data
parse
readmodels
use_NMRnumber