I have a pdb file which has distorted tertiary structure with serious steric clash within backbone. This pdb file was generated by assigning some phi and psi values to each residue of a protein and converting it into 3D coordinates in pdb file format which is done pretty well by AMBER. Because the phi and psi values which is being assigned can be out of allowed region in ramachandran plot, is there a way using any script or program, if I can give it input as a pdb file (or phi and psi angles of all residues of a protein) and it should tell which residues are outside allowed region and also should automatically correct those residues phi and psi angles so that they should fall within ramachandran allowed region. Finally I should get optimized phi and psi angles (or an optimized/minimized pdb file) as output.
I am attaching figure of my distorted protein structure where you can see how the backbone is having serious steric clash.