001package com.hfg.bio.seq.format.feature.uniprot; 002 003 004 005import java.util.Collection; 006import java.util.HashMap; 007import java.util.Map; 008 009import com.hfg.bio.seq.format.GenBank; 010import com.hfg.bio.seq.format.feature.FeatureKey; 011import com.hfg.util.StringUtil; 012 013//------------------------------------------------------------------------------ 014/** 015 UniProt feature table keys for flat-file records. 016 <p> 017 Values from <a href='http://web.expasy.org/docs/userman.html#FT_line'>http://web.expasy.org/docs/userman.html#FT_line</a> 018 </p> 019 @author J. Alex Taylor, hairyfatguy.com 020 */ 021//------------------------------------------------------------------------------ 022// com.hfg Library 023// 024// This library is free software; you can redistribute it and/or 025// modify it under the terms of the GNU Lesser General Public 026// License as published by the Free Software Foundation; either 027// version 2.1 of the License, or (at your option) any later version. 028// 029// This library is distributed in the hope that it will be useful, 030// but WITHOUT ANY WARRANTY; without even the implied warranty of 031// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 032// Lesser General Public License for more details. 033// 034// You should have received a copy of the GNU Lesser General Public 035// License along with this library; if not, write to the Free Software 036// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 037// 038// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 039// jataylor@hairyfatguy.com 040//------------------------------------------------------------------------------ 041 042public class UniProtFeatureKey implements FeatureKey 043{ 044 private String mName; 045 private String mDescription; 046 047 private static Map<String, UniProtFeatureKey> sUniqueMap = new HashMap<>(); 048 049 public static final UniProtFeatureKey ACT_SITE = new UniProtFeatureKey("ACT_SITE") 050 .setDescription("Amino acid(s) involved in the activity of an enzyme"); 051 052 public static final UniProtFeatureKey BINDING = new UniProtFeatureKey("BINDING") 053 .setDescription("Binding site for any chemical group (co-enzyme, prosthetic group, etc.)"); 054 055 public static final UniProtFeatureKey CA_BIND = new UniProtFeatureKey("CA_BIND") 056 .setDescription("Extent of a calcium-binding region"); 057 058 public static final UniProtFeatureKey CARBOHYD = new UniProtFeatureKey("CARBOHYD") 059 .setDescription("Glycosylation site"); 060 061 public static final UniProtFeatureKey CHAIN = new UniProtFeatureKey("CHAIN") 062 .setDescription("Extent of a polypeptide chain in the mature protein"); 063 064 public static final UniProtFeatureKey COILED = new UniProtFeatureKey("COILED") 065 .setDescription("Extent of a coiled-coil region"); 066 067 public static final UniProtFeatureKey COMPBIAS = new UniProtFeatureKey("COMPBIAS") 068 .setDescription("Extent of a compositionally biased region"); 069 070 public static final UniProtFeatureKey CONFLICT = new UniProtFeatureKey("CONFLICT") 071 .setDescription("Different sources report differing sequences"); 072 073 public static final UniProtFeatureKey CROSSLNK = new UniProtFeatureKey("CROSSLNK") 074 .setDescription("Posttranslationally formed amino acid bonds"); 075 076 public static final UniProtFeatureKey DISULFID = new UniProtFeatureKey("DISULFID") 077 .setDescription("Disulfide bond"); 078 079 public static final UniProtFeatureKey DNA_BIND = new UniProtFeatureKey("DNA_BIND") 080 .setDescription("Extent of a DNA-binding region"); 081 082 public static final UniProtFeatureKey DOMAIN = new UniProtFeatureKey("DOMAIN") 083 .setDescription("Extent of a domain, which is defined as a specific combination of secondary structures organized into a characteristic three-dimensional structure or fold"); 084 085 public static final UniProtFeatureKey HELIX = new UniProtFeatureKey("HELIX") 086 .setDescription("Secondary structure: alpha helix"); 087 088 public static final UniProtFeatureKey INIT_MET = new UniProtFeatureKey("INIT_MET") 089 .setDescription("Initiator methionine"); 090 091 public static final UniProtFeatureKey INTRAMEM = new UniProtFeatureKey("INTRAMEM") 092 .setDescription("Extent of a region located in a membrane without crossing it"); 093 094 public static final UniProtFeatureKey LIPID = new UniProtFeatureKey("LIPID") 095 .setDescription("Covalent binding of a lipid moiety"); 096 097 public static final UniProtFeatureKey METAL = new UniProtFeatureKey("METAL") 098 .setDescription("Binding site for a metal ion"); 099 100 public static final UniProtFeatureKey MOD_RES = new UniProtFeatureKey("MOD_RES") 101 .setDescription("Posttranslational modification of a residue"); 102 103 public static final UniProtFeatureKey MOTIF = new UniProtFeatureKey("MOTIF") 104 .setDescription("Short (up to 20 amino acids) sequence motif of biological interest"); 105 106 public static final UniProtFeatureKey MUTAGEN = new UniProtFeatureKey("MUTAGEN") 107 .setDescription("Site which has been experimentally altered by mutagenesis"); 108 109 public static final UniProtFeatureKey NON_CONS = new UniProtFeatureKey("NON_CONS") 110 .setDescription("Non-consecutive residues"); 111 112 public static final UniProtFeatureKey NON_STD = new UniProtFeatureKey("NON_STD") 113 .setDescription("Non-standard amino acid"); 114 115 public static final UniProtFeatureKey NON_TER = new UniProtFeatureKey("NON_TER") 116 .setDescription("The residue at an extremity of the sequence is not the terminal residue"); 117 118 public static final UniProtFeatureKey NP_BIND = new UniProtFeatureKey("NP_BIND") 119 .setDescription("Extent of a nucleotide phosphate-binding region"); 120 121 public static final UniProtFeatureKey PEPTIDE = new UniProtFeatureKey("PEPTIDE") 122 .setDescription("Extent of a released active peptide"); 123 124 public static final UniProtFeatureKey PROPEP = new UniProtFeatureKey("PROPEP") 125 .setDescription("Extent of a propeptide"); 126 127 public static final UniProtFeatureKey REGION = new UniProtFeatureKey("REGION") 128 .setDescription("Extent of a region of interest in the sequence"); 129 130 public static final UniProtFeatureKey REPEAT = new UniProtFeatureKey("REPEAT") 131 .setDescription("Extent of an internal sequence repetition"); 132 133 public static final UniProtFeatureKey SIGNAL = new UniProtFeatureKey("SIGNAL") 134 .setDescription("Extent of a signal sequence (prepeptide)"); 135 136 public static final UniProtFeatureKey SITE = new UniProtFeatureKey("SITE") 137 .setDescription("Any interesting single amino-acid site on the sequence, that is not defined by another feature key. It can also apply to an amino acid bond which is represented by the positions of the two flanking amino acids"); 138 139 public static final UniProtFeatureKey STRAND = new UniProtFeatureKey("STRAND") 140 .setDescription("Secondary structure: beta strand"); 141 142 public static final UniProtFeatureKey TOPO_DOM = new UniProtFeatureKey("TOPO_DOM") 143 .setDescription("Topological domain"); 144 145 public static final UniProtFeatureKey TRANSIT = new UniProtFeatureKey("TRANSIT") 146 .setDescription("Extent of a transit peptide (mitochondrion, chloroplast, thylakoid, cyanelle, peroxisome etc.)"); 147 148 public static final UniProtFeatureKey TRANSMEM = new UniProtFeatureKey("TRANSMEM") 149 .setDescription("Extent of a transmembrane region"); 150 151 public static final UniProtFeatureKey TURN = new UniProtFeatureKey("TURN") 152 .setDescription("Secondary structure: turn"); 153 154 public static final UniProtFeatureKey UNSURE = new UniProtFeatureKey("UNSURE") 155 .setDescription("Uncertainties in the sequence"); 156 157 public static final UniProtFeatureKey VAR_SEQ = new UniProtFeatureKey("VAR_SEQ") 158 .setDescription("Description of sequence variants produced by alternative splicing, alternative promoter usage, alternative initiation and ribosomal frameshifting"); 159 160 public static final UniProtFeatureKey VARIANT = new UniProtFeatureKey("VARIANT") 161 .setDescription("Authors report that sequence variants exist"); 162 163 public static final UniProtFeatureKey ZN_FING = new UniProtFeatureKey("ZN_FING") 164 .setDescription("Extent of a zinc finger region"); 165 166 //########################################################################### 167 // CONSTRUCTORS 168 //########################################################################### 169 170 //--------------------------------------------------------------------------- 171 private UniProtFeatureKey(String inName) 172 { 173 mName = inName; 174 sUniqueMap.put(mName, this); 175 } 176 177 //########################################################################### 178 // PUBLIC METHODS 179 //########################################################################### 180 181 //--------------------------------------------------------------------------- 182 public static UniProtFeatureKey valueOf(String inValue) 183 { 184 UniProtFeatureKey key = sUniqueMap.get(inValue); 185 if (null == key) 186 { 187 key = new UniProtFeatureKey(inValue); 188 GenBank.getLogger().warning(StringUtil.singleQuote(inValue) + " is not a recognized UniProt feature key!"); 189 } 190 191 return key; 192 } 193 194 //--------------------------------------------------------------------------- 195 public static Collection<UniProtFeatureKey> values() 196 { 197 return sUniqueMap.values(); 198 } 199 200 //--------------------------------------------------------------------------- 201 public String name() 202 { 203 return mName; 204 } 205 206 //--------------------------------------------------------------------------- 207 @Override 208 public String toString() 209 { 210 return name(); 211 } 212 213 //--------------------------------------------------------------------------- 214 private UniProtFeatureKey setDescription(String inValue) 215 { 216 mDescription = inValue; 217 return this; 218 } 219 220 //--------------------------------------------------------------------------- 221 public String getDescription() 222 { 223 return mDescription; 224 } 225 226}