Esempio n. 1
0
 def __str__(self):
     data = ''
     for chain in self.__iter__():
         for rnum, residue in enumerate(chain):
             for offset, atom in enumerate(residue):
                 data += PDB_util.Atom2pdb(atom)
         ter = atom
         ter.set_param('atm_type', 'TER')
         ter.set_param('atm_name', ' ')
         data += PDB_util.Atom2pdb(atom)[0:26] + '\n'
     data += 'END'
     return data
Esempio n. 2
0
	def read_pdb(self):
		model = 1
		self.__models[ model ] = Pose.Pose( model )

		for line in open( self.__inputFile, 'r'):

			if "MODEL" == line[0:5]: 
				model = int(string.split(line)[1])
				self.__models[ model ] = Pose.Pose( model )

			elif ( ("ATOM" == line[0:4]) or ( "HETATM" ==line[0:6]) ):
				self.__models[ model ].add_atom( PDB_util.pdb2Atom(line) ) 
				
			elif ( ("TER" == line[0:3] ) or ( "ENDMDL" == line[0:6] ) or ("END" == line[0:3] ) ):
				continue
			else: self.__header += line	
Esempio n. 3
0
    def read_pdb(self):
        model = 1
        self.__models[model] = Pose.Pose(model)

        for line in open(self.__inputFile, 'r'):

            if "MODEL" == line[0:5]:
                model = int(string.split(line)[1])
                self.__models[model] = Pose.Pose(model)

            elif (("ATOM" == line[0:4]) or ("HETATM" == line[0:6])):
                self.__models[model].add_atom(PDB_util.pdb2Atom(line))

            elif (("TER" == line[0:3]) or ("ENDMDL" == line[0:6])
                  or ("END" == line[0:3])):
                continue
            else:
                self.__header += line
Esempio n. 4
0
 def __str__(self):
     data = ''
     for atom in self.__iter__():
         data += PDB_util.Atom2pdb(atom)
     return data
Esempio n. 5
0
	from numpy import array
	def apply_rotation( self, RotMatrix, c0 = array( [0, 0, 0] ) ):
		for chain in self.__iter__():
			for resi in chain:
				for atm in chain:
					print RotMatrix * (atm.pos - c0)
					

def build_pose( atom_objs ):
	pose = Pose()
	for atm in atom_objs:
		pose.add_atom( atm )	
	return pose

if __name__ == '__main__':
	data=[]
	path1='/Users/Josh/Documents/pdb/1FOS_cln.pdb'
	path2='/Users/Josh/Downloads/1HGD.pdb'
	for line in open(path2,'r'):
		if line[0:4] != 'ATOM': continue
		data.append( PDB_util.pdb2Atom(line) )
			
	pose = build_pose( data )
	pose.renumber()	
	#`for r in pose['A'][8:40]:
	#	print r['N']

	 
	print pose.seq()

Esempio n. 6
0
    from numpy import array

    def apply_rotation(self, RotMatrix, c0=array([0, 0, 0])):
        for chain in self.__iter__():
            for resi in chain:
                for atm in chain:
                    print RotMatrix * (atm.pos - c0)


def build_pose(atom_objs):
    pose = Pose()
    for atm in atom_objs:
        pose.add_atom(atm)
    return pose


if __name__ == '__main__':
    data = []
    path1 = '/Users/Josh/Documents/pdb/1FOS_cln.pdb'
    path2 = '/Users/Josh/Downloads/1HGD.pdb'
    for line in open(path2, 'r'):
        if line[0:4] != 'ATOM': continue
        data.append(PDB_util.pdb2Atom(line))

    pose = build_pose(data)
    pose.renumber()
    #`for r in pose['A'][8:40]:
    #	print r['N']

    print pose.seq()
Esempio n. 7
0
 def __str__(self):
     return PDB_util.Atom2pdb(self)