28 #include <basic/Tracer.hh>
29 #include <utility/PyAssert.hh>
30 #include <utility/exit.hh>
31 #include <utility/vector1.hh>
36 #include <utility/vector0.hh>
37 #include <ObjexxFCL/format.hh>
42 using namespace ObjexxFCL::fmt;
48 static basic::Tracer
TR(
"core.pose.PDBInfo");
57 num_unrecognized_res_(0),
58 num_unrecognized_atoms_(0)
71 num_unrecognized_res_(0),
72 num_unrecognized_atoms_(0)
90 residue_rec_( pose.total_residue() ),
92 num_unrecognized_res_(0),
93 num_unrecognized_atoms_(0)
105 rr.
resSeq =
static_cast< int >( i );
115 obsolete_( info.obsolete_ ),
117 modeltag_( info.modeltag_ ),
118 header_information_( info.header_information_ ),
119 remarks_( info.remarks_ ),
120 residue_rec_( info.residue_rec_ ),
121 pdb2pose_( info.pdb2pose_ ),
123 unrecognized_atoms_ ( info.unrecognized_atoms_ ),
124 unrecognized_res_num2name_( info.unrecognized_res_num2name_ ),
125 unrecognized_res_size_ ( info.unrecognized_res_size_ ),
126 num_unrecognized_res_ ( info.num_unrecognized_res_ ),
127 num_unrecognized_atoms_ ( info.num_unrecognized_atoms_ )
144 if (
this != &info ) {
145 Super::operator =( info );
215 switch ( event.
tag ) {
216 case ConnectionEvent::DISCONNECT:
220 case ConnectionEvent::TRANSFER:
235 switch( event.
tag ) {
236 case IdentityEvent::INVALIDATE: {
243 case IdentityEvent::RESIDUE: {
269 switch( event.
tag ) {
270 case LengthEvent::INVALIDATE: {
275 case LengthEvent::RESIDUE_APPEND: {
280 case LengthEvent::RESIDUE_PREPEND: {
285 case LengthEvent::RESIDUE_DELETE: {
350 i->atomRec.resize( n );
389 if ( i->atomRec.capacity() > i->atomRec.size() ) {
403 PyAssert((res > 0) && (res <=
residue_rec_.size()),
"PDBInfo::pose2pdb( Size const res ): res is not in this PDBInfo!" );
404 std::stringstream pdb_num, pdb_chain;
407 return pdb_chain.str() +
" " + pdb_num.str();
419 PyAssert((res > 0) && (res <=
residue_rec_.size()),
"PDBInfo::chain( Size const res, char const chain_id ): res is not in this PDBInfo!" );
437 PyAssert((res > 0) && (res <=
residue_rec_.size()),
"PDBInfo::number( Size const res, int const pdb_res ): res is not in this PDBInfo!" );
455 PyAssert((res > 0) && (res <=
residue_rec_.size()),
"PDBInfo::icode( Size const res, ins_code ): res is not in this PDBInfo!" );
473 Size current_res_tot = 0;
474 Size current_atm_tot = 0;
476 Size current_start_pose = 0;
477 char icode_start_pdb(
' ');
479 out <<
"PDB file name: " <<
name() << std::endl;
480 out <<
" Pose Range Chain PDB Range | #Resi #Atoms\n" << std::endl;
484 if (current_start_pose<1){
486 current_atm_tot =
natoms(i);
487 current_start_pose = i;
488 icode_start_pdb =
icode(i);
490 current_res_tot += 1;
491 current_atm_tot +=
natoms(i);
494 out << I(4,4,current_start_pose) <<
" -- " << I(4,4,i) <<
A(5,
chain(i)) <<
495 ' ' << I(4,4,
number(i)-current_res_tot) << icode_start_pdb <<
" -- " << I(4,4,
number(i)) <<
icode(i) <<
496 " | " << I(6,4,current_res_tot+1) <<
" residues; " << I(8,5,current_atm_tot) <<
" atoms\n";
498 atm_tot += current_atm_tot;
499 current_start_pose = 0;
503 out <<
"\t\t\t TOTAL | " << I(6,4,
nres()) <<
" residues; " << I(8,5,atm_tot) << std::endl;
554 Size const copy_from,
556 Size const start_from
564 Size idx = start_from;
565 ResidueRecords::const_iterator
const begin =
residue_rec_.begin() + ( start_from - 1 );
566 ResidueRecords::const_iterator
const end = begin + ( copy_to - copy_from + 1 );
567 for ( ResidueRecords::const_iterator i = begin; i <
end; ++i, ++idx ) {
579 Size count = start_from;
580 for ( ResidueRecords::const_iterator i = begin; i <
end; ++i, ++count ) {
602 Size count = res + 2;
603 ResidueRecords::const_iterator i =
residue_rec_.begin() + ( res + 1 );
604 for ( ResidueRecords::const_iterator ie =
residue_rec_.end(); i < ie; ++i, ++count ) {
626 Size count = res + 1;
627 ResidueRecords::const_iterator i =
residue_rec_.begin() + res;
628 for ( ResidueRecords::const_iterator ie =
residue_rec_.end(); i < ie; ++i, ++count ) {
665 for ( ResidueRecords::iterator i = start, ie = start + n; i < ie; ++i, ++idx ) {
708 basic::Error() <<
"PDBInfo::check_residue_records_size() failed. An en masse action attempted to access or set more residues than exists in PDBInfo."