19 from __future__
import print_function
27 def transform(input_pdb, input_lib, output_pdb):
31 mh = IMP.atom.get_by_type(orig_h, IMP.atom.RESIDUE_TYPE)
35 rl.read_library_file(input_lib)
42 rr = rc.get_rotamer(rd, 0.01)
43 rotamers.append((rd, rr))
47 for rd, rr
in rotamers:
48 for h
in IMP.atom.get_by_type(rd, IMP.atom.ATOM_TYPE):
50 at_t = at.get_atom_type()
51 if rr.get_atom_exists(at_t):
53 idx = min(rr.get_number_of_cases(at_t) - 1, 1)
54 v = rr.get_coordinates(idx, at_t)
56 xyz.set_coordinates(v)
68 if __name__ ==
'__main__':
73 P.add_argument(
'--input_pdb',
'-i', action=
'store',
74 help=
'input PDB file (required)')
75 P.add_argument(
'--input_lib',
'-l', action=
'store',
76 help=
'input rotamer library file (required)')
77 P.add_argument(
'--output_pdb',
'-o', action=
'store',
78 help=
'output PDB file (required)')
79 P.add_argument(
'--verbose',
'-v', action=
'store_true',
80 help=
'show more messages')
83 not (args.input_pdb
or args.input_lib
or args.output_pdb):
86 if not args.input_pdb:
87 print(
'--input_pdb is required')
89 if not args.output_pdb:
90 print(
'--output_pdb is required')
92 if not args.input_lib:
93 print(
'--input_lib is required')
99 transform(args.input_pdb, args.input_lib, args.output_pdb)
A class storing a whole rotamer library read from a file.
bool get_bool_flag(std::string name)
void write_pdb(const Selection &mhd, TextOutput out, unsigned int model=1)
void read_pdb(TextInput input, int model, Hierarchy h)
Class for storing model, its restraints, constraints, and particles.
void transform(Hierarchy h, const algebra::Transformation3D &tr)
Transform a hierarchy. This is aware of rigid bodies.
A decorator for a particle representing an atom.
A class performing the rotations of atoms in the residues.
Sampling of sidechain rotamers.
A decorator for a particle with x,y,z coordinates.
IMP-specific subclass of argparse.ArgumentParser.
void set_log_level(LogLevel l)
Set the current global log level.
A decorator for a residue.
Basic functionality that is expected to be used by a wide variety of IMP users.
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
Functionality for loading, creating, manipulating and scoring atomic structures.