// -*- mode:c++;c-file-style:"k&r";c-basic-offset:2;tab-width:2;indent-tabs-mode:t;rm-trailing-spaces:t -*- // insert_all_rotamers : Create & insert residue for each rotamer void dump_rotamers( pose::Pose& poseObj, rotamer_set::RotamerSetsOP rotsets, char * filename ) { using namespace ObjexxFCL; using namespace fmt; static std::string const chains( " ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" ); size_t atom_number = 0; std::ofstream out (filename, std::ofstream::out); // RotamerSet for(rotamer_set::FixbbRotamerSets::RotamerSetVector::const_iterator itRotSet=rotsets->begin(); itRotSet != rotsets->end(); ++itRotSet ) { // Rotamer size_t rotid=0; for(rotamer_set::Rotamers::const_iterator itRot=(*itRotSet)->begin(); itRot != (*itRotSet)->end(); ++itRot) { conformation::ResidueOP rsd = *itRot; // maximum chains if(rsd->chain() >= chains.size()) { std::cout << "ERROR: dump_rotamers: Too many chains." << std::endl; return; } // maximum rots ++rotid; if(rotid >= chains.size()) { break; } // Write ATOM lines for ( size_t j=1; j<= rsd->natoms(); ++j ) { conformation::Atom const & atom( rsd->atom(j) ); ++atom_number; char const chain( chains[ rsd->chain() ] ); out << "ATOM " << I(5,atom_number) << ' ' << rsd->atom_name(j) << chains[rotid] << rsd->name3() << ' ' << chain << I(4,rsd->seqpos() ) << " " << F(8,3,atom.xyz()(1)) << F(8,3,atom.xyz()(2)) << F(8,3,atom.xyz()(3)) << F(6,2,1.0) << F(6,2,0.0) << '\n'; } } } }