All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.actelion.research.chem.phesa.BindingSiteVolume Maven / Gradle / Ivy

There is a newer version: 2024.12.1
Show newest version
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