Skip to content

Commit

Permalink
Merge pull request #1746 from TactfulDeity/enh/additional_secondary_s…
Browse files Browse the repository at this point in the history
…tructures

ENH: Additional Secondary Structures
  • Loading branch information
ghutchis authored Oct 20, 2024
2 parents f0d427e + ac970a9 commit 7468e5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
26 changes: 19 additions & 7 deletions avogadro/core/secondarystructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,26 @@ void SecondaryStructureAssigner::assign(Molecule* mol)
// check to see how far apart the residues are
int separation = std::abs(int(hBond->residue - hBond->residuePair));

// just alpha for now
if (separation == 4) {
m_molecule->residue(hBond->residue)
.setSecondaryStructure(Residue::SecondaryStructure::alphaHelix);
switch (separation) {
case 3: { // 3-10
m_molecule->residue(hBond->residue)
.setSecondaryStructure(Residue::SecondaryStructure::helix310);
break;
}
case 4: { // alpha
m_molecule->residue(hBond->residue)
.setSecondaryStructure(Residue::SecondaryStructure::alphaHelix);
break;
}
case 5: { // pi
m_molecule->residue(hBond->residue)
.setSecondaryStructure(Residue::SecondaryStructure::piHelix);
break;
}
default: {
break;
}
}
// TODO
// 3-10 helix
// pi-helix
}
}

Expand Down
6 changes: 5 additions & 1 deletion avogadro/rendering/cartoongeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ CartoonType secondaryToCartoonType(Residue::SecondaryStructure sec)
return Arrow;
case Residue::SecondaryStructure::alphaHelix:
return Tail;
case Residue::SecondaryStructure::helix310:
return Tail;
case Residue::SecondaryStructure::piHelix:
return Tail;
default:
return Body;
}
Expand Down Expand Up @@ -132,4 +136,4 @@ void Cartoon::addPoint(const Vector3f& pos, const Vector3ub& color,
BSplineGeometry::addPoint(pos, color, m_minRadius, group, id);
}

} // namespace Avogadro
} // namespace Avogadro::Rendering

0 comments on commit 7468e5f

Please sign in to comment.