com.actelion.research.chem.phesa.BindingSiteVolume Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openchemlib Show documentation
Show all versions of openchemlib Show documentation
Open Source Chemistry Library
package com.actelion.research.chem.phesa;
import java.util.ArrayList;
import java.util.List;
import com.actelion.research.chem.Coordinates;
import com.actelion.research.chem.phesa.pharmacophore.SimplePPGaussian;
public class BindingSiteVolume {
private List ppGaussians;
private List atomicGaussians;
public BindingSiteVolume() {
ppGaussians = new ArrayList<>();
atomicGaussians = new ArrayList<>();
}
public void addPharmacophorePoint(SimplePPGaussian ppGaussian) {
ppGaussians.add(ppGaussian);
}
public void addAtomVolume(AtomicGaussian atomGaussian) {
atomicGaussians.add(atomGaussian);
}
public String encode() {
StringBuilder sb = new StringBuilder();
sb.append(Integer.toString(atomicGaussians.size()));
sb.append(" ");
atomicGaussians.forEach(e -> {
sb.append(e.encode());
sb.append(" ");
});
sb.append(Integer.toString(ppGaussians.size()));
sb.append(" ");
ppGaussians.forEach(e -> {
sb.append(e.encode());
sb.append(" ");
});
return sb.toString();
}
public static BindingSiteVolume decode(String s) {
String[] splitString = s.split(" ");
int nrOfAtomicGaussians = Integer.decode(splitString[0].trim());
int firstIndex = 1;
int lastIndex = 1+nrOfAtomicGaussians;
List atomicGaussians = new ArrayList();
List ppGaussians = new ArrayList();
for(int i=firstIndex;i receptorVol.addAtomVolume(e));
ppGaussians.forEach(e -> receptorVol.addPharmacophorePoint(e));
return receptorVol;
}
public List getPPGaussians() {
return ppGaussians;
}
public void setPPGaussians(List ppGaussians) {
this.ppGaussians = ppGaussians;
}
public List getAtomicGaussians() {
return atomicGaussians;
}
public void setAtomicGaussians(List atomicGaussians) {
this.atomicGaussians = atomicGaussians;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy