001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021 022package org.biojava.nbio.core.sequence.features; 023 024import java.util.List; 025import java.util.Map; 026 027import org.biojava.nbio.core.sequence.location.template.AbstractLocation; 028import org.biojava.nbio.core.sequence.template.AbstractSequence; 029import org.biojava.nbio.core.sequence.template.Compound; 030 031/** 032 * Interface class to handle describing arbitrary features. A feature can be found at multiple locations in a sequence such as 033 * the surface of a protein where different sequence positions make up that feature. Ligand binding pocket is another example. 034 * The location in its current form knows the start and stop position in a sequence and thus should contain knowledge about the 035 * actual sequence. 036 * 037 * A feature can contain features to handle cases where a domain is a feature and the secondary structures covered by that domain 038 * and other requirements for grouping. 039 * 040 * @author Scooter Willis <willishf at gmail dot com> 041 * @author Paolo Pavan 042 */ 043public interface FeatureInterface<S extends AbstractSequence<C>, C extends Compound> { 044 045 /** 046 * Get the short description that can be used to describe the feature 047 * @return 048 */ 049 050 public String getShortDescription(); 051 052 /** 053 * Set the short description that can be used to describe the feature 054 * @param shortDescription 055 */ 056 057 public void setShortDescription(String shortDescription); 058 059 /** 060 * Get the description that can be used to describe the feature 061 * @return 062 */ 063 064 public String getDescription(); 065 066 067 /** 068 * Set the description that can be used to describe the feature 069 * @return 070 */ 071 072 public void setDescription(String description); 073 074 /** 075 * The location(s) of this feature where the location should contain a reference to parent and sequence etc. 076 * <p> 077 * The location may be complicated, or simply a range. 078 * The annotation is assumed to apply to all the region contained 079 * within the location. 080 * 081 * @return a Location anchoring this feature 082 */ 083 public AbstractLocation getLocations(); 084 085 /** 086 * The new location for this feature. 087 * <p> 088 * The location may be complicated or simply a range. The annotation is 089 * assumed to apply to the entire region contained within the location. 090 * Any values returned from methods that rely on the old location must 091 * not be affected. 092 * 093 * @param loc the new Location for this feature 094 * 095 */ 096 public void setLocation(AbstractLocation loc); 097 098 /** 099 * The type of the feature. 100 * 101 * @return the type of this sequence 102 */ 103 public String getType(); 104 105 /** 106 * Change the type of this feature. 107 * 108 * @param type new type String 109 * 110 */ 111 public void setType(String type); 112 113 114 /** 115 * The source of the feature. This may be a program or process. 116 * 117 * @return the source, or generator 118 */ 119 public String getSource(); 120 121 /** 122 * Change the source of the FeatureInterface. 123 * 124 * @param source the new source String 125 * 126 */ 127 public void setSource(String source); 128 129 /** 130 * Set the parent feature 131 * @param feature 132 */ 133 134 public void setParentFeature(FeatureInterface<S, C> feature); 135 136 /** 137 * Get the parent feature 138 * @return 139 */ 140 141 public FeatureInterface<S, C> getParentFeature(); 142 143 /** 144 * Get the features contained by this feature 145 * @return 146 */ 147 148 public List<FeatureInterface<S, C>> getChildrenFeatures(); 149 150 /** 151 * Set the children features 152 * @param features 153 */ 154 155 public void setChildrenFeatures(List<FeatureInterface<S, C>> features); 156 157 158 /** 159 * @return the userObject 160 */ 161 public Object getUserObject(); 162 163 /** 164 * @param userObject the userObject to set 165 */ 166 public void setUserObject(Object userObject); 167 168 169 /** 170 * Get the qualifiers for this feature 171 * @return 172 */ 173 174 public Map<String, List<Qualifier>> getQualifiers(); 175 176 /** 177 * Set the qualifiers 178 * @param qualifiers 179 */ 180 181 public void setQualifiers(Map<String, List<Qualifier>> qualifiers); 182 /** 183 * Add a qualifier 184 * @param qualifier 185 */ 186 187 public void addQualifier(String key, Qualifier qualifier); 188 189}