Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code ank2829 issue51 #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions sketcherMinimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
#include "sketcherMinimizerMaths.h"
#include "sketcherMinimizerRing.h"
#include "sketcherMinimizerStretchInteraction.h"

#include "sketcherMinimizerAtom.h"
#include "sketcherMinimizerBond.h"
#include "sketcherMinimizerFragment.h"
using namespace std;
using namespace schrodinger;

Expand All @@ -54,7 +56,7 @@ sketcherMinimizer::sketcherMinimizer(float precision)

sketcherMinimizer::~sketcherMinimizer()
{
clear();
void clear();
}

void sketcherMinimizer::setScoreResidueInteractions(bool b)
Expand Down Expand Up @@ -161,11 +163,13 @@ void sketcherMinimizer::canonicalOrdering(sketcherMinimizerMolecule* minMol)
}
}

void sketcherMinimizer::initialize(
sketcherMinimizerMolecule* minMol) // min mol is split into molecules if
// needed and then added to the minimizer
{
clear();
void sketcherMinimizer::initialize(sketcherMinimizerMolecule* minMol) {
// min mol is split into molecules if
// needed and then added to the minimizer
void clear();
m_proximityRelations.clear();

m_proximityRelations.clear();
m_referenceAtoms = minMol->_atoms;
m_referenceBonds = minMol->_bonds;

Expand Down Expand Up @@ -335,7 +339,7 @@ void sketcherMinimizer::flagCrossAtoms()
}
}

void sketcherMinimizer::clear()
void sketcherMinimizer :: clear()
{
for (auto& _referenceAtom : m_referenceAtoms) {
delete _referenceAtom;
Expand Down Expand Up @@ -367,10 +371,29 @@ void sketcherMinimizer::clear()
}

m_molecules.clear();

for(auto& _atoms : m_atoms) {
delete _atoms;
}
m_atoms.clear();

for(auto& _bonds : m_bonds) {
delete _bonds;
}
m_bonds.clear();

for(auto& _residueInteractions : m_residueInteractions) {
delete _residueInteractions;
}
m_residueInteractions.clear();

for(auto& _independentFragments : m_independentFragments) {
delete _independentFragments;
}
m_independentFragments.clear();
}

void sketcherMinimizer::splitIntoMolecules(
sketcherMinimizerMolecule* mol, vector<sketcherMinimizerMolecule*>& mols)
void sketcherMinimizer::splitIntoMolecules(sketcherMinimizerMolecule* mol, vector<sketcherMinimizerMolecule*>& mols)
{

if (mol->_atoms.empty()) {
Expand Down
10 changes: 4 additions & 6 deletions sketcherMinimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CoordgenTemplates
class EXPORT_COORDGEN sketcherMinimizer
{

public:
public:
sketcherMinimizer(float precision = SKETCHER_STANDARD_PRECISION);
~sketcherMinimizer();

Expand Down Expand Up @@ -283,9 +283,10 @@ class EXPORT_COORDGEN sketcherMinimizer
static void loadTemplates();
static CoordgenTemplates m_templates;

private:
/*all non-terminal bonds to a metal atom are treated as if they were zero order bonds (this usually results
in a longer bond*/

private:
bool m_treatNonterminalBondsToMetalAsZOBs = true;

CoordgenFragmentBuilder m_fragmentBuilder;
Expand All @@ -302,7 +303,6 @@ class EXPORT_COORDGEN sketcherMinimizer
std::vector<sketcherMinimizerBond*> m_proximityRelations;
std::vector<sketcherMinimizerBond*> m_extraBonds;
std::vector<sketcherMinimizerMolecule*> m_molecules;

/* return the position of res, which is part of SSE, given that the first
* residue of SSE is placed at startF and consecutive residues are placed
* increment away from each other. All distances are expressed in floats,
Expand All @@ -322,7 +322,6 @@ class EXPORT_COORDGEN sketcherMinimizer

/* clear data and free memory */
void clear();

/* flag atoms that will be drawn with 90° angles (e.g. phosphate P) */
void flagCrossAtoms();

Expand Down Expand Up @@ -439,8 +438,7 @@ class EXPORT_COORDGEN sketcherMinimizer
sketcherMinimizerResidue* residue);

/* assign coordinates to residues */
void placeResidues(const std::vector<sketcherMinimizerAtom*>& atoms =
std::vector<sketcherMinimizerAtom*>(0));
void placeResidues(const std::vector<sketcherMinimizerAtom*>& atoms = std::vector<sketcherMinimizerAtom*>(0));

/* assign coordinates to residues in the context of a protein-protein
interaction diagram */
Expand Down
3 changes: 1 addition & 2 deletions sketcherMinimizerAtom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ sketcherMinimizerAtom::sketcherMinimizerAtom()
}

sketcherMinimizerRing*
sketcherMinimizerAtom::shareARing(const sketcherMinimizerAtom* atom1,
const sketcherMinimizerAtom* atom2)
sketcherMinimizerAtom::shareARing(const sketcherMinimizerAtom* atom1, const sketcherMinimizerAtom* atom2)
{
/* return a ring shared by the two atoms. return a non-macrocycle if
* possible */
Expand Down