37 #include <basic/datacache/BasicDataCache.hh>
39 #include <basic/prof.hh>
46 #include <basic/options/option.hh>
47 #include <basic/options/keys/in.OptionKeys.gen.hh>
49 #include <utility/vector1.hh>
58 #include <basic/options/keys/OptionKeys.hh>
69 #include <utility/vector0.hh>
70 #include <numeric/xyz.functions.hh>
138 ReferenceCount ( src )
150 for(; begin <=
end; ++begin){
151 residue_indices.push_back(begin);
160 PROF_START ( basic::POSE_COPY );
202 old_conf.reset_to_null();
205 PROF_STOP ( basic::POSE_COPY );
232 PyAssert( (seqpos<=
total_residue()),
"Pose::chain( Size const seqpos ): variable seqpos is out of range!" );
290 singlechain_poses.push_back(
new Pose(*
this) );
291 return singlechain_poses;
296 Size chain_begin, chain_end, delete_begin, delete_end;
298 chain_pose =
new Pose(*
this);
299 chain_begin = chain_pose->conformation().chain_begin( i );
300 chain_end = chain_pose->conformation().chain_end( i );
303 if (chain_begin == 1) {
304 delete_begin = chain_end + 1;
305 delete_end = chain_pose->total_residue();
306 chain_pose->conformation().delete_residue_range_slow( delete_begin, delete_end );
309 else if ( chain_end == chain_pose->total_residue() ) {
311 delete_end = chain_begin - 1;
312 chain_pose->conformation().delete_residue_range_slow( delete_begin, delete_end );
317 delete_end = chain_begin - 1;
318 chain_pose->conformation().delete_residue_range_slow( delete_begin, delete_end );
320 delete_begin = chain_end - chain_begin + 2;
321 delete_end = chain_pose->total_residue();
322 chain_pose->conformation().delete_residue_range_slow( delete_begin, delete_end );
326 using basic::options::option;
327 using namespace basic::options::OptionKeys;
328 if ( option[ in::detect_disulf ].user() ?
329 option[ in::detect_disulf ]() :
330 chain_pose->is_fullatom() )
332 chain_pose->conformation().detect_disulfides();
336 chain_pose->pdb_info()->obsolete(
false);
338 singlechain_poses.push_back( chain_pose );
340 return singlechain_poses;
348 return Pose(*
this, begin, end);
383 char last_pdb_chain =
pdb_info_->chain(1);
384 char current_pdb_chain;
388 if (current_pdb_chain != last_pdb_chain) {
389 new_endings.push_back(i - 1);
390 last_pdb_chain = current_pdb_chain;
405 {
metrics_->get(calculator_name, key, val, *
this);
return; }
409 {
return metrics_->print(calculator_name, key, *
this); }
414 Size const jump_anchor_residue,
417 bool const start_new_chain
422 conformation_->append_residue_by_jump( new_rsd, jump_anchor_residue, jump_anchor_atom, jump_root_atom, start_new_chain );
428 bool const build_ideal_geometry,
429 int const connection,
430 Size const anchor_residue,
431 int const anchor_connection,
432 bool const start_new_chain,
433 bool const lookup_bond_length
438 conformation_->append_residue_by_bond( new_rsd, build_ideal_geometry, connection, anchor_residue, anchor_connection, start_new_chain, lookup_bond_length);
451 PyAssert( (anchor_pos<=
total_residue()),
"Pose::insert_residue_by_jump( ...Size anchor_pos... ): variable anchor_pos is out of range!" );
453 conformation_->insert_residue_by_jump( new_rsd_in, seqpos, anchor_pos, anchor_atomno, root_atomno );
460 bool const orient_backbone
463 PyAssert( (seqpos<=
total_residue()),
"Pose::replace_residue( ...Size const seqpos... ): variable seqpos is out of range!" );
464 conformation_->replace_residue( seqpos, new_rsd_in, orient_backbone );
472 utility::vector1< std::pair< std::string, std::string > >
const & atom_pairs
475 PyAssert( (seqpos<=
total_residue()),
"Pose::replace_residue( ...Size const seqpos... ): variable seqpos is out of range!" );
476 conformation_->replace_residue( seqpos, new_rsd_in, atom_pairs );
483 bool const build_ideal_geometry
486 PyAssert( (seqpos<=
total_residue()),
"Pose::append_polymer_residue_after_seqpos( ...Size const seqpos... ): variable seqpos is out of range!" );
488 conformation_->append_polymer_residue_after_seqpos( new_rsd, seqpos, build_ideal_geometry );
496 bool const build_ideal_geometry
499 PyAssert( (seqpos<=
total_residue()),
"Pose::prepend_polymer_residue_before_seqpos( ...Size const seqpos... ): variable seqpos is out of range!" );
501 conformation_->prepend_polymer_residue_before_seqpos( new_rsd, seqpos, build_ideal_geometry );
507 PyAssert( (seqpos<=
total_residue()),
"Pose::delete_polymer_residue( Size const seqpos ): variable seqpos is out of range!" );
554 PyAssert( (seqpos<=
total_residue()),
"Pose::aa( Size const seqpos ): variable seqpos is out of range!" );
561 PyAssert( (seqpos<=
total_residue()),
"Pose::secstruct( Size const seqpos ): variable seqpos is out of range!" );
577 PyAssert( (seqpos<=
total_residue()),
"Pose::set_secstruct( Size const seqpos , char const setting ): variable seqpos is out of range!" );
597 using namespace core::chemical;
605 && ( show_all_variants ||
residue(i).name().substr(0,3) !=
"CYD")
618 assert(chain_in <= conformation_->num_chains());
619 PyAssert((chain_in <= conformation_->num_chains()),
620 "Pose::chain_sequence(core::Size const chain_in): variable chain_in is out of range!");
622 stringstream seq(stringstream::out);
627 if (!
residue(begin).is_carbohydrate()) {
628 for (
Size i = begin; i <=
end; ++i) {
633 for (
Size i =
end; i >= begin; --i) {
651 PyAssert( (seqpos<=
total_residue()),
"Pose::residue( Size const seqpos ): variable seqpos is out of range!" );
660 PyAssert( (seqpos<=
total_residue()),
"Pose::residue_type( Size const seqpos ): variable seqpos is out of range!" );
682 "Pose::phi( Size const seqpos ): variable seqpos is out of range!" );
684 "Pose::phi( Size const seqpos ): residue seqpos is not part of a protein or carbohydrate!" );
706 "Pose::set_phi( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
708 "Pose::set_phi( Size const seqpos , Real const setting ): residue seqpos is not part of a protein or carbohydrate!" );
730 "Pose::psi( Size const seqpos ): variable seqpos is out of range!" );
732 "Pose::psi( Size const seqpos ): residue seqpos is not part of a protein or carbohydrate!" );
738 PyAssert((seqpos != 1),
739 "Pose::psi( Size const seqpos ): variable seqpos is out of range for carbohydrates!");
756 "Pose::set_psi( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
758 "Pose::set_psi( Size const seqpos , Real const setting ): residue seqpos is not part of a protein or carbohydrate!" );
764 PyAssert((seqpos != 1),
765 "Pose::set_psi( Size const seqpos, Real const setting ): variable seqpos is out of range for carbohydrates!");
783 "Pose::omega( Size const seqpos ): variable seqpos is out of range!" );
785 "Pose::omega( Size const seqpos ): residue seqpos is not part of a protein or carbohydrate!" );
791 PyAssert((seqpos != 1),
792 "Pose::omega( Size const seqpos ): variable seqpos is out of range for carbohydrates!");
793 PyAssert((
residue_type(seqpos - 1).carbohydrate_info()->has_exocyclic_linkage()),
794 "Pose::omega( Size const seqpos ): residue seqpos - 1 does not have an exocyclic glycosidic linkage!");
813 "Pose::set_omega( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
815 "Pose::set_omega( Size const seqpos , Real const setting ): "
816 "residue seqpos is not part of a protein or carbohydrate!" );
822 PyAssert((seqpos != 1),
823 "Pose::set_omega( Size const seqpos, Real const setting ): "
824 "variable seqpos is out of range for carbohydrates!");
825 PyAssert((
residue_type(seqpos - 1).carbohydrate_info()->has_exocyclic_linkage()),
826 "Pose::set_omega( Size const seqpos, Real const setting ): "
827 "residue seqpos - 1 does not have an exocyclic glycosidic linkage!");
840 PyAssert( (seqpos<=
total_residue()),
"Pose::alpha( Size const seqpos ): variable seqpos is out of range!" );
841 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::alpha( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
850 PyAssert( (seqpos<=
total_residue()),
"Pose::set_alpha( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
851 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_alpha( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
859 PyAssert( (seqpos<=
total_residue()),
"Pose::beta( Size const seqpos ): variable seqpos is out of range!" );
860 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::beta( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
869 PyAssert( (seqpos<=
total_residue()),
"Pose::set_beta( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
870 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_beta( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
878 PyAssert( (seqpos<=
total_residue()),
"Pose::gamma( Size const seqpos ): variable seqpos is out of range!" );
879 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::gamma( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
888 PyAssert( (seqpos<=
total_residue()),
"Pose::set_gamma( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
889 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_gamma( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
897 PyAssert( (seqpos<=
total_residue()),
"Pose::delta( Size const seqpos ): variable seqpos is out of range!" );
898 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::delta( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
907 PyAssert( (seqpos<=
total_residue()),
"Pose::set_delta( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
908 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_delta( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
916 PyAssert( (seqpos<=
total_residue()),
"Pose::epsilon( Size const seqpos ): variable seqpos is out of range!" );
917 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::epsilon( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
926 PyAssert( (seqpos<=
total_residue()),
"Pose::set_epsilon( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
927 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_epsilon( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
935 PyAssert( (seqpos<=
total_residue()),
"Pose::zeta( Size const seqpos ): variable seqpos is out of range!" );
936 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::zeta( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
945 PyAssert( (seqpos<=
total_residue()),
"Pose::set_zeta( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
946 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_zeta( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
960 PyAssert( (seqpos<=
total_residue()),
"Pose::chi( int const chino , Size const seqpos ): variable seqpos is out of range!" );
962 "Pose::chi( int const chino , Size const seqpos ): residue seqpos is not part of a protein or carbohydrate!" );
963 PyAssert( (chino>0) && (chino<=
residue(seqpos).nchi()),
"Pose::chi( int const chino , Size const seqpos ): variable chino innappropriate for this residue!" );
975 PyAssert( (seqpos<=
total_residue()),
"Pose::set_chi( int const chino , Size const seqpos ): variable seqpos is out of range!" );
977 "Pose::set_chi( int const chino , Size const seqpos , Real const setting ): residue seqpos is not part of a protein or carbohydrate!" );
978 PyAssert( (chino>0) && (chino<=
residue(seqpos).nchi()),
"Pose::set_chi( int const chino , Size const seqpos ): variable chino innappropriate for this residue!" );
988 PyAssert( (seqpos<=
total_residue()),
"Pose::chi( Size const seqpos ): variable seqpos is out of range!" );
989 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::chi( Size const seqpos ): residue seqpos is not part of a Nucleic Acid!" );
998 PyAssert( (seqpos<=
total_residue()),
"Pose::set_chi( Size const seqpos, Real const setting ): variable seqpos is out of range!" );
999 PyAssert( (
residue_type(seqpos).is_NA()),
"Pose::set_chi( Size const seqpos , Real const setting ): residue seqpos is not part of a Nucleic Acid!" );
1028 int const jump_number,
1038 int const jump_number,
1171 cog /= (
Real) count;
1194 }
else if (
energies_->residue_neighbors_updated() ) {
1202 energies_->update_residue_neighbors( domain_map, *
this );
1221 energies_->scoring_begin( sfxn, *
this );
1302 std::ofstream out( file_name.c_str() );
1308 out <<
"SS: " << secstruct <<
'\n';
1309 out <<
"SCORE_INFO:\n";
1310 out <<
"TOTAL_SCORE: " << total_score <<
'\n';
1317 scorefxn.
show( out );
1368 using namespace scoring::constraints;
1370 for( ConstraintCOPs::const_iterator cst_it = csts.begin(); cst_it != csts.end(); ++cst_it )
1371 new_csts.push_back( (*cst_it)->clone() );
1379 bool object_comparison )
1389 bool object_comparison )
1411 if( constraint_set != 0 ){
1474 return prior_pdb_info;
1508 if ( fire_general ) {
1519 if ( fire_general ) {
1535 os <<
"PDB file name: "<< p->name() << std::endl;
1537 os <<
"Total residues:" << pose.
total_residue() << std::endl;
1538 os <<
"Sequence: " << pose.
sequence() << std::endl;
1539 os <<
"Fold tree:" << std::endl << pose.
fold_tree();
1549 void lregister_Pose( lua_State * lstate ) {
1550 luabind::module(lstate,
"core")
1552 luabind::namespace_(
"pose")
1554 luabind::class_<Pose>(
"Pose")