Skip to content

Commit

Permalink
fixed string comparison bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed May 14, 2024
1 parent 8bea8ab commit 1a77ebf
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ private void addProstaglandin(TreeNode node){
else if (prostaglandinNumber == "2") db = new DoubleBonds(new TreeMap<>(Map.of(5, "Z", 13, "E")));
else if (prostaglandinNumber == "3") db = new DoubleBonds(new TreeMap<>(Map.of(5, "Z", 13, "E", 17, "Z")));

if (prostaglandinType == "B"){
System.out.println(prostaglandinNumber + " " + prostaglandinType);

if (prostaglandinType.equals("B")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("OH");
f1.setPosition(15);
Expand All @@ -624,7 +626,7 @@ private void addProstaglandin(TreeNode node){
HashMap<String, ArrayList<FunctionalGroup>> fg = new HashMap<>(Map.of("OH", new ArrayList<>(Arrays.asList(f1)), "cy", new ArrayList<>(Arrays.asList(cy))));
currentFa = new FattyAcid("FA", 20, db, fg, knownFunctionalGroups);
}
else if (prostaglandinType == "D"){
else if (prostaglandinType.equals("D")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("OH");
FunctionalGroup f3 = knownFunctionalGroups.get("oxo");
Expand All @@ -636,7 +638,7 @@ else if (prostaglandinType == "D"){
HashMap<String, ArrayList<FunctionalGroup>> fg = new HashMap<>(Map.of("OH", new ArrayList<>(Arrays.asList(f1)), "cy", new ArrayList<>(Arrays.asList(cy))));
currentFa = new FattyAcid("FA", 20, db, fg, knownFunctionalGroups);
}
else if (prostaglandinType == "E"){
else if (prostaglandinType.equals("E")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("oxo");
FunctionalGroup f3 = knownFunctionalGroups.get("OH");
Expand All @@ -648,7 +650,7 @@ else if (prostaglandinType == "E"){
HashMap<String, ArrayList<FunctionalGroup>> fg = new HashMap<>(Map.of("OH", new ArrayList<>(Arrays.asList(f1)), "cy", new ArrayList<>(Arrays.asList(cy))));
currentFa = new FattyAcid("FA", 20, db, fg, knownFunctionalGroups);
}
else if (prostaglandinType == "F"){
else if (prostaglandinType.equals("F")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("OH");
FunctionalGroup f3 = knownFunctionalGroups.get("OH");
Expand All @@ -660,7 +662,7 @@ else if (prostaglandinType == "F"){
HashMap<String, ArrayList<FunctionalGroup>> fg = new HashMap<>(Map.of("OH", new ArrayList<>(Arrays.asList(f1)), "cy", new ArrayList<>(Arrays.asList(cy))));
currentFa = new FattyAcid("FA", 20, db, fg, knownFunctionalGroups);
}
else if (prostaglandinType == "J"){
else if (prostaglandinType.equals("J")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("oxo");
f1.setPosition(15);
Expand All @@ -670,7 +672,7 @@ else if (prostaglandinType == "J"){
HashMap<String, ArrayList<FunctionalGroup>> fg = new HashMap<>(Map.of("OH", new ArrayList<>(Arrays.asList(f1)), "cy", new ArrayList<>(Arrays.asList(cy))));
currentFa = new FattyAcid("FA", 20, db, fg, knownFunctionalGroups);
}
else if (prostaglandinType == "K"){
else if (prostaglandinType.equals("K")){
FunctionalGroup f1 = knownFunctionalGroups.get("OH");
FunctionalGroup f2 = knownFunctionalGroups.get("oxo");
FunctionalGroup f3 = knownFunctionalGroups.get("oxo");
Expand All @@ -692,5 +694,6 @@ else if (prostaglandinType == "K"){
mediatorSuffix = true;
prostaglandinType = "";
prostaglandinNumber = "";

}
}

0 comments on commit 1a77ebf

Please sign in to comment.