Skip to content
Snippets Groups Projects
Commit c8c57dd9 authored by marco's avatar marco
Browse files

fix BZDNG-156

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2722 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent d0809101
Branches
Tags
No related merge requests found
......@@ -250,7 +250,8 @@ void PDBReader::AssignSecStructure(mol::EntityHandle ent)
// two secondary structure segments to insert one residue of coil
// conformation.
mol::ResNum start=i->start, end=i->end;
if (helix_list_.end()!=i+1 && (*(i+1)).start.GetNum()<=end.GetNum()+1) {
if (helix_list_.end()!=i+1 && (*(i+1)).start.GetNum()<=end.GetNum()+1 &&
(*(i+1)).end.GetNum()>end.GetNum()) {
end=mol::ResNum((*(i+1)).start.GetNum()-2);
}
chain.AssignSecondaryStructure(alpha, start, end);
......@@ -266,7 +267,8 @@ void PDBReader::AssignSecStructure(mol::EntityHandle ent)
mol::SecStructure extended(mol::SecStructure::EXTENDED);
mol::ResNum start=i->start, end=i->end;
// see comment for helix assignment
if (strand_list_.end()!=i+1 && (*(i+1)).start.GetNum()<=end.GetNum()+1) {
if (strand_list_.end()!=i+1 && (*(i+1)).start.GetNum()<=end.GetNum()+1 &&
(*(i+1)).end.GetNum()>end.GetNum()) {
end=mol::ResNum((*(i+1)).start.GetNum()-2);
}
chain.AssignSecondaryStructure(extended, start, end);
......@@ -612,7 +614,7 @@ void PDBReader::ParseStrandEntry(const StringRef& line)
throw IOException(str(format("invalid strand entry on line %d")%line_num_));
}
LOG_DEBUG("making strand entry: " << start_num.second << ", " << line[26]
<< " " << end_num.second << " " << line[37]);
<< " " << end_num.second << " " << line[37] << " chain=" << line[21]);
HSEntry hse = {to_res_num(start_num.second, line[26]),
to_res_num(end_num.second, line[37]),
line.substr(21,1).str()};
......
......@@ -341,11 +341,23 @@ void ChainImpl::AssignSecondaryStructure(SecStructure ss,
const ResNum& start,
const ResNum& end)
{
int i=this->GetIndex(start);
int j=this->GetIndex(end);
if (i>=0 && j>=0 && i<=j && j<static_cast<int>(residue_list_.size())) {
std::for_each(residue_list_.begin()+i, residue_list_.begin()+j+1,
bind(&ResidueImpl::SetSecStructure, _1, ss));
int start_index=this->GetIndex(start);
int i=start_index;
bool found_end=false;
if (i>=0) {
while (i<static_cast<int>(residue_list_.size())) {
if (residue_list_[i]->GetNumber()==end) {
found_end=true;
break;
}
++i;
}
}
if (!found_end) {
return;
}
for (int end=i, i=start_index; i<=end; ++i) {
residue_list_[i]->SetSecStructure(ss);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment