Hi Members,
How do I get distance between pdb atoms of 2 files, after they are super imposed?
After superimposition, I want distance between atoms of file1, and file2.
Any suggestion(s)?
How do I get distance between pdb atoms of 2 files, after they are super imposed?
Code:
def alignPDB_file(refPDB, samplePDB): # function to align pdb file ref_atoms,sample_atoms=[],[] sam_str=PDBParser(QUIET=True).get_structure("sample",samplePDB) # create sampple structure ref_model=PDBParser(QUIET=True).get_structure("reference",refPDB)[0] # get the 0th model sam_model=sam_str[0] # get the 0th model for ref_chain in ref_model: for ref_res in ref_chain: if not "CA" in ref_res:continue else: ref_atoms.append(ref_res['CA']) for sam_chain in sam_model: for sam_res in sam_chain: if not "CA" in sam_res: continue else: sample_atoms.append(sam_res['CA']) sup=Superimposer() sup.set_atoms(ref_atoms, sample_atoms) print sup.rms sup.apply(sample_atoms) io = PDBIO() #PDBParser(QUIET=True).get_structure("reference",refPDB) io.set_structure(sam_str) io.save('out.pdb')
Any suggestion(s)?
Comment