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

se.lth.immun.chem.ModifiedAminoAcid Maven / Gradle / Ivy

Go to download

Library for general purpose in silico chemistry, mainly intended for mass spectrometry proteomics computations.

There is a newer version: 1.3.3
Show newest version
package se.lth.immun.chem;

public class ModifiedAminoAcid implements IAminoAcid {

	public IAminoAcid aa;
	public IMolecule modification;
	
	public ModifiedAminoAcid(IAminoAcid aa, IMolecule modification) {
		this.aa = aa;
		this.modification = modification;
	}

	public ElementComposition getComposition() {
		return aa.getComposition().join(modification.getComposition());
	}

	@Override
	public double monoisotopicMass() {
		return aa.monoisotopicMass() + modification.monoisotopicMass();//getComposition().monoisotopicMass();
	}

	private IsotopeDistribution _dist = null;
	public IsotopeDistribution getIsotopeDistribution() {
		if (_dist == null) {
			_dist = aa.getIsotopeDistribution().copy();
			_dist.add(modification.getIsotopeDistribution());
		}
		return _dist;
	}
	
	@Override
	public String toString() {
		return aa.toString() + "(" + modification.toString() + ")";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy