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

com.hfg.bio.StandardAAGroupingScheme Maven / Gradle / Ivy

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



import com.hfg.setting.SettingXML;
import com.hfg.xml.XMLTag;
import com.hfg.xml.XMLTaggable;

import java.awt.Color;

//------------------------------------------------------------------------------
/**
 Standard grouping of amino acids.
 
  • Basic: lysine, arginine, histidine
  • Acidic: aspartic acid, glutamic acid
  • Uncharged Polar: asparagine, glutamine, serine, threonine, tyrosine
  • Nonpolar: glycine, alanine, valine, leucine, isoleucine, proline, phenylalanine, methionine, tryptophan, cysteine
@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] //------------------------------------------------------------------------------ public class StandardAAGroupingScheme extends AAGroupingSchemeImpl implements XMLTaggable { private static StandardAAGroupingScheme sInstance; //########################################################################## // CONSTRUCTORS //########################################################################## //-------------------------------------------------------------------------- private StandardAAGroupingScheme() { super("Standard"); add(new AAGroup("Acidic", 'A').setColor(Color.RED) .add(AminoAcid.ASPARTIC_ACID) .add(AminoAcid.GLUTAMIC_ACID)); add(new AAGroup("Basic", 'B').setColor(Color.BLUE) .add(AminoAcid.LYSINE) .add(AminoAcid.ARGININE) .add(AminoAcid.HISTIDINE)); add(new AAGroup("Uncharged Polar", 'U').setColor(Color.ORANGE) .add(AminoAcid.ASPARAGINE) .add(AminoAcid.GLUTAMINE) .add(AminoAcid.SERINE) .add(AminoAcid.THREONIE) .add(AminoAcid.TYROSINE)); add(new AAGroup("Nonpolar", 'N').setColor(Color.GREEN) .add(AminoAcid.GLYCINE) .add(AminoAcid.ALANINE) .add(AminoAcid.VALINE) .add(AminoAcid.LEUCINE) .add(AminoAcid.ISOLEUCINE) .add(AminoAcid.PROLINE) .add(AminoAcid.PHENYLALANINE) .add(AminoAcid.METHIONINE) .add(AminoAcid.TRYPTOPHAN) .add(AminoAcid.CYSTEINE)); add(new AAGroup("Deletion", 'D').setColor(Color.BLACK) .add(AminoAcid.STOP) .add(AminoAcid.UNDEFINED)); } //########################################################################## // PUBLIC METHODS //########################################################################## //-------------------------------------------------------------------------- public static synchronized StandardAAGroupingScheme getInstance() { if (null == sInstance) { sInstance = new StandardAAGroupingScheme(); } return sInstance; } //-------------------------------------------------------------------------- public XMLTag toXMLTag() { XMLTag tag = new XMLTag(HfgBioXML.AA_GROUPING_SCHEME_TAG); tag.setAttribute(SettingXML.CLASS_ATT, getClass().getName()); tag.setAttribute(SettingXML.INSTANCE_ATT, "true"); return tag; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy