Skip to content

Commit

Permalink
fixed slowdown of code in headgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed Sep 13, 2023
1 parent 3e7e691 commit 9e0b98c
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
*/
public final class Headgroup {

public static HashMap<String, LipidCategory> StringCategory = new HashMap<>();
public static HashMap<String, Integer> StringClass = new HashMap<>();
public static HashMap<Integer, String> ClassString = new HashMap<>();
public static HashSet<String> exceptionHeadgroups = new HashSet<>(Arrays.asList("Cer", "SPB"));
protected KnownFunctionalGroups knownFunctionalGroups = new KnownFunctionalGroups();
public final static HashMap<String, LipidCategory> StringCategory = new HashMap<>();
public final static HashMap<String, Integer> StringClass = new HashMap<>();
public final static HashMap<Integer, String> ClassString = new HashMap<>();
public final static HashSet<String> exceptionHeadgroups = new HashSet<>(Arrays.asList("Cer", "SPB"));
private final static KnownFunctionalGroups knownFunctionalGroups = new KnownFunctionalGroups();

private String headgroup;
private LipidCategory lipidCategory;
private int lipidClass;
private boolean useHeadgroup;
private ArrayList<HeadgroupDecorator> decorators;
private ArrayList<HeadgroupDecorator> decorators = new ArrayList<>();
private boolean spException;

public static final Map<LipidCategory, String> CategoryString = Map.ofEntries(
Expand Down Expand Up @@ -81,10 +81,8 @@ public Headgroup(String _headgroup) {
}

public Headgroup(String _headgroup, ArrayList<HeadgroupDecorator> _decorators, boolean _use_headgroup) {
decorators = new ArrayList<>();

String hg = _headgroup.toLowerCase();
if (GLYCO_TABLE.containsKey(hg)){
if (GLYCO_TABLE.containsKey(hg) && !_use_headgroup){
for (String carbohydrate : GLYCO_TABLE.get(hg)){
FunctionalGroup functional_group = null;
try {
Expand Down

0 comments on commit 9e0b98c

Please sign in to comment.