def write_solvent(atomistic_fragments, residue_type): merge_coord = [line['coord'] for line in atomistic_fragments] coord, index_conversion = at_mod.index_conversion_generate( atomistic_fragments, merge_coord) at_mod.write_pdb( atomistic_fragments, coord, index_conversion, g_var.working_dir + residue_type + '/' + residue_type + '_all.pdb')
def align_user_chains(final_coordinates_atomistic): atomistic_protein_centered, cg_com = center_atomistic( ) ## centers each chain by center of mass at_com_group, cg_com_group = rotate_protein_monomers( atomistic_protein_centered, final_coordinates_atomistic, cg_com) atomistic_protein_rotated = apply_rotations_to_chains( final_coordinates_atomistic, atomistic_protein_centered, at_com_group, cg_com_group, cg_com ) ## apply rotation matrix to atoms and build in missing residues final_user_supplied_coord = correct_disulphide_bonds( atomistic_protein_rotated ) ## fixes sulphur distances in user structure for chain, protein in final_user_supplied_coord.items(): at_id = 0 coord = [] final_atom = [] for resid, residue in protein.items(): for atom in residue.values(): coord.append(atom['coord']) final_atom.append({'atom_name':atom['atom'], 'residue_name':atom['res_type'], 'chain':chain, 'residue_id':resid,\ 'x':atom['coord'][0],'y':atom['coord'][1],'z':atom['coord'][2]}) at_id += 1 corrected_coords, index_conversion = at_mod.index_conversion_generate( final_atom, coord) at_mod.write_pdb( final_atom, corrected_coords, index_conversion, g_var.working_dir + 'PROTEIN/PROTEIN_aligned_' + str(chain) + '.pdb')