@@ -0,0 +1,3020 @@
+/*%0A *                  BioJava development code%0A *%0A * This code may be freely distributed and modified under the%0A * terms of the GNU Lesser General Public Licence.  This should%0A * be distributed with the code.  If you do not have a copy,%0A * see:%0A *%0A *      http://www.gnu.org/copyleft/lesser.html%0A *%0A * Copyright for this code is held jointly by the individual%0A * authors.  These should be listed in @author doc comments.%0A *%0A * For more information on the BioJava project and its aims,%0A * or to join the biojava-l mailing list, visit the home page%0A * at:%0A *%0A *      http://www.biojava.org/%0A * %0A * Created on Dec 21, 2005%0A *%0A */%0Apackage org.biojava.bio.structure;%0A%0Aimport java.io.InputStream;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.biojava.bio.BioError;%0Aimport org.biojava.bio.structure.io.PDBFileParser;%0Aimport org.biojava.utils.ClassTools;%0A%0A/** A class that provides a set of standard amino acids%0A * %0A * %0A * %0A * @author Andreas Prlic%0A * @author Tamas Horvath provided the standard amino acids.%0A *   %0A *%0A */%0Apublic final class StandardAminoAcid %7B%0A    %0A    static private Map aminoAcids;%0A    %0A    public StandardAminoAcid() %7B%0A        super();%0A        %0A    %7D%0A    %0A    /**%0A     * %3Cp%3E%0A     * Initialize the static StandardAminoAcid resource.%0A     * %3C/p%3E%0A     *%0A     * %3Cp%3E%0A     * This parses the resource%0A     * %3Ccode%3Eorg/biojava/bio/structure/standardaminos.pdb%3C/code%3E%0A     * and builds a basic set of amino acids.%0A     *%3C/p%3E%0A     * @author Tamas Horvath provided the standard amino acids %0A     */%0A    static %7B%0A        aminoAcids = new HashMap();%0A    %0A        try %7B%0A            InputStream fileStream = ClassTools.getClassLoader(StandardAminoAcid.class).getResourceAsStream(%0A                    %22org/biojava/bio/structure/standardaminos.pdb%22%0A            );%0A            if (fileStream == null) %7B%0A                throw new BioError(%22Couldn't locate standardaminos.pdb.  This probably means that your biojava.jar file is corrupt or incorrectly built.%22);%0A            %7D%0A            %0A            PDBFileParser parser = new PDBFileParser();%0A            Structure s = parser.parsePDBFile(fileStream);%0A%0A       %0A            GroupIterator iter = new GroupIterator(s);%0A            while (iter.hasNext())%7B%0A                Group g = (Group) iter.next();%0A               %0A                if ( g instanceof AminoAcid)%7B%0A                    AminoAcid aa = (AminoAcid)g;%0A       %0A                    aminoAcids.put(aa.getPDBName(),aa);%0A                    aminoAcids.put(aa.getAminoType().toString(),aa);%0A                    %0A                %7D%0A            %7D%0A            %0A        %7D catch (Exception t) %7B%0A            throw new BioError( %22Unable to initialize standard aminoacids%22, t);%0A        %7D%0A    %7D%0A    %0A    /** get a standard amino acid.%0A     * %0A     * @param name the 3- or 1-letter representation of the amino acid.%0A     * @return the amino acids, or null if the name can not be matched%0A     */%0A    public static AminoAcid getAminoAcid(String name)%7B%0A        %0A        return (AminoAcid) aminoAcids.get(name);%0A    %7D%0A    %0A%7D%0A

adding a class that provides the standard amino acids