2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
23 import jalview.analysis.Rna;
24 import jalview.analysis.SecStrConsensus.SimpleBP;
25 import jalview.analysis.WUSSParseException;
27 import java.util.ArrayList;
28 import java.util.Collection;
29 import java.util.Collections;
30 import java.util.Enumeration;
31 import java.util.HashMap;
32 import java.util.Hashtable;
34 import java.util.Map.Entry;
42 public class AlignmentAnnotation
45 * If true, this annotations is calculated every edit, eg consensus, quality
46 * or conservation graphs
48 public boolean autoCalculated = false;
51 * unique ID for this annotation, used to match up the same annotation row
52 * shown in multiple views and alignments
54 public String annotationId;
57 * the sequence this annotation is associated with (or null)
59 public SequenceI sequenceRef;
61 /** label shown in dropdown menus and in the annotation label area */
64 /** longer description text shown as a tooltip */
65 public String description;
67 /** Array of annotations placed in the current coordinate system */
68 public Annotation[] annotations;
70 public ArrayList<SimpleBP> bps = null;
73 * RNA secondary structure contact positions
75 public SequenceFeature[] _rnasecstr = null;
78 * position of annotation resulting in invalid WUSS parsing or -1
80 private long invalidrnastruc = -1;
83 * Updates the _rnasecstr field Determines the positions that base pair and
84 * the positions of helices based on secondary structure from a Stockholm file
88 private void _updateRnaSecStr(CharSequence RNAannot)
92 _rnasecstr = Rna.GetBasePairs(RNAannot);
93 bps = Rna.GetModeleBP(RNAannot);
95 } catch (WUSSParseException px)
97 // DEBUG System.out.println(px);
98 invalidrnastruc = px.getProblemPos();
100 if (invalidrnastruc > -1)
104 Rna.HelixMap(_rnasecstr);
105 // setRNAStruc(RNAannot);
107 if (_rnasecstr != null && _rnasecstr.length > 0)
109 // show all the RNA secondary structure annotation symbols.
111 showAllColLabels = true;
112 scaleColLabel = true;
115 // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
119 private void _markRnaHelices()
121 // Figure out number of helices
122 // Length of rnasecstr is the number of pairs of positions that base pair
123 // with each other in the secondary structure
124 for (int x = 0; x < _rnasecstr.length; x++)
128 * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
129 * this.annotation._rnasecstr[x].getBegin());
131 // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
135 val = Integer.valueOf(_rnasecstr[x].getFeatureGroup());
136 } catch (NumberFormatException q)
141 annotations[_rnasecstr[x].getBegin()].value = val;
142 annotations[_rnasecstr[x].getEnd()].value = val;
144 annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val;
145 annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val;
149 * map of positions in the associated annotation
151 public java.util.Hashtable<Integer, Annotation> sequenceMapping;
154 public float graphMin;
157 public float graphMax;
160 * Score associated with label and description.
162 public double score = Double.NaN;
165 * flag indicating if annotation has a score.
167 public boolean hasScore = false;
169 public GraphLine threshold;
171 // Graphical hints and tips
173 /** Can this row be edited by the user ? */
174 public boolean editable = false;
176 /** Indicates if annotation has a graphical symbol track */
177 public boolean hasIcons; //
179 /** Indicates if annotation has a text character label */
180 public boolean hasText;
182 /** is the row visible */
183 public boolean visible = true;
185 public int graphGroup = -1;
187 /** Displayed height of row in pixels */
188 public int height = 0;
190 public int graph = 0;
192 public int graphHeight = 40;
194 public boolean padGaps = false;
196 public static final int NO_GRAPH = 0;
198 public static final int BAR_GRAPH = 1;
200 public static final int LINE_GRAPH = 2;
202 public boolean belowAlignment = true;
204 public SequenceGroup groupRef = null;
207 * display every column label, even if there is a row of identical labels
209 public boolean showAllColLabels = false;
212 * scale the column label to fit within the alignment column.
214 public boolean scaleColLabel = false;
217 * centre the column labels relative to the alignment column
219 public boolean centreColLabels = false;
221 private boolean isrna;
226 * @see java.lang.Object#finalize()
228 protected void finalize() throws Throwable
235 public static int getGraphValueFromString(String string)
237 if (string.equalsIgnoreCase("BAR_GRAPH"))
241 else if (string.equalsIgnoreCase("LINE_GRAPH"))
251 // JBPNote: what does this do ?
252 public void ConcenStru(CharSequence RNAannot) throws WUSSParseException
254 bps = Rna.GetModeleBP(RNAannot);
258 * Creates a new AlignmentAnnotation object.
261 * short label shown under sequence labels
263 * text displayed on mouseover
265 * set of positional annotation elements
267 public AlignmentAnnotation(String label, String description,
268 Annotation[] annotations)
273 this.description = description;
274 this.annotations = annotations;
276 validateRangeAndDisplay();
280 * Checks if annotation labels represent secondary structures
283 void areLabelsSecondaryStructure()
285 boolean nonSSLabel = false;
287 StringBuffer rnastring = new StringBuffer();
290 for (int i = 0; i < annotations.length; i++)
292 if (annotations[i] == null)
296 if (annotations[i].secondaryStructure == 'H'
297 || annotations[i].secondaryStructure == 'E')
302 // Check for RNA secondary structure
304 // System.out.println(annotations[i].secondaryStructure);
305 // TODO: 2.8.2 should this ss symbol validation check be a function in
306 // RNA/ResidueProperties ?
307 if (annotations[i].secondaryStructure == '('
308 || annotations[i].secondaryStructure == '['
309 || annotations[i].secondaryStructure == '<'
310 || annotations[i].secondaryStructure == '{'
311 || annotations[i].secondaryStructure == 'A'
312 || annotations[i].secondaryStructure == 'B'
313 || annotations[i].secondaryStructure == 'C'
314 || annotations[i].secondaryStructure == 'D'
315 || annotations[i].secondaryStructure == 'E'
316 || annotations[i].secondaryStructure == 'F'
317 || annotations[i].secondaryStructure == 'G'
318 || annotations[i].secondaryStructure == 'H'
319 || annotations[i].secondaryStructure == 'I'
320 || annotations[i].secondaryStructure == 'J'
321 || annotations[i].secondaryStructure == 'K'
322 || annotations[i].secondaryStructure == 'L'
323 || annotations[i].secondaryStructure == 'M'
324 || annotations[i].secondaryStructure == 'N'
325 || annotations[i].secondaryStructure == 'O'
326 || annotations[i].secondaryStructure == 'P'
327 || annotations[i].secondaryStructure == 'Q'
328 || annotations[i].secondaryStructure == 'R'
329 || annotations[i].secondaryStructure == 'S'
330 || annotations[i].secondaryStructure == 'T'
331 || annotations[i].secondaryStructure == 'U'
332 || annotations[i].secondaryStructure == 'V'
333 || annotations[i].secondaryStructure == 'W'
334 || annotations[i].secondaryStructure == 'X'
335 || annotations[i].secondaryStructure == 'Y'
336 || annotations[i].secondaryStructure == 'Z')
343 // System.out.println("displaychar " + annotations[i].displayCharacter);
345 if (annotations[i].displayCharacter == null
346 || annotations[i].displayCharacter.length() == 0)
348 rnastring.append('.');
351 if (annotations[i].displayCharacter.length() == 1)
353 firstChar = annotations[i].displayCharacter.charAt(0);
354 // check to see if it looks like a sequence or is secondary structure
356 if (annotations[i].secondaryStructure != ' '
359 // Uncomment to only catch case where
360 // displayCharacter==secondary
362 // to correctly redisplay SS annotation imported from Stockholm,
363 // exported to JalviewXML and read back in again.
365 // annotations[i].displayCharacter.charAt(0)==annotations[i].secondaryStructure
400 && firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
402 if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) // TODO:
415 rnastring.append(annotations[i].displayCharacter.charAt(1));
418 if (annotations[i].displayCharacter.length() > 0)
427 for (int j = 0; j < annotations.length; j++)
429 if (annotations[j] != null
430 && annotations[j].secondaryStructure != ' ')
432 annotations[j].displayCharacter = String
433 .valueOf(annotations[j].secondaryStructure);
434 annotations[j].secondaryStructure = ' ';
443 _updateRnaSecStr(new AnnotCharSequence());
447 annotationId = this.hashCode() + "";
451 * flyweight access to positions in the alignment annotation row for RNA
457 private class AnnotCharSequence implements CharSequence
463 public AnnotCharSequence()
465 this(0, annotations.length);
468 public AnnotCharSequence(int start, int end)
475 public CharSequence subSequence(int start, int end)
477 return new AnnotCharSequence(offset + start, offset + end);
487 public char charAt(int index)
490 return ((index + offset < 0) || (index + offset) >= max
491 || annotations[index + offset] == null || (dc = annotations[index
492 + offset].displayCharacter.trim()).length() < 1) ? '.' : dc
496 public String toString()
498 char[] string = new char[max - offset];
499 int mx = annotations.length;
501 for (int i = offset; i < mx; i++)
504 string[i] = (annotations[i] == null || (dc = annotations[i].displayCharacter
505 .trim()).length() < 1) ? '.' : dc.charAt(0);
507 return new String(string);
511 private long _lastrnaannot = -1;
513 public String getRNAStruc()
517 String rnastruc = new AnnotCharSequence().toString();
518 if (_lastrnaannot != rnastruc.hashCode())
520 // ensure rna structure contacts are up to date
521 _lastrnaannot = rnastruc.hashCode();
522 _updateRnaSecStr(rnastruc);
530 * Creates a new AlignmentAnnotation object.
545 public AlignmentAnnotation(String label, String description,
546 Annotation[] annotations, float min, float max, int graphType)
548 // graphs are not editable
549 editable = graphType == 0;
552 this.description = description;
553 this.annotations = annotations;
557 validateRangeAndDisplay();
561 * checks graphMin and graphMax, secondary structure symbols, sets graphType
562 * appropriately, sets null labels to the empty string if appropriate.
564 public void validateRangeAndDisplay()
567 if (annotations == null)
569 visible = false; // try to prevent renderer from displaying.
570 return; // this is a non-annotation row annotation - ie a sequence score.
573 int graphType = graph;
574 float min = graphMin;
575 float max = graphMax;
576 boolean drawValues = true;
581 for (int i = 0; i < annotations.length; i++)
583 if (annotations[i] == null)
588 if (drawValues && annotations[i].displayCharacter != null
589 && annotations[i].displayCharacter.length() > 1)
594 if (annotations[i].value > max)
596 max = annotations[i].value;
599 if (annotations[i].value < min)
601 min = annotations[i].value;
603 if (_linecolour == null && annotations[i].colour != null)
605 _linecolour = annotations[i].colour;
608 // ensure zero is origin for min/max ranges on only one side of zero
625 areLabelsSecondaryStructure();
627 if (!drawValues && graphType != NO_GRAPH)
629 for (int i = 0; i < annotations.length; i++)
631 if (annotations[i] != null)
633 annotations[i].displayCharacter = "X";
640 * Copy constructor creates a new independent annotation row with the same
641 * associated sequenceRef
645 public AlignmentAnnotation(AlignmentAnnotation annotation)
647 this.label = new String(annotation.label);
648 if (annotation.description != null)
650 this.description = new String(annotation.description);
652 this.graphMin = annotation.graphMin;
653 this.graphMax = annotation.graphMax;
654 this.graph = annotation.graph;
655 this.graphHeight = annotation.graphHeight;
656 this.graphGroup = annotation.graphGroup;
657 this.groupRef = annotation.groupRef;
658 this.editable = annotation.editable;
659 this.autoCalculated = annotation.autoCalculated;
660 this.hasIcons = annotation.hasIcons;
661 this.hasText = annotation.hasText;
662 this.height = annotation.height;
663 this.label = annotation.label;
664 this.padGaps = annotation.padGaps;
665 this.visible = annotation.visible;
666 this.centreColLabels = annotation.centreColLabels;
667 this.scaleColLabel = annotation.scaleColLabel;
668 this.showAllColLabels = annotation.showAllColLabels;
669 this.calcId = annotation.calcId;
670 if (annotation.properties!=null)
672 properties = new HashMap<String,String>();
673 for (Map.Entry<String, String> val:annotation.properties.entrySet())
675 properties.put(val.getKey(), val.getValue());
678 if (this.hasScore = annotation.hasScore)
680 this.score = annotation.score;
682 if (annotation.threshold != null)
684 threshold = new GraphLine(annotation.threshold);
686 Annotation[] ann = annotation.annotations;
687 if (annotation.annotations != null)
689 this.annotations = new Annotation[ann.length];
690 for (int i = 0; i < ann.length; i++)
694 annotations[i] = new Annotation(ann[i]);
695 if (_linecolour != null)
697 _linecolour = annotations[i].colour;
702 if (annotation.sequenceRef != null)
704 this.sequenceRef = annotation.sequenceRef;
705 if (annotation.sequenceMapping != null)
708 sequenceMapping = new Hashtable();
709 Enumeration pos = annotation.sequenceMapping.keys();
710 while (pos.hasMoreElements())
712 // could optimise this!
713 p = (Integer) pos.nextElement();
714 Annotation a = annotation.sequenceMapping.get(p);
721 for (int i = 0; i < ann.length; i++)
725 sequenceMapping.put(p, annotations[i]);
733 this.sequenceMapping = null;
736 // TODO: check if we need to do this: JAL-952
737 // if (this.isrna=annotation.isrna)
739 // _rnasecstr=new SequenceFeature[annotation._rnasecstr];
741 validateRangeAndDisplay(); // construct hashcodes, etc.
745 * clip the annotation to the columns given by startRes and endRes (inclusive)
746 * and prune any existing sequenceMapping to just those columns.
751 public void restrict(int startRes, int endRes)
753 if (annotations == null)
762 if (startRes >= annotations.length)
764 startRes = annotations.length - 1;
766 if (endRes >= annotations.length)
768 endRes = annotations.length - 1;
770 if (annotations == null)
774 Annotation[] temp = new Annotation[endRes - startRes + 1];
775 if (startRes < annotations.length)
777 System.arraycopy(annotations, startRes, temp, 0, endRes - startRes
780 if (sequenceRef != null)
782 // Clip the mapping, if it exists.
783 int spos = sequenceRef.findPosition(startRes);
784 int epos = sequenceRef.findPosition(endRes);
785 if (sequenceMapping != null)
787 Hashtable newmapping = new Hashtable();
788 Enumeration e = sequenceMapping.keys();
789 while (e.hasMoreElements())
791 Integer pos = (Integer) e.nextElement();
792 if (pos.intValue() >= spos && pos.intValue() <= epos)
794 newmapping.put(pos, sequenceMapping.get(pos));
797 sequenceMapping.clear();
798 sequenceMapping = newmapping;
805 * set the annotation row to be at least length Annotations
808 * minimum number of columns required in the annotation row
809 * @return false if the annotation row is greater than length
811 public boolean padAnnotation(int length)
813 if (annotations == null)
815 return true; // annotation row is correct - null == not visible and
818 if (annotations.length < length)
820 Annotation[] na = new Annotation[length];
821 System.arraycopy(annotations, 0, na, 0, annotations.length);
825 return annotations.length > length;
832 * @return DOCUMENT ME!
834 public String toString()
836 StringBuffer buffer = new StringBuffer();
838 for (int i = 0; i < annotations.length; i++)
840 if (annotations[i] != null)
844 buffer.append(annotations[i].value);
848 buffer.append(annotations[i].secondaryStructure);
852 buffer.append(annotations[i].displayCharacter);
858 // TODO: remove disgusting hack for 'special' treatment of consensus line.
859 if (label.indexOf("Consensus") == 0)
863 for (int i = 0; i < annotations.length; i++)
865 if (annotations[i] != null)
867 buffer.append(annotations[i].description);
874 return buffer.toString();
877 public void setThreshold(GraphLine line)
882 public GraphLine getThreshold()
888 * Attach the annotation to seqRef, starting from startRes position. If
889 * alreadyMapped is true then the indices of the annotation[] array are
890 * sequence positions rather than alignment column positions.
894 * @param alreadyMapped
896 public void createSequenceMapping(SequenceI seqRef, int startRes,
897 boolean alreadyMapped)
904 sequenceRef = seqRef;
905 if (annotations == null)
909 sequenceMapping = new java.util.Hashtable();
913 for (int i = 0; i < annotations.length; i++)
915 if (annotations[i] != null)
919 seqPos = seqRef.findPosition(i);
923 seqPos = i + startRes;
926 sequenceMapping.put(new Integer(seqPos), annotations[i]);
932 public void adjustForAlignment()
934 if (sequenceRef == null)
939 if (annotations == null)
944 int a = 0, aSize = sequenceRef.getLength();
953 Annotation[] temp = new Annotation[aSize];
956 for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
958 index = new Integer(a);
959 if (sequenceMapping.containsKey(index))
961 position = sequenceRef.findIndex(a) - 1;
963 temp[position] = sequenceMapping.get(index);
971 * remove any null entries in annotation row and return the number of non-null
972 * annotation elements.
976 public int compactAnnotationArray()
978 int i = 0, iSize = annotations.length;
981 if (annotations[i] == null)
985 System.arraycopy(annotations, i + 1, annotations, i, iSize - i
995 Annotation[] ann = annotations;
996 annotations = new Annotation[i];
997 System.arraycopy(ann, 0, annotations, 0, i);
1003 * Associate this annotion with the aligned residues of a particular sequence.
1004 * sequenceMapping will be updated in the following way: null sequenceI -
1005 * existing mapping will be discarded but annotations left in mapped
1006 * positions. valid sequenceI not equal to current sequenceRef: mapping is
1007 * discarded and rebuilt assuming 1:1 correspondence TODO: overload with
1008 * parameter to specify correspondence between current and new sequenceRef
1012 public void setSequenceRef(SequenceI sequenceI)
1014 if (sequenceI != null)
1016 if (sequenceRef != null)
1018 boolean rIsDs=sequenceRef.getDatasetSequence()==null,tIsDs=sequenceI.getDatasetSequence()==null;
1019 if (sequenceRef != sequenceI
1020 && (rIsDs && !tIsDs && sequenceRef != sequenceI
1021 .getDatasetSequence())
1022 && (!rIsDs && tIsDs && sequenceRef.getDatasetSequence() != sequenceI)
1023 && (!rIsDs && !tIsDs && sequenceRef.getDatasetSequence() != sequenceI
1024 .getDatasetSequence())
1025 && !sequenceRef.equals(sequenceI))
1027 // if sequenceRef isn't intersecting with sequenceI
1028 // throw away old mapping and reconstruct.
1030 if (sequenceMapping != null)
1032 sequenceMapping = null;
1033 // compactAnnotationArray();
1035 createSequenceMapping(sequenceI, 1, true);
1036 adjustForAlignment();
1040 // Mapping carried over
1041 sequenceRef = sequenceI;
1046 // No mapping exists
1047 createSequenceMapping(sequenceI, 1, true);
1048 adjustForAlignment();
1053 // throw away the mapping without compacting.
1054 sequenceMapping = null;
1062 public double getScore()
1071 public void setScore(double score)
1079 * @return true if annotation has an associated score
1081 public boolean hasScore()
1083 return hasScore || !Double.isNaN(score);
1087 * Score only annotation
1090 * @param description
1093 public AlignmentAnnotation(String label, String description, double score)
1095 this(label, description, null);
1100 * copy constructor with edit based on the hidden columns marked in colSel
1102 * @param alignmentAnnotation
1105 public AlignmentAnnotation(AlignmentAnnotation alignmentAnnotation,
1106 ColumnSelection colSel)
1108 this(alignmentAnnotation);
1109 if (annotations == null)
1113 colSel.makeVisibleAnnotation(this);
1116 public void setPadGaps(boolean padgaps, char gapchar)
1118 this.padGaps = padgaps;
1122 for (int i = 0; i < annotations.length; i++)
1124 if (annotations[i] == null)
1126 annotations[i] = new Annotation(String.valueOf(gapchar), null,
1129 else if (annotations[i].displayCharacter == null
1130 || annotations[i].displayCharacter.equals(" "))
1132 annotations[i].displayCharacter = String.valueOf(gapchar);
1139 * format description string for display
1142 * @return Get the annotation description string optionally prefixed by
1143 * associated sequence name (if any)
1145 public String getDescription(boolean seqname)
1147 if (seqname && this.sequenceRef != null)
1149 int i = description.toLowerCase().indexOf("<html>");
1152 // move the html tag to before the sequence reference.
1153 return "<html>" + sequenceRef.getName() + " : "
1154 + description.substring(i + 6);
1156 return sequenceRef.getName() + " : " + description;
1161 public boolean isValidStruc()
1163 return invalidrnastruc == -1;
1166 public long getInvalidStrucPos()
1168 return invalidrnastruc;
1172 * machine readable ID string indicating what generated this annotation
1174 protected String calcId = "";
1177 * properties associated with the calcId
1179 protected Map<String, String> properties = new HashMap<String, String>();
1182 * base colour for line graphs. If null, will be set automatically by
1183 * searching the alignment annotation
1185 public java.awt.Color _linecolour;
1187 public String getCalcId()
1192 public void setCalcId(String calcId)
1194 this.calcId = calcId;
1197 public boolean isRNA()
1203 * transfer annotation to the given sequence using the given mapping from the
1204 * current positions or an existing sequence mapping
1208 * map involving sq as To or From
1210 public void liftOver(SequenceI sq, Mapping sp2sq)
1212 if (sp2sq.getMappedWidth() != sp2sq.getWidth())
1214 // TODO: employ getWord/MappedWord to transfer annotation between cDNA and Protein reference frames
1215 throw new Error("liftOver currently not implemented for transfer of annotation between different types of seqeunce");
1217 boolean mapIsTo = (sp2sq != null) ? (sp2sq.getTo() == sq || sp2sq
1218 .getTo() == sq.getDatasetSequence()) : false;
1220 // TODO build a better annotation element map and get rid of annotations[]
1221 Hashtable<Integer, Annotation> mapForsq = new Hashtable();
1222 if (sequenceMapping != null)
1226 for (Entry<Integer, Annotation> ie : sequenceMapping.entrySet())
1228 Integer mpos = Integer.valueOf(mapIsTo ? sp2sq
1229 .getMappedPosition(ie.getKey()) : sp2sq.getPosition(ie
1231 if (mpos >= sq.getStart() && mpos <= sq.getEnd())
1233 mapForsq.put(mpos, ie.getValue());
1236 sequenceMapping = mapForsq;
1238 adjustForAlignment();
1248 * like liftOver but more general.
1250 * Takes an array of int pairs that will be used to update the internal
1251 * sequenceMapping and so shuffle the annotated positions
1254 * - new sequence reference for the annotation row - if null,
1255 * sequenceRef is left unchanged
1257 * array of ints containing corresponding positions
1259 * - column for current coordinate system (-1 for index+1)
1261 * - column for destination coordinate system (-1 for index+1)
1263 * - offset added to index when referencing either coordinate system
1264 * @note no checks are made as to whether from and/or to are sensible
1265 * @note caller should add the remapped annotation to newref if they have not
1268 public void remap(SequenceI newref, int[][] mapping, int from, int to,
1271 if (mapping != null)
1273 Hashtable<Integer, Annotation> old = sequenceMapping, remap = new Hashtable<Integer, Annotation>();
1275 for (int mp[] : mapping)
1281 Annotation ann = null;
1284 ann = sequenceMapping.get(Integer.valueOf(idxoffset + index));
1288 if (mp != null && mp.length > from)
1290 ann = sequenceMapping.get(Integer.valueOf(mp[from]));
1297 remap.put(Integer.valueOf(idxoffset + index), ann);
1301 if (to > -1 && to < mp.length)
1303 remap.put(Integer.valueOf(mp[to]), ann);
1308 sequenceMapping = remap;
1312 sequenceRef = newref;
1314 adjustForAlignment();
1318 public String getProperty(String property)
1320 if (properties == null)
1324 return properties.get(property);
1327 public void setProperty(String property, String value)
1329 if (properties==null)
1331 properties = new HashMap<String,String>();
1333 properties.put(property, value);
1336 public boolean hasProperties()
1338 return properties != null && properties.size() > 0;
1341 public Collection<String> getProperties()
1343 if (properties == null)
1345 return Collections.EMPTY_LIST;
1347 return properties.keySet();