27 def transform(input_pdb, input_lib, output_pdb):
35 rl.read_library_file(input_lib)
41 rd = h.get_as_residue()
42 rr = rc.get_rotamer(rd, 0.01)
43 rotamers.append((rd, rr))
47 for rd, rr
in rotamers:
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_option(
'--input_pdb',
'-i', action=
'store', type=
'string',
74 help=
'input PDB file (required)')
75 P.add_option(
'--input_lib',
'-l', action=
'store', type=
'string',
76 help=
'input rotamer library file (required)')
77 P.add_option(
'--output_pdb',
'-o', action=
'store', type=
'string',
78 help=
'output PDB file (required)')
79 P.add_option(
'--verbose',
'-v', action=
'store_true',
80 help=
'show more messages')
81 opts, args = P.parse_args()
83 not (opts.input_pdb
or opts.input_lib
or opts.output_pdb):
86 if not opts.input_pdb:
87 print '--input_pdb is required'
89 if not opts.output_pdb:
90 print '--output_pdb is required'
92 if not opts.input_lib:
93 print '--input_lib is required'
99 transform(opts.input_pdb, opts.input_lib, opts.output_pdb)
void write_pdb(const Selection &mhd, base::TextOutput out, unsigned int model=1)
IMP-specific subclass of optparse.OptionParser.
void set_log_level(LogLevel l)
Set the current global log level.
A class storing a whole rotamer library read from a file.
bool get_bool_flag(std::string name)
See IMP.base for more information.
void transform(Hierarchy h, const algebra::Transformation3D &tr)
A class performing the rotations of atoms in the residues.
Hierarchies get_by_type(Hierarchy mhd, GetByType t)
See IMP.rotamer for more information.
A decorator for a particle with x,y,z coordinates.
See IMP.core for more information.
See IMP.algebra for more information.
See IMP.atom for more information.
void read_pdb(base::TextInput input, int model, Hierarchy h)
Class for storing model, its restraints, constraints, and particles.