From b8ea8c6b07619bebd85b417c4858d24087d7f804 Mon Sep 17 00:00:00 2001 From: Louie Slocombe Date: Wed, 3 Sep 2025 10:20:33 -0700 Subject: [PATCH] fixed pathway printing --- v5/pathwayGenerator.h | 69 +++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/v5/pathwayGenerator.h b/v5/pathwayGenerator.h index e831de2..ff99995 100644 --- a/v5/pathwayGenerator.h +++ b/v5/pathwayGenerator.h @@ -98,26 +98,35 @@ void printOriginalGraph(ofstream &ofs) ofs << "\"EdgeColours\": ["; for (size_t i = 0; i < originalEdgeList.size(); i++) { - switch (originalMolecule.btypeS(originalEdgeList[i].a, originalEdgeList[i].c)) + int x = originalMolecule.btypeS(originalEdgeList[i].a, originalEdgeList[i].c); + if (x < 4) { - case 1: ofs << "\"single\""; - break; - case 2: ofs << "\"double\""; - break; - case 3: ofs << "\"triple\""; - break; - case 4: ofs << "quadruple"; - break; - case 5: ofs << "quintuple"; - break; - case 0: ofs << "error"; - break; + switch (x) + { + case 1: ofs << "\"single\""; + break; + case 2: ofs << "\"double\""; + break; + case 3: ofs << "\"triple\""; + break; + case 4: ofs << "\"quadruple\""; + break; + case 5: ofs << "\"quintuple\""; + break; + case 0: ofs << "error"; + break; + } + } + else + { + ofs << "\"" + to_string(x) + "\""; } if (i < originalEdgeList.size() - 1) ofs << ','; } ofs << "]\n"; } + /** * @brief Subroutine of the pathway reconstruction function * @@ -166,20 +175,28 @@ void printRemnantGraph(standardBitset mask, ofstream &ofs) { if (dual[i]) { - switch (targetMolecule.btypeS(univEdgeList[i].a, univEdgeList[i].c)) + int x = targetMolecule.btypeS(univEdgeList[i].a, univEdgeList[i].c); + if (x < 4) { - case 1: ofs << "\"single\""; - break; - case 2: ofs << "\"double\""; - break; - case 3: ofs << "\"triple\""; - break; - case 4: ofs << "quadruple"; - break; - case 5: ofs << "quintuple"; - break; - case 0: ofs << "error"; - break; + switch (x) + { + case 1: ofs << "\"single\""; + break; + case 2: ofs << "\"double\""; + break; + case 3: ofs << "\"triple\""; + break; + case 4: ofs << "\"quadruple\""; + break; + case 5: ofs << "\"quintuple\""; + break; + case 0: ofs << "error"; + break; + } + } + else + { + ofs << "\"" + to_string(x) + "\""; } if (i != msb) ofs << ','; }