36 #include <ObjexxFCL/format.hh>
38 #include <basic/Tracer.hh>
39 #include <basic/options/option.hh>
43 #include <basic/options/keys/out.OptionKeys.gen.hh>
46 #include <utility/exit.hh>
49 #include <utility/io/ozstream.hh>
51 #include <utility/vector1.hh>
52 #include <boost/foreach.hpp>
58 #define foreach BOOST_FOREACH
61 namespace ObjexxFCL {
namespace fmt { } }
using namespace ObjexxFCL::fmt;
81 basic::Tracer
TR(
"core.io.pose_io");
96 static std::string const chains(
" ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" );
98 out <<
"MODEL " << tag <<
"\n";
99 for (
Size i=1; i<= nres; ++i ) {
101 for (
Size j=1; j<= rsd.natoms(); ++j ) {
108 if ( !basic::options::option[ basic::options::OptionKeys::out::file::output_virtual ]() &&
109 rsd.atom_type(j).is_virtual() )
continue;
112 runtime_assert( rsd.chain() < chains.size() );
113 char const chain( chains[ rsd.chain() ] );
114 out <<
"ATOM " << I(5,number) <<
' ' << rsd.atom_name(j) <<
' ' <<
115 rsd.name3() <<
' ' << chain << I(4,rsd.seqpos() ) <<
" " <<
116 F(8,3,atom.xyz()(1)) <<
117 F(8,3,atom.xyz()(2)) <<
118 F(8,3,atom.xyz()(3)) <<
119 F(6,2,1.0) << F(6,2,1.0) <<
'\n';
122 if(basic::options::option[ basic::options::OptionKeys::out::file::output_orbitals] &&
123 rsd.atom_type(j).atom_has_orbital()){
125 foreach(
core::Size orbital_index, orbital_indices){
127 Vector orbital_xyz(rsd.orbital_xyz(orbital_index));
128 out <<
"ATOM " << I(5,number) <<
' ' << rsd.orbital_name(orbital_index) <<
' ' <<
129 rsd.name3() <<
' ' << chain << I(4,rsd.seqpos() ) <<
" " <<
130 F(8,3,orbital_xyz.x()) <<
131 F(8,3,orbital_xyz.y()) <<
132 F(8,3,orbital_xyz.z()) <<
133 F(6,2,1.0) << F(6,2,1.0) <<
'\n';
160 static std::string const chains(
" ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" );
162 if(tag!=
"NO_MODEL_LINE_IN_OUTPUT") out <<
"MODEL " << tag <<
"\n";
163 for (
int i=1; i<= nres; ++i ) {
165 for (
Size j=1; j<= rsd.natoms(); ++j ) {
169 runtime_assert( rsd.chain() < chains.size() );
170 char const chain( chains[ rsd.chain() ] );
171 out <<
"ATOM " << I(5,number) <<
' ' << rsd.atom_name(j) <<
' ' <<
172 rsd.name3() <<
' ' << chain << I(4,rsd.seqpos() ) <<
" " <<
173 F(8,3,atom.xyz()(1)) <<
174 F(8,3,atom.xyz()(2)) <<
175 F(8,3,atom.xyz()(3)) <<
176 F(6,2,1.0) << F(6,2, bfactor[
id::AtomID(j,i) ] ) <<
'\n';
179 if(basic::options::option[ basic::options::OptionKeys::out::file::output_orbitals] &&
180 rsd.atom_type(j).atom_has_orbital()){
182 foreach(
core::Size orbital_index, orbital_indices){
184 Vector orbital_xyz(rsd.orbital_xyz(orbital_index));
185 out <<
"ATOM " << I(5,number) <<
' ' << rsd.orbital_name(orbital_index) <<
' ' <<
186 rsd.name3() <<
' ' << chain << I(4,rsd.seqpos() ) <<
" " <<
187 F(8,3,orbital_xyz.x()) <<
188 F(8,3,orbital_xyz.y()) <<
189 F(8,3,orbital_xyz.z()) <<
190 F(6,2,1.0) << F(6,2,1.0) <<
'\n';
199 if(tag!=
"NO_MODEL_LINE_IN_OUTPUT") out <<
"ENDMDL\n";
211 static std::string const chains(
" ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" );
217 runtime_assert( rsd.
chain() < chains.size() );
218 char const chain( chains[ rsd.
chain() ] );
219 out <<
"ATOM " << I(5,atom_number) <<
' ' << rsd.
atom_name(j) <<
' ' <<
220 rsd.
name3() <<
' ' << chain << I(4,rsd.
seqpos() ) <<
" " <<
221 F(8,3,atom.xyz()(1)) <<
222 F(8,3,atom.xyz()(2)) <<
223 F(8,3,atom.xyz()(3)) <<
224 F(6,2,1.0) << F(6,2,0.0) <<
'\n';
225 if(basic::options::option[ basic::options::OptionKeys::out::file::output_orbitals] &&
229 foreach(
core::Size orbital_index, orbital_indices){
231 out <<
"ATOM " << I(5,atom_number) <<
' ' << rsd.
orbital_name(orbital_index) <<
' ' <<
232 rsd.
name3() <<
' ' << chain << I(4,rsd.
seqpos() ) <<
" " <<
233 F(8,3,orbital_xyz.x()) <<
234 F(8,3,orbital_xyz.y()) <<
235 F(8,3,orbital_xyz.z()) <<
236 F(6,2,1.0) << F(6,2,1.0) <<
'\n';
278 basic::Tracer
const &
tr,
285 if ( !tr.visible() ) {
299 basic::Tracer
const &
tr,
306 if ( !tr.visible() ) {
445 if( inval >= 1 || inval <= -1 ) {
449 std::stringstream temp;
450 temp << std::fixed << std::setprecision(5) << inval;
458 utility::io::ozstream & out
471 ScoreTypeVec score_types;
474 if ( weights[ii] != 0 ) score_types.push_back(ii);
477 out <<
"# All scores below are weighted scores, not raw scores.\n";
478 out <<
"#BEGIN_POSE_ENERGIES_TABLE " << out.filename() <<
"\n";
486 out <<
" " << weights[score_type];
509 out <<
"#END_POSE_ENERGIES_TABLE " << out.filename() <<
"\n";
518 std::map< id::AtomID, Size > & atom_id_output ){
527 for (
Size j=1; j<= rsd.natoms(); ++j ) {
531 if ( !atom_id_output[ atom_id ] )
continue;
534 for (
Size n = 1; n <= nbr_ids.size(); n++ ) {
538 if ( !atom_id_output[ nbr_id ] )
continue;
540 if ( atom_id.rsd() > nbr_id.rsd() )
continue;
541 if ( atom_id.rsd() == nbr_id.rsd() && atom_id.atomno() > nbr_id.atomno() )
continue;
543 if ( ( pose.
xyz( atom_id ) - pose.
xyz( nbr_id ) ).length() <
CUTOFF )
continue;
549 if( ( nbr->parent() != atom ) && ( atom->parent() != nbr ) )
continue;
551 out <<
"CONECT" << I(5,atom_id_output[ atom_id ]) << I(5,atom_id_output[ nbr_id ]) << std::endl;
566 std::ostream & out ){
568 std::map< id::AtomID, Size > atom_id_output;
576 for (
Size j=1; j<= rsd.natoms(); ++j ) {
581 if ( !basic::options::option[ basic::options::OptionKeys::out::file::output_virtual ]() && rsd.is_virtual( j ) )
continue;