Skip to content

Commit

Permalink
update graph files
Browse files Browse the repository at this point in the history
Signed-off-by: conradhuebler <[email protected]>
  • Loading branch information
conradhuebler committed Jul 17, 2023
1 parent 7cc945f commit 76b26de
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
39 changes: 30 additions & 9 deletions src/capabilities/confscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ void ConfScan::start()
m_sLI[0] = 1;
m_sLH[0] = 1;
m_collective_content = "edge [color=green];\n";
for (auto node : m_nodes)
m_collective_content += node.second;
m_nodes.clear();
m_collective_content += m_first_content + "\n";

std::ofstream parameters_file;
Expand Down Expand Up @@ -673,14 +676,18 @@ void ConfScan::start()
}
std::ofstream parameters_success;
parameters_success.open(m_success_file, std::ios_base::app);
parameters_success << "# " << run << " run" << std::endl;
parameters_success << std::endl
<< "# " << run << " run" << std::endl;

Reorder(dLE, dLI, dLH, false);
PrintStatus("Result Reorder pass:");
WriteDotFile(m_result_basename + ".reorder." + std::to_string(run + 1) + ".dot", m_second_content);
fmt::print("\nReorder Pass finished after {} seconds!\n", timer.Elapsed() / 1000.0);
timer.Reset();
m_collective_content += "edge [color=red];\n";
for (auto node : m_nodes)
m_collective_content += node.second;
m_nodes.clear();
m_collective_content += m_second_content + "\n";
m_second_content.clear();
if (m_analyse) {
Expand Down Expand Up @@ -728,12 +735,20 @@ void ConfScan::start()
result_file.close();
}
m_exclude_list.clear();
std::ofstream parameters_success;
parameters_success.open(m_success_file, std::ios_base::app);
parameters_success << std::endl
<< "# reuse run" << std::endl;

Reorder(-1, -1, -1, true, m_reset);
PrintStatus("Result reuse pass:");
WriteDotFile(m_result_basename + ".reuse.dot", m_second_content);
fmt::print("\nReuse Pass finished after {} seconds!\n", timer.Elapsed() / 1000.0);
timer.Reset();
m_collective_content += "edge [color=blue];\n";
for (auto node : m_nodes)
m_collective_content += node.second;
m_nodes.clear();
m_collective_content += m_second_content + "\n";
}
}
Expand Down Expand Up @@ -870,10 +885,12 @@ void ConfScan::CheckOnly(double sLE, double sLI, double sLH)
writeStatisticFile(t->Reference(), mol1, t->RMSD());

if (laststring.compare("") != 0 && laststring.compare(t->Reference()->Name()) != 0)
m_first_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted];\n";

m_first_content += "\"" + t->Reference()->Name() + "\" [shape=box, label=\"" + t->Reference()->Name() + "\"];\n";
m_first_content += "\"" + mol1->Name() + "\" [label=\"" + mol1->Name() + "\"];\n";
m_first_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted,arrowhead=onormal];\n";
std::string node = "\"" + t->Reference()->Name() + "\" [shape=box, label=\"" + t->Reference()->Name() + "\"];\n";
node += "\"" + mol1->Name() + "\" [label=\"" + mol1->Name() + "\"];\n";
m_nodes.insert(std::pair<double, std::string>(t->Reference()->Energy(), node));
// m_first_content +=
// m_first_content +=
m_first_content += "\"" + t->Reference()->Name() + "\" -> \"" + mol1->Name() + "\" [style=bold,label=" + std::to_string(t->RMSD()) + "];\n";
laststring = t->Reference()->Name();

Expand Down Expand Up @@ -1118,10 +1135,14 @@ void ConfScan::Reorder(double dLE, double dLI, double dLH, bool reuse_only, bool
rules.push_back(t->ReorderRule());

if (laststring.compare("") != 0 && laststring.compare(t->Reference()->Name()) != 0)
m_second_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted];\n";
m_second_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted,arrowhead=onormal];\n";

std::string node = "\"" + t->Reference()->Name() + "\" [shape=box, label=\"" + t->Reference()->Name() + "\"];\n";
node += "\"" + mol1->Name() + "\" [label=\"" + mol1->Name() + "\"];\n";
m_nodes.insert(std::pair<double, std::string>(t->Reference()->Energy(), node));

m_second_content += "\"" + t->Reference()->Name() + "\" [shape=box, label=\"" + t->Reference()->Name() + "\"];\n";
m_second_content += "\"" + mol1->Name() + "\" [label=\"" + mol1->Name() + "\"];\n";
// m_second_content += "\"" + t->Reference()->Name() + "\" [shape=box, label=\"" + t->Reference()->Name() + "\"];\n";
// m_second_content += "\"" + mol1->Name() + "\" [label=\"" + mol1->Name() + "\"];\n";
m_second_content += "\"" + t->Reference()->Name() + "\" -> \"" + mol1->Name() + "\" [style=bold,label=" + std::to_string(t->RMSD()) + "];\n";
laststring = t->Reference()->Name();
auto i = t->getDNNInput();
Expand All @@ -1148,7 +1169,7 @@ void ConfScan::Reorder(double dLE, double dLI, double dLH, bool reuse_only, bool
writeStatisticFile(t->Reference(), mol1, driver.RMSD(), true, { 0, 0 });

if (laststring.compare("") != 0 && laststring.compare(t->Reference()->Name()) != 0)
m_second_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted];\n";
m_second_content += "\"" + laststring + "\" -> \"" + t->Reference()->Name() + "\"[style=dotted,arrowhead=onormal];\n";

m_second_content += "\"" + t->Reference()->Name() + "\" -> \"" + mol1->Name() + "\";\n";
m_second_content += "\"" + mol1->Name() + "\" [shape=box, style=filled,color=\".7 .3 1.0\"];\n";
Expand Down
9 changes: 5 additions & 4 deletions src/capabilities/confscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class ConfScan : public CurcumaMethod {
/*! \brief Check, if Reordering is forced */
inline bool PreventReorder() const { return m_prevent_reorder; }

inline std::string NamePattern(int index) const { return "input_" + std::to_string(index); }
inline std::string NamePattern(int index) const { return "#" + std::to_string(index); }

std::vector<Molecule*> Result() const { return m_result; }
// std::vector<Molecule*> Failed() const { return m_failed; }
Expand Down Expand Up @@ -317,7 +317,7 @@ class ConfScan : public CurcumaMethod {
int m_rejected = 0, m_accepted = 0, m_reordered = 0, m_reordered_worked = 0, m_reordered_failed_completely = 0, m_reordered_reused = 0, m_skip = 0, m_skiped = 0, m_duplicated = 0, m_rejected_directly = 0, m_molalign_count = 0, m_molalign_success = 0;

std::string m_filename, m_accepted_filename, m_1st_filename, m_2nd_filename, m_3rd_filename, m_rejected_filename, m_result_basename, m_statistic_filename, m_prev_accepted, m_joined_filename, m_threshold_filename, m_current_filename, m_param_file, m_skip_file, m_perform_file, m_success_file, m_limit_file;
std::map<double, int> m_ordered_list;
std::multimap<double, int> m_ordered_list;

std::vector<std::pair<std::string, Molecule*>> m_molecules;
double m_rmsd_threshold = 1.0, m_print_rmsd = 0, m_nearly_missed = 0.8, m_energy_cutoff = -1, m_reference_last_energy = 0, m_target_last_energy = 0, m_lowest_energy = 1, m_current_energy = 0;
Expand All @@ -340,8 +340,9 @@ class ConfScan : public CurcumaMethod {
std::string m_rmsd_element_templates;
std::string m_method = "";
std::string m_molalign = "molalign";
std::map<double, double> m_listH, m_listI, m_listE;
std::map<double, std::vector<double>> m_listThresh;
std::multimap<double, double> m_listH, m_listI, m_listE;
std::multimap<double, std::vector<double>> m_listThresh;
std::map<double, std::string> m_nodes;
std::vector<std::vector<double>> m_list_skipped, m_list_performed;
std::vector<double> m_sLE = { 1.0 }, m_sLI = { 1.0 }, m_sLH = { 1.0 };
double m_domolalign = -1;
Expand Down

0 comments on commit 76b26de

Please sign in to comment.