Skip to content

Commit

Permalink
fixed omega-linoleoyloxy-Cer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed Mar 17, 2022
1 parent 75ca6eb commit a872e2c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public FattyAcid(String _name, KnownFunctionalGroups knownFunctionalGroups) {
this(_name, 0, null, null, LipidFaBondType.ESTER, 0, knownFunctionalGroups);
}

public FattyAcid(String _name, int _num_carbon, DoubleBonds _double_bonds) {
this(_name, _num_carbon, _double_bonds, null, LipidFaBondType.ESTER, 0, null);
}

public FattyAcid(String _name, int _num_carbon, DoubleBonds _double_bonds, KnownFunctionalGroups knownFunctionalGroups) {
this(_name, _num_carbon, _double_bonds, null, LipidFaBondType.ESTER, 0, knownFunctionalGroups);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Map;
import static java.util.Map.entry;
import java.util.Set;
import org.lifstools.jgoslin.domain.DoubleBonds;

/**
* Event handler implementation for the {@link LipidMapsParser}.
Expand Down Expand Up @@ -396,6 +397,20 @@ private void buildLipid(TreeNode node) {
if (lcb != null) {
faList.add(0, lcb);
}

if (addOmegaLinoleoyloxyCer){
if (faList.size() != 2){
throw new RuntimeException("omega-linoleoyloxy-Cer with a different combination to one long chain base and one fatty acyl chain unknown");
}
Map<String, ArrayList<FunctionalGroup>> fgroups = faList.get(faList.size() - 1).getFunctionalGroupsInternal();
if (!fgroups.containsKey("acyl")) fgroups.put("acyl", new ArrayList<>());

DoubleBonds db = new DoubleBonds(2);
db.getDoubleBondPositions().put(9, "Z");
db.getDoubleBondPositions().put(12, "Z");
faList.get(faList.size() - 1).getFunctionalGroupsInternal().get("acyl").add(new FattyAcid("FA", 18, db));
headGroup = "Cer";
}

Headgroup headgroup = prepareHeadgroupAndChecks();
content = new LipidAdduct(assembleLipid(headgroup), adduct);
Expand Down

0 comments on commit a872e2c

Please sign in to comment.