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

com.hfg.bio.proteinproperty.Hydrophobicity Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
package com.hfg.bio.proteinproperty;


import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.hfg.bio.AminoAcid;
import com.hfg.bio.seq.AminoAcidComposition;
import com.hfg.bio.seq.Protein;
import com.hfg.exception.ProgrammingException;
import com.hfg.util.StringUtil;
import com.hfg.util.collection.OrderedMap;

//------------------------------------------------------------------------------
/**
 Simple container for sequence mapping stats.
 
See http://en.wikipedia.org/wiki/Hydrophobicity_scales
See http://web.expasy.org/protscale/
@author J. Alex Taylor, hairyfatguy.com
*/ //------------------------------------------------------------------------------ // com.hfg XML/HTML Coding Library // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com // [email protected] //------------------------------------------------------------------------------ // TODO: Move data to gzipped XML resource files? public class Hydrophobicity extends SimpleProteinProperty implements WindowBasedProteinProperty { private Map mAAMap; private static Map sUniqueMap = new OrderedMap<>(); private static String KYTE_DOOLITTLE = "Kyte Doolittle"; private static String BULL_BREESE = "Bull & Breese"; private static String EISENBERG = "Eisenberg"; private static String ENGLEMAN = "Engleman"; private static String RAGONE = "Ragone"; private static String HOPP_WOODS = "Hopp Woods"; private static String CHOTHIA = "Chothia"; public static final Hydrophobicity KyteDoolittle = new Hydrophobicity(KYTE_DOOLITTLE, "Hydropathicity", "Kyte J, Doolittle RF (May 1982). \"A simple method for displaying the hydropathic character of a protein\". J. Mol. Biol. 157 (1): 105-132"); public static final Hydrophobicity BullBreese = new Hydrophobicity(BULL_BREESE, "Hydrophobicity (free energy of transfer to surface in kcal/mole)", "Bull H.B., Breese K (1974). Arch. Biochem. Biophys. 161: 665-670."); public static final Hydrophobicity Eisenberg = new Hydrophobicity(EISENBERG, "Normalized consensus hydrophobicity scale", "Eisenberg D (July 1984). \"Three-dimensional structure of membrane and surface proteins\". Ann. Rev. Biochem. 53: 595-623."); public static final Hydrophobicity Engleman = new Hydrophobicity(ENGLEMAN, "Identifying nonpolar transbilayer helices", "Engleman DM, Steitz TA, Goldman A (1986). \"Identifying nonpolar transbilayer helices in amino acid sequences of menbrane proteins\". Ann. Rev. Biophys. Chem. 15: 321-353"); public static final Hydrophobicity Ragone = new Hydrophobicity(RAGONE, "Flexibility", "Ragone R, Facchiano F, Facchiano A, Facchiano AM, Colonna G (1989). \"Flexibility plot of proteins\". Prot. Engineering 2 (7): 497-504"); public static final Hydrophobicity HoppWoods = new Hydrophobicity(HOPP_WOODS, "Hydrophilicity", "Hopp TP, Woods KR (1981). Proc. Natl. Acad. Sci. U.S.A. 78: 3824-3828."); public static final Hydrophobicity Chothia = new Hydrophobicity(CHOTHIA, "Proportion of residues 95% buried (in 12 proteins).", "Chothia C (1976). \"The nature of the accessible and buried surfaces in proteins\". J. Mol. Biol. 105: 1-14"); //########################################################################### // CONSTRUCTORS //########################################################################### //--------------------------------------------------------------------------- protected Hydrophobicity(String inName, String inDescription, String inReference) { super(inName); setDescription(inDescription); setReference(inReference); sUniqueMap.put(inName, this); } //########################################################################### // PUBLIC METHODS //########################################################################### //--------------------------------------------------------------------------- public static Collection values() { return sUniqueMap != null ? sUniqueMap.values() : null; } //-------------------------------------------------------------------------- public String getType() { return "Hydrophobicity"; } //--------------------------------------------------------------------------- public Float calculate(Protein inProtein) { return calculate(inProtein, null); } //--------------------------------------------------------------------------- public Float calculate(Protein inProtein, SimpleProteinPropertyCalcSettings inSettings) { Map aaMap = getMap(); float total = 0.0f; int totalNumAAs = 0; AminoAcidComposition aaComposition = inProtein.getAminoAcidComposition(); for (AminoAcid aa : aaComposition.keySet()) { Float value = aaMap.get(aa); if (value != null) { int aaCount = aaComposition.get(aa); totalNumAAs += aaCount; total += (value * aaCount); } } // Avoid divide by zero float value = (float) (totalNumAAs > 0 ? total / (float) totalNumAAs : 0.0); // Round to three digits value = (float) (Math.round(value * 1000)/1000.0); return value; } //--------------------------------------------------------------------------- private Map getMap() { if (null == mAAMap) { mAAMap = new HashMap(26); if (name().equalsIgnoreCase(KYTE_DOOLITTLE)) { mAAMap.put(AminoAcid.ALANINE, 1.8f); mAAMap.put(AminoAcid.CYSTEINE, 2.5f); mAAMap.put(AminoAcid.ASPARTIC_ACID, -3.5f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, -3.5f); mAAMap.put(AminoAcid.PHENYLALANINE, 2.7f); mAAMap.put(AminoAcid.GLYCINE, -0.4f); mAAMap.put(AminoAcid.HISTIDINE, -3.2f); mAAMap.put(AminoAcid.ISOLEUCINE, 4.5f); mAAMap.put(AminoAcid.LYSINE, -3.9f); mAAMap.put(AminoAcid.LEUCINE, 3.7f); mAAMap.put(AminoAcid.METHIONINE, 1.9f); mAAMap.put(AminoAcid.ASPARAGINE, -3.5f); mAAMap.put(AminoAcid.PROLINE, -1.6f); mAAMap.put(AminoAcid.GLUTAMINE, -3.5f); mAAMap.put(AminoAcid.ARGININE, -4.5f); mAAMap.put(AminoAcid.SERINE, -0.9f); mAAMap.put(AminoAcid.THREONIE, -0.7f); mAAMap.put(AminoAcid.VALINE, 4.2f); mAAMap.put(AminoAcid.TRYPTOPHAN, -0.9f); mAAMap.put(AminoAcid.TYROSINE, -1.3f); } else if (name().equalsIgnoreCase(CHOTHIA)) { mAAMap.put(AminoAcid.ALANINE, 0.38f); mAAMap.put(AminoAcid.CYSTEINE, 0.50f); mAAMap.put(AminoAcid.ASPARTIC_ACID, 0.15f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, 0.18f); mAAMap.put(AminoAcid.PHENYLALANINE, 0.50f); mAAMap.put(AminoAcid.GLYCINE, 0.36f); mAAMap.put(AminoAcid.HISTIDINE, 0.17f); mAAMap.put(AminoAcid.ISOLEUCINE, 0.60f); mAAMap.put(AminoAcid.LYSINE, 0.03f); mAAMap.put(AminoAcid.LEUCINE, 0.45f); mAAMap.put(AminoAcid.METHIONINE, 0.40f); mAAMap.put(AminoAcid.ASPARAGINE, 0.12f); mAAMap.put(AminoAcid.PROLINE, 0.18f); mAAMap.put(AminoAcid.GLUTAMINE, 0.07f); mAAMap.put(AminoAcid.ARGININE, 0.01f); mAAMap.put(AminoAcid.SERINE, 0.22f); mAAMap.put(AminoAcid.THREONIE, 0.23f); mAAMap.put(AminoAcid.VALINE, 0.54f); mAAMap.put(AminoAcid.TRYPTOPHAN, 0.27f); mAAMap.put(AminoAcid.TYROSINE, 0.15f); } else if (name().equalsIgnoreCase(ENGLEMAN)) { mAAMap.put(AminoAcid.ALANINE, 1.6f); mAAMap.put(AminoAcid.CYSTEINE, 2.0f); mAAMap.put(AminoAcid.ASPARTIC_ACID, -9.2f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, -8.2f); mAAMap.put(AminoAcid.PHENYLALANINE, 3.7f); mAAMap.put(AminoAcid.GLYCINE, 1.0f); mAAMap.put(AminoAcid.HISTIDINE, -3.0f); mAAMap.put(AminoAcid.ISOLEUCINE, 3.1f); mAAMap.put(AminoAcid.LYSINE, -8.8f); mAAMap.put(AminoAcid.LEUCINE, 2.8f); mAAMap.put(AminoAcid.METHIONINE, 3.4f); mAAMap.put(AminoAcid.ASPARAGINE, -4.8f); mAAMap.put(AminoAcid.PROLINE, -0.2f); mAAMap.put(AminoAcid.GLUTAMINE, -4.1f); mAAMap.put(AminoAcid.ARGININE, 12.3f); mAAMap.put(AminoAcid.SERINE, 0.6f); mAAMap.put(AminoAcid.THREONIE, 1.2f); mAAMap.put(AminoAcid.VALINE, 2.6f); mAAMap.put(AminoAcid.TRYPTOPHAN, 1.9f); mAAMap.put(AminoAcid.TYROSINE, -0.7f); } else if (name().equalsIgnoreCase(EISENBERG)) { mAAMap.put(AminoAcid.ALANINE, 0.62f); mAAMap.put(AminoAcid.CYSTEINE, 0.29f); mAAMap.put(AminoAcid.ASPARTIC_ACID, -0.90f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, -0.74f); mAAMap.put(AminoAcid.PHENYLALANINE, 1.19f); mAAMap.put(AminoAcid.GLYCINE, 0.48f); mAAMap.put(AminoAcid.HISTIDINE, -0.40f); mAAMap.put(AminoAcid.ISOLEUCINE, 1.38f); mAAMap.put(AminoAcid.LYSINE, -1.50f); mAAMap.put(AminoAcid.LEUCINE, 1.06f); mAAMap.put(AminoAcid.METHIONINE, 0.64f); mAAMap.put(AminoAcid.ASPARAGINE, -0.78f); mAAMap.put(AminoAcid.PROLINE, 0.12f); mAAMap.put(AminoAcid.GLUTAMINE, -0.85f); mAAMap.put(AminoAcid.ARGININE, -2.53f); mAAMap.put(AminoAcid.SERINE, -0.18f); mAAMap.put(AminoAcid.THREONIE, -0.05f); mAAMap.put(AminoAcid.VALINE, 1.08f); mAAMap.put(AminoAcid.TRYPTOPHAN, 0.81f); mAAMap.put(AminoAcid.TYROSINE, 0.26f); } else if (name().equalsIgnoreCase(RAGONE)) { mAAMap.put(AminoAcid.ALANINE, -0.91f); mAAMap.put(AminoAcid.CYSTEINE, -0.17f); mAAMap.put(AminoAcid.ASPARTIC_ACID, -0.68f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, -0.68f); mAAMap.put(AminoAcid.PHENYLALANINE, 1.37f); mAAMap.put(AminoAcid.GLYCINE, -1.40f); mAAMap.put(AminoAcid.HISTIDINE, 0.25f); mAAMap.put(AminoAcid.ISOLEUCINE, 1.09f); mAAMap.put(AminoAcid.LYSINE, -0.13f); mAAMap.put(AminoAcid.LEUCINE, 0.89f); mAAMap.put(AminoAcid.METHIONINE, 0.83f); mAAMap.put(AminoAcid.ASPARAGINE, -0.42f); mAAMap.put(AminoAcid.PROLINE, -0.52f); mAAMap.put(AminoAcid.GLUTAMINE, 0.06f); mAAMap.put(AminoAcid.ARGININE, 0.71f); mAAMap.put(AminoAcid.SERINE, -1.01f); mAAMap.put(AminoAcid.THREONIE, -0.58f); mAAMap.put(AminoAcid.VALINE, 0.52f); mAAMap.put(AminoAcid.TRYPTOPHAN, 2.00f); mAAMap.put(AminoAcid.TYROSINE, 1.21f); } else if (name().equalsIgnoreCase(HOPP_WOODS)) { mAAMap.put(AminoAcid.ALANINE, 0.5f); mAAMap.put(AminoAcid.CYSTEINE, 1.0f); mAAMap.put(AminoAcid.ASPARTIC_ACID, -3.0f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, -3.0f); mAAMap.put(AminoAcid.PHENYLALANINE, 2.5f); mAAMap.put(AminoAcid.GLYCINE, 0.0f); mAAMap.put(AminoAcid.HISTIDINE, 0.5f); mAAMap.put(AminoAcid.ISOLEUCINE, 1.8f); mAAMap.put(AminoAcid.LYSINE, -3.0f); mAAMap.put(AminoAcid.LEUCINE, 1.8f); mAAMap.put(AminoAcid.METHIONINE, 1.3f); mAAMap.put(AminoAcid.ASPARAGINE, -0.2f); mAAMap.put(AminoAcid.PROLINE, 0.0f); mAAMap.put(AminoAcid.GLUTAMINE, -0.2f); mAAMap.put(AminoAcid.ARGININE, -3.0f); mAAMap.put(AminoAcid.SERINE, -0.3f); mAAMap.put(AminoAcid.THREONIE, -0.4f); mAAMap.put(AminoAcid.VALINE, 1.5f); mAAMap.put(AminoAcid.TRYPTOPHAN, 3.4f); mAAMap.put(AminoAcid.TYROSINE, 2.3f); } else if (name().equalsIgnoreCase(BULL_BREESE)) { mAAMap.put(AminoAcid.ALANINE, 0.61f); mAAMap.put(AminoAcid.CYSTEINE, 0.36f); mAAMap.put(AminoAcid.ASPARTIC_ACID, 0.61f); mAAMap.put(AminoAcid.GLUTAMIC_ACID, 0.51f); mAAMap.put(AminoAcid.PHENYLALANINE, -1.52f); mAAMap.put(AminoAcid.GLYCINE, 0.81f); mAAMap.put(AminoAcid.HISTIDINE, 0.69f); mAAMap.put(AminoAcid.ISOLEUCINE, -1.45f); mAAMap.put(AminoAcid.LYSINE, 0.46f); mAAMap.put(AminoAcid.LEUCINE, -1.65f); mAAMap.put(AminoAcid.METHIONINE, -0.66f); mAAMap.put(AminoAcid.ASPARAGINE, 0.89f); mAAMap.put(AminoAcid.PROLINE, -0.17f); mAAMap.put(AminoAcid.GLUTAMINE, 0.97f); mAAMap.put(AminoAcid.ARGININE, 0.69f); mAAMap.put(AminoAcid.SERINE, 0.42f); mAAMap.put(AminoAcid.THREONIE, 0.29f); mAAMap.put(AminoAcid.VALINE, -0.75f); mAAMap.put(AminoAcid.TRYPTOPHAN, -1.20f); mAAMap.put(AminoAcid.TYROSINE, -1.43f); } else { throw new ProgrammingException("Residue values have not been specified for " + StringUtil.singleQuote(name()) + "!"); } } return mAAMap; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy