2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
20 import jalview.bin.Cache;
21 import jalview.datamodel.AlignedCodonFrame;
22 import jalview.datamodel.AlignmentAnnotation;
23 import jalview.datamodel.GraphLine;
24 import jalview.datamodel.SequenceI;
25 import jalview.gui.AlignFrame;
26 import jalview.gui.AlignViewport;
27 import jalview.gui.Desktop;
28 import jalview.gui.TreePanel;
29 import jalview.io.vamsas.Datasetsequence;
30 import jalview.io.vamsas.DatastoreItem;
31 import jalview.io.vamsas.DatastoreRegistry;
32 import jalview.io.vamsas.Rangetype;
33 import java.io.IOException;
34 import java.util.Enumeration;
35 import java.util.HashMap;
36 import java.util.Hashtable;
37 import java.util.IdentityHashMap;
38 import java.util.Iterator;
39 import java.util.List;
40 import java.util.Vector;
41 import java.util.jar.JarInputStream;
42 import java.util.jar.JarOutputStream;
44 import uk.ac.vamsas.client.*;
45 import uk.ac.vamsas.objects.core.*;
46 import uk.ac.vamsas.objects.utils.Properties;
51 * org.exolab.castor.util.LocalConfiguration.getInstance().getProperties().setProperty(
52 * "org.exolab.castor.serializer", "org.apache.xml.serialize.XMLSerilazizer"); }
56 * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
58 public class VamsasAppDatastore
61 * Type used for general jalview generated annotation added to vamsas document
63 public static final String JALVIEW_ANNOTATION_ROW = "JalviewAnnotation";
66 * AlignmentAnnotation property to indicate that values should not be
69 public static final String DISCRETE_ANNOTATION = "discrete";
72 * continuous property - optional to specify that annotation should be
73 * represented as a continous graph line
75 private static final String CONTINUOUS_ANNOTATION = "continuous";
77 private static final String THRESHOLD = "threshold";
80 * template for provenance entries written to vamsas session document
82 Entry provEntry = null;
85 * Instance of the session document being synchronized with
90 * map Vorba (vamsas object xml ref) IDs to live jalview object references
95 * map live jalview object references to Vorba IDs
97 IdentityHashMap jv2vobj;
100 * map jalview sequence set ID (which is vorba ID for alignment) to last
101 * recorded hash value for the alignment viewport (the undo/redo hash value)
103 Hashtable alignRDHash;
105 public VamsasAppDatastore(IClientDocument cdoc, Hashtable vobj2jv,
106 IdentityHashMap jv2vobj, Entry provEntry, Hashtable alignRDHash)
109 this.vobj2jv = vobj2jv;
110 this.jv2vobj = jv2vobj;
111 this.provEntry = provEntry;
112 this.alignRDHash = alignRDHash;
117 * the skipList used to skip over views from Jalview Appdata's that we've
118 * already syncrhonized
122 private void buildSkipList()
124 skipList = new Hashtable();
125 AlignFrame[] al = Desktop.getAlignframes();
126 for (int f = 0; al != null && f < al.length; f++)
128 skipList.put(al[f].getViewport().getSequenceSetId(), al[f]);
133 * @return the Vobject bound to Jalview datamodel object
135 protected Vobject getjv2vObj(Object jvobj)
137 if (jv2vobj.containsKey(jvobj))
139 return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
141 // check if we're working with a string - then workaround
142 // the use of IdentityHashTable because different strings
143 // have different object IDs.
144 if (jvobj instanceof String)
146 Object seqsetidobj = null;
147 seqsetidobj = getVamsasObjectBinding().get(jvobj);
148 if (seqsetidobj != null)
150 if (seqsetidobj instanceof String)
152 // what is expected. object returned by av.getSequenceSetId() -
153 // reverse lookup to get the 'registered' instance of this string
154 Vobject obj = getjv2vObj(seqsetidobj);
155 if (obj != null && !(obj instanceof Alignment))
158 .warn("IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
159 + seqsetidobj + " to object " + obj);
165 Cache.log.warn("Unexpected mapping for Jalview String Object ID "
166 + seqsetidobj + " to another jalview dataset object "
172 if (Cache.log.isDebugEnabled())
174 Cache.log.debug("Returning null VorbaID binding for jalview object "
183 * @return Jalview datamodel object bound to the vamsas document object
185 protected Object getvObj2jv(uk.ac.vamsas.client.Vobject vobj)
187 VorbaId id = vobj.getVorbaId();
190 id = cdoc.registerObject(vobj);
192 .debug("Registering new object and returning null for getvObj2jv");
195 if (vobj2jv.containsKey(vobj.getVorbaId()))
197 return vobj2jv.get(vobj.getVorbaId());
202 protected void bindjvvobj(Object jvobj, uk.ac.vamsas.client.Vobject vobj)
204 VorbaId id = vobj.getVorbaId();
207 id = cdoc.registerObject(vobj);
208 if (id == null || vobj.getVorbaId() == null
209 || cdoc.getObject(id) != vobj)
211 Cache.log.error("Failed to get id for "
212 + (vobj.isRegisterable() ? "registerable"
213 : "unregisterable") + " object " + vobj);
217 if (vobj2jv.containsKey(vobj.getVorbaId())
218 && !((VorbaId) vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
221 "Warning? Overwriting existing vamsas id binding for "
222 + vobj.getVorbaId(), new Exception(
223 "Overwriting vamsas id binding."));
225 else if (jv2vobj.containsKey(jvobj)
226 && !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
229 "Warning? Overwriting existing jalview object binding for "
230 + jvobj, new Exception(
231 "Overwriting jalview object binding."));
234 * Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id "
235 * +vobj.getVorbaId()+" already bound to "+getvObj2jv(vobj)+" and "+jvobj+"
236 * already bound to "+getjv2vObj(jvobj),new Exception("Excessive call to
239 // we just update the hash's regardless!
240 Cache.log.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
241 vobj2jv.put(vobj.getVorbaId(), jvobj);
242 // JBPNote - better implementing a hybrid invertible hash.
243 jv2vobj.put(jvobj, vobj.getVorbaId());
247 * put the alignment viewed by AlignViewport into cdoc.
250 * alignViewport to be stored
252 * title for alignment
253 * @return true if alignment associated with viewport was stored/synchronized
256 public boolean storeVAMSAS(AlignViewport av, String aFtitle)
260 jalview.datamodel.AlignmentI jal = av.getAlignment();
261 jalview.datamodel.AlignmentI jds = jal.getDataset();
263 VAMSAS root = null; // will be resolved based on Dataset Parent.
264 // /////////////////////////////////////////
266 DataSet dataset = null;
269 Cache.log.warn("Creating new dataset for an alignment.");
270 jal.setDataset(null);
271 jds = jal.getDataset();
274 // try and get alignment and association for sequence set id
276 Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId());
277 if (alignment != null)
279 dataset = (DataSet) alignment.getV_parent();
283 // is the dataset already registered
284 dataset = (DataSet) getjv2vObj(jds);
289 // it might be that one of the dataset sequences does actually have a
290 // binding, so search for it indirectly. If it does, then the local
292 // must be merged with the existing vamsas dataset.
293 jalview.datamodel.SequenceI[] jdatset = jds.getSequencesArray();
294 for (int i = 0; i < jdatset.length; i++)
296 Vobject vbound = getjv2vObj(jdatset[i]);
299 if (vbound instanceof uk.ac.vamsas.objects.core.Sequence)
303 dataset = (DataSet) vbound.getV_parent();
307 if (vbound.getV_parent() != null
308 && dataset != vbound.getV_parent())
311 "IMPLEMENTATION ERROR: Cannot map an alignment of sequences from different datasets into a single alignment in the vamsas document.");
312 // This occurs because the dataset for the alignment we are
323 Cache.log.warn("Creating new vamsas dataset for alignment view "
324 + av.getSequenceSetId());
325 // we create a new dataset on the default vamsas root.
326 root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
327 dataset = new DataSet();
328 root.addDataSet(dataset);
329 bindjvvobj(jds, dataset);
330 dataset.setProvenance(dummyProvenance());
331 // dataset.getProvenance().addEntry(provEntry);
336 root = (VAMSAS) dataset.getV_parent();
340 // set new dataset and alignment sequences based on alignment Nucleotide
342 // this *will* break when alignment contains both nucleotide and amino
344 String dict = jal.isNucleotide() ? uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA
345 : uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA;
346 Vector dssmods = new Vector();
347 for (int i = 0; i < jal.getHeight(); i++)
349 SequenceI sq = jal.getSequenceAt(i).getDatasetSequence(); // only insert
353 Datasetsequence dssync = new jalview.io.vamsas.Datasetsequence(
354 this, sq, dict, dataset);
355 sequence = (Sequence) dssync.getVobj();
356 if (dssync.getModified())
358 dssmods.addElement(sequence);
362 if (dssmods.size() > 0)
366 Entry pentry = this.addProvenance(dataset.getProvenance(),
367 "updated sequences");
368 // pentry.addInput(vInput); could write in which sequences were
370 dssmods.removeAllElements();
373 // dataset.setProvenance(getVamsasProvenance(jal.getDataset().getProvenance()));
374 // ////////////////////////////////////////////
375 if (alignmentWillBeSkipped(av))
377 // TODO: trees could be written - but for the moment we just
379 // add to the JalviewXML skipList and ..
383 if (alignment == null)
385 alignment = new Alignment();
386 bindjvvobj(av.getSequenceSetId(), alignment);
387 if (alignment.getProvenance() == null)
389 alignment.setProvenance(new Provenance());
391 addProvenance(alignment.getProvenance(), "added"); // TODO: insert some
394 dataset.addAlignment(alignment);
396 Property title = new Property();
397 title.setName("title");
398 title.setType("string");
399 title.setContent(aFtitle);
400 alignment.addProperty(title);
402 alignment.setGapChar(String.valueOf(av.getGapCharacter()));
403 for (int i = 0; i < jal.getHeight(); i++)
405 syncToAlignmentSequence(jal.getSequenceAt(i), alignment, null);
407 alignRDHash.put(av.getSequenceSetId(), av.getUndoRedoHash());
411 // always prepare to clone the alignment
412 boolean alismod = av.isUndoRedoHashModified((long[]) alignRDHash
413 .get(av.getSequenceSetId()));
414 // todo: verify and update mutable alignment props.
415 // TODO: Use isLocked methods
416 if (alignment.getModifiable() == null
417 || alignment.getModifiable().length() == 0)
418 // && !alignment.isDependedOn())
420 boolean modified = false;
421 // check existing sequences in local and in document.
422 Vector docseqs = new Vector(
423 alignment.getAlignmentSequenceAsReference());
424 for (int i = 0; i < jal.getHeight(); i++)
426 modified |= syncToAlignmentSequence(jal.getSequenceAt(i),
429 if (docseqs.size() > 0)
431 // removeValignmentSequences(alignment, docseqs);
432 docseqs.removeAllElements();
434 .println("Sequence deletion from alignment is not implemented.");
442 addProvenance(alignment.getProvenance(), "Edited"); // TODO:
451 addProvenance(alignment.getProvenance(), "Attributes Edited"); // TODO:
461 System.out.println("update alignment in document.");
465 System.out.println("alignment in document left unchanged.");
470 // unbind alignment from view.
471 // create new binding and new alignment.
472 // mark trail on new alignment as being derived from old ?
474 .println("update edited alignment to new alignment in document.");
477 // ////////////////////////////////////////////
478 // SAVE Alignment Sequence Features
479 for (int i = 0, iSize = alignment.getAlignmentSequenceCount(); i < iSize; i++)
481 AlignmentSequence valseq;
482 SequenceI alseq = (SequenceI) getvObj2jv(valseq = alignment
483 .getAlignmentSequence(i));
484 if (alseq != null && alseq.getSequenceFeatures() != null)
487 * We do not put local Alignment Sequence Features into the vamsas
491 * jalview.datamodel.SequenceFeature[] features = alseq
492 * .getSequenceFeatures(); for (int f = 0; f < features.length; f++) {
493 * if (features[f] != null) { AlignmentSequenceAnnotation valseqf = (
494 * AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
497 * valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
498 * new AlignmentSequenceAnnotation(), features[i]);
499 * valseqf.setGraph(false);
500 * valseqf.addProperty(newProperty("jalview:feature"
501 * ,"boolean","true")); if (valseqf.getProvenance() == null) {
502 * valseqf.setProvenance(new Provenance()); }
503 * addProvenance(valseqf.getProvenance(), "created"); // JBPNote - //
504 * need to // update bindjvvobj(features[i], valseqf);
505 * valseq.addAlignmentSequenceAnnotation(valseqf); } } }
510 // ////////////////////////////////////////////
512 if (jal.getAlignmentAnnotation() != null)
514 jalview.datamodel.AlignmentAnnotation[] aa = jal
515 .getAlignmentAnnotation();
516 java.util.HashMap AlSeqMaps = new HashMap(); // stores int maps from
517 // alignment columns to
518 // sequence positions.
519 for (int i = 0; i < aa.length; i++)
521 if (aa[i] == null || isJalviewOnly(aa[i]))
525 if (aa[i].groupRef != null)
527 // TODO: store any group associated annotation references
529 .warn("Group associated sequence annotation is not stored in VAMSAS document.");
532 if (aa[i].sequenceRef != null)
534 // Deal with sequence associated annotation
535 Vobject sref = getjv2vObj(aa[i].sequenceRef);
536 if (sref instanceof uk.ac.vamsas.objects.core.AlignmentSequence)
538 saveAlignmentSequenceAnnotation(AlSeqMaps,
539 (AlignmentSequence) sref, aa[i]);
543 // first find the alignment sequence to associate this with.
544 for (SequenceI jvalsq:av.getAlignment().getSequences()) {
545 // saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
547 if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
549 Vobject alsref = getjv2vObj(jvalsq);
550 saveAlignmentSequenceAnnotation(AlSeqMaps,
551 (AlignmentSequence) alsref, aa[i]);
560 // add Alignment Annotation
561 uk.ac.vamsas.objects.core.AlignmentAnnotation an = (uk.ac.vamsas.objects.core.AlignmentAnnotation) getjv2vObj(aa[i]);
564 an = new uk.ac.vamsas.objects.core.AlignmentAnnotation();
565 an.setType(JALVIEW_ANNOTATION_ROW);
566 an.setDescription(aa[i].description);
567 alignment.addAlignmentAnnotation(an);
568 Seg vSeg = new Seg(); // TODO: refactor to have a default
569 // rangeAnnotationType initer/updater that
570 // takes a set of int ranges.
572 vSeg.setInclusive(true);
573 vSeg.setEnd(jal.getWidth());
577 an.setGraph(true); // aa[i].graph);
579 an.setLabel(aa[i].label);
580 an.setProvenance(dummyProvenance());
581 if (aa[i].graph != AlignmentAnnotation.NO_GRAPH)
583 an.setGroup(Integer.toString(aa[i].graphGroup)); // // JBPNote
598 AnnotationElement ae;
600 for (int a = 0; a < aa[i].annotations.length; a++)
602 if ((aa[i] == null) || (aa[i].annotations[a] == null))
607 ae = new AnnotationElement();
608 ae.setDescription(aa[i].annotations[a].description);
609 ae.addGlyph(new Glyph());
610 ae.getGlyph(0).setContent(
611 aa[i].annotations[a].displayCharacter); // assume
620 ae.addValue(aa[i].annotations[a].value);
622 ae.setPosition(a + 1);
623 if (aa[i].annotations[a].secondaryStructure != ' ')
625 Glyph ss = new Glyph();
626 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
628 .valueOf(aa[i].annotations[a].secondaryStructure));
631 an.addAnnotationElement(ae);
635 // an.addProperty(newProperty("jalview:editable", null,
637 // an.setModifiable(""); // TODO: This is not the way the
638 // modifiable flag is supposed to be used.
640 setAnnotationType(an, aa[i]);
642 if (aa[i].graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
645 an.setGroup(Integer.toString(aa[i].graphGroup));
646 if (aa[i].threshold != null && aa[i].threshold.displayed)
648 an.addProperty(Properties.newProperty(THRESHOLD,
649 Properties.FLOATTYPE, "" + aa[i].threshold.value));
650 if (aa[i].threshold.label != null)
652 an.addProperty(Properties.newProperty(THRESHOLD
653 + "Name", Properties.STRINGTYPE, ""
654 + aa[i].threshold.label));
663 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT
666 // verify annotation - update (perhaps)
668 .info("update alignment sequence annotation. not yet implemented.");
672 // verify annotation - update (perhaps)
674 .info("updated alignment sequence annotation added.");
680 // /////////////////////////////////////////////////////
682 // //////////////////////////////////////////////
684 // /////////////////////////////////
685 // FIND ANY ASSOCIATED TREES
686 if (Desktop.desktop != null)
688 javax.swing.JInternalFrame[] frames = Desktop.instance
691 for (int t = 0; t < frames.length; t++)
693 if (frames[t] instanceof TreePanel)
695 TreePanel tp = (TreePanel) frames[t];
697 if (tp.getViewPort().getSequenceSetId()
698 .equals(av.getSequenceSetId()))
700 DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
706 // Store Jalview specific stuff in the Jalview appData
707 // not implemented in the SimpleDoc interface.
712 ex.printStackTrace();
719 * very quick test to see if the viewport would be stored in the vamsas
720 * document. Reasons for not storing include the unaligned flag being false
721 * (for all sequences, including the hidden ones!)
724 * @return true if alignment associated with this view will be stored in
727 public boolean alignmentWillBeSkipped(AlignViewport av)
729 return (!av.getAlignment().isAligned());
732 private void addToSkipList(AlignViewport av)
734 if (skipList == null)
736 skipList = new Hashtable();
738 skipList.put(av.getSequenceSetId(), av);
742 * remove docseqs from the given alignment marking provenance appropriately
743 * and removing any references to the sequences.
748 private void removeValignmentSequences(Alignment alignment, Vector docseqs)
750 // delete these from document. This really needs to be a generic document
751 // API function derived by CASTOR.
752 Enumeration en = docseqs.elements();
753 while (en.hasMoreElements())
755 alignment.removeAlignmentSequence((AlignmentSequence) en
758 Entry pe = addProvenance(alignment.getProvenance(), "Removed "
759 + docseqs.size() + " sequences");
760 en = alignment.enumerateAlignmentAnnotation();
761 Vector toremove = new Vector();
762 while (en.hasMoreElements())
764 uk.ac.vamsas.objects.core.AlignmentAnnotation alan = (uk.ac.vamsas.objects.core.AlignmentAnnotation) en
766 if (alan.getSeqrefsCount() > 0)
769 Vector storem = new Vector();
770 Enumeration sr = alan.enumerateSeqrefs();
771 while (sr.hasMoreElements())
773 Object alsr = sr.nextElement();
774 if (docseqs.contains(alsr))
776 storem.addElement(alsr);
779 // remove references to the deleted sequences
780 sr = storem.elements();
781 while (sr.hasMoreElements())
783 alan.removeSeqrefs(sr.nextElement());
786 if (alan.getSeqrefsCount() == 0)
788 // should then delete alan from dataset
789 toremove.addElement(alan);
793 // remove any annotation that used to be associated to a specific bunch of
795 en = toremove.elements();
796 while (en.hasMoreElements())
799 .removeAlignmentAnnotation((uk.ac.vamsas.objects.core.AlignmentAnnotation) en
802 // TODO: search through alignment annotations to remove any references to
803 // this alignment sequence
807 * sync a jalview alignment seuqence into a vamsas alignment assumes all lock
808 * transformation/bindings have been sorted out before hand. creates/syncs the
809 * vamsas alignment sequence for jvalsq and adds it to the alignment if
810 * necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
811 * and these are removed after being processed w.r.t a bound jvalsq
814 private boolean syncToAlignmentSequence(SequenceI jvalsq,
815 Alignment alignment, Vector unbounddocseq)
817 boolean modal = false;
818 // todo: islocked method here
819 boolean up2doc = false;
820 AlignmentSequence alseq = (AlignmentSequence) getjv2vObj(jvalsq);
823 alseq = new AlignmentSequence();
828 if (unbounddocseq != null)
830 unbounddocseq.removeElement(alseq);
833 // boolean locked = (alignment.getModifiable()==null ||
834 // alignment.getModifiable().length()>0);
835 // TODO: VAMSAS: translate lowercase symbols to annotation ?
836 if (up2doc || !alseq.getSequence().equals(jvalsq.getSequenceAsString()))
838 alseq.setSequence(jvalsq.getSequenceAsString());
839 alseq.setStart(jvalsq.getStart());
840 alseq.setEnd(jvalsq.getEnd());
843 if (up2doc || !alseq.getName().equals(jvalsq.getName()))
846 alseq.setName(jvalsq.getName());
848 if (jvalsq.getDescription() != null
849 && (alseq.getDescription() == null || !jvalsq.getDescription()
850 .equals(alseq.getDescription())))
853 alseq.setDescription(jvalsq.getDescription());
855 if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
858 .warn("Serious Implementation error - Unbound dataset sequence in alignment: "
859 + jvalsq.getDatasetSequence());
861 alseq.setRefid(getjv2vObj(jvalsq.getDatasetSequence()));
865 alignment.addAlignmentSequence(alseq);
866 bindjvvobj(jvalsq, alseq);
868 return up2doc || modal;
872 * locally sync a jalview alignment seuqence from a vamsas alignment assumes
873 * all lock transformation/bindings have been sorted out before hand.
874 * creates/syncs the jvalsq from the alignment sequence
876 private boolean syncFromAlignmentSequence(AlignmentSequence valseq,
877 char valGapchar, char gapChar, List<SequenceI> dsseqs)
880 boolean modal = false;
881 // todo: islocked method here
882 boolean upFromdoc = false;
883 jalview.datamodel.SequenceI alseq = (SequenceI) getvObj2jv(valseq);
891 // boolean locked = (alignment.getModifiable()==null ||
892 // alignment.getModifiable().length()>0);
893 // TODO: VAMSAS: translate lowercase symbols to annotation ?
895 || !valseq.getSequence().equals(alseq.getSequenceAsString()))
897 // this might go *horribly* wrong
898 alseq.setSequence(new String(valseq.getSequence()).replace(
899 valGapchar, gapChar));
900 alseq.setStart((int) valseq.getStart());
901 alseq.setEnd((int) valseq.getEnd());
904 if (!valseq.getName().equals(alseq.getName()))
907 alseq.setName(valseq.getName());
909 if (alseq.getDescription() == null
910 || (valseq.getDescription() != null && !alseq
911 .getDescription().equals(valseq.getDescription())))
913 alseq.setDescription(valseq.getDescription());
916 if (modal && Cache.log.isDebugEnabled())
918 Cache.log.debug("Updating apparently edited sequence "
924 alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
925 .getSequence().replace(valGapchar, gapChar),
926 (int) valseq.getStart(), (int) valseq.getEnd());
928 Vobject datsetseq = (Vobject) valseq.getRefid();
929 if (datsetseq != null)
931 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
932 if (valseq.getDescription() != null)
934 alseq.setDescription(valseq.getDescription());
938 // inherit description line from dataset.
939 if (alseq.getDatasetSequence().getDescription() != null)
941 alseq.setDescription(alseq.getDatasetSequence()
956 .error("Invalid dataset sequence id (null) for alignment sequence "
957 + valseq.getVorbaId());
959 bindjvvobj(alseq, valseq);
960 alseq.setVamsasId(valseq.getVorbaId().getId());
963 Vobject datsetseq = (Vobject) valseq.getRefid();
964 if (datsetseq != null)
966 if (datsetseq != alseq.getDatasetSequence())
970 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
972 return upFromdoc || modal;
975 private void initRangeAnnotationType(RangeAnnotation an,
976 AlignmentAnnotation alan, int[] gapMap)
978 Seg vSeg = new Seg();
980 vSeg.setInclusive(true);
981 vSeg.setEnd(gapMap.length);
984 // LATER: much of this is verbatim from the alignmentAnnotation
985 // method below. suggests refactoring to make rangeAnnotation the
987 an.setDescription(alan.description);
988 an.setLabel(alan.label);
989 an.setGroup(Integer.toString(alan.graphGroup));
998 AnnotationElement ae;
999 for (int a = 0; a < alan.annotations.length; a++)
1001 if (alan.annotations[a] == null)
1006 ae = new AnnotationElement();
1007 ae.setDescription(alan.annotations[a].description);
1008 ae.addGlyph(new Glyph());
1009 ae.getGlyph(0).setContent(alan.annotations[a].displayCharacter); // assume
1016 if (alan.graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
1018 ae.addValue(alan.annotations[a].value);
1020 ae.setPosition(gapMap[a] + 1); // position w.r.t. AlignmentSequence
1022 if (alan.annotations[a].secondaryStructure != ' ')
1024 // we only write an annotation where it really exists.
1025 Glyph ss = new Glyph();
1026 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
1027 ss.setContent(String
1028 .valueOf(alan.annotations[a].secondaryStructure));
1031 an.addAnnotationElement(ae);
1036 private void saveDatasetSequenceAnnotation(HashMap AlSeqMaps,
1037 uk.ac.vamsas.objects.core.Sequence sref, AlignmentAnnotation alan)
1041 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1042 // objects.core.AlignmentSequence) sref;
1043 uk.ac.vamsas.objects.core.DataSetAnnotations an = (uk.ac.vamsas.objects.core.DataSetAnnotations) getjv2vObj(alan);
1044 int[] gapMap = getGapMap(AlSeqMaps, alan);
1047 an = new uk.ac.vamsas.objects.core.DataSetAnnotations();
1048 initRangeAnnotationType(an, alan, gapMap);
1050 an.setProvenance(dummyProvenance()); // get provenance as user
1051 // created, or jnet, or
1053 setAnnotationType(an, alan);
1054 an.setGroup(Integer.toString(alan.graphGroup)); // // JBPNote -
1062 if (alan.getThreshold() != null && alan.getThreshold().displayed)
1064 an.addProperty(Properties.newProperty(THRESHOLD,
1065 Properties.FLOATTYPE, "" + alan.getThreshold().value));
1066 if (alan.getThreshold().label != null)
1067 an.addProperty(Properties.newProperty(THRESHOLD + "Name",
1068 Properties.STRINGTYPE, "" + alan.getThreshold().label));
1070 ((DataSet) sref.getV_parent()).addDataSetAnnotations(an);
1071 bindjvvobj(alan, an);
1075 // update reference sequence Annotation
1076 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1079 // verify existing alignment sequence annotation is up to date
1080 System.out.println("update dataset sequence annotation.");
1084 // verify existing alignment sequence annotation is up to date
1086 .println("make new alignment dataset sequence annotation if modification has happened.");
1092 private int[] getGapMap(HashMap AlSeqMaps, AlignmentAnnotation alan)
1095 if (AlSeqMaps.containsKey(alan.sequenceRef))
1097 gapMap = (int[]) AlSeqMaps.get(alan.sequenceRef);
1101 gapMap = new int[alan.sequenceRef.getLength()];
1102 // map from alignment position to sequence position.
1103 int[] sgapMap = alan.sequenceRef.gapMap();
1104 for (int a = 0; a < sgapMap.length; a++)
1106 gapMap[sgapMap[a]] = a;
1112 private void saveAlignmentSequenceAnnotation(HashMap AlSeqMaps,
1113 AlignmentSequence alsref, AlignmentAnnotation alan)
1117 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1118 // objects.core.AlignmentSequence) sref;
1119 uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation an = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) getjv2vObj(alan);
1120 int[] gapMap = getGapMap(AlSeqMaps, alan);
1123 an = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation();
1124 initRangeAnnotationType(an, alan, gapMap);
1126 * I mean here that we don't actually have a semantic 'type' for the
1127 * annotation (this might be - score, intrinsic property, measurement,
1128 * something extracted from another program, etc)
1130 an.setType(JALVIEW_ANNOTATION_ROW); // TODO: better fix
1131 // this rough guess ;)
1132 alsref.addAlignmentSequenceAnnotation(an);
1133 bindjvvobj(alan, an);
1134 // These properties are directly supported by the
1135 // AlignmentSequenceAnnotation type.
1136 setAnnotationType(an, alan);
1137 an.setProvenance(dummyProvenance()); // get provenance as user
1138 // created, or jnet, or
1143 // update reference sequence Annotation
1144 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1147 // verify existing alignment sequence annotation is up to date
1148 System.out.println("update alignment sequence annotation.");
1152 // verify existing alignment sequence annotation is up to date
1154 .println("make new alignment sequence annotation if modification has happened.");
1160 * set vamsas annotation object type from jalview annotation
1165 private void setAnnotationType(RangeAnnotation an,
1166 AlignmentAnnotation alan)
1168 if (an instanceof AlignmentSequenceAnnotation)
1170 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1172 ((AlignmentSequenceAnnotation) an).setGraph(true);
1176 ((AlignmentSequenceAnnotation) an).setGraph(false);
1179 if (an instanceof uk.ac.vamsas.objects.core.AlignmentAnnotation)
1181 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1183 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an).setGraph(true);
1187 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an)
1193 case AlignmentAnnotation.BAR_GRAPH:
1194 an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION,
1195 Properties.BOOLEANTYPE, "true"));
1197 case AlignmentAnnotation.LINE_GRAPH:
1198 an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION,
1199 Properties.BOOLEANTYPE, "true"));
1202 // don't add any kind of discrete or continous property info.
1207 * get start<end range of segment, adjusting for inclusivity flag and
1211 * @param ensureDirection
1212 * when true - always ensure start is less than end.
1213 * @return int[] { start, end, direction} where direction==1 for range running
1214 * from end to start.
1216 private int[] getSegRange(Seg visSeg, boolean ensureDirection)
1218 boolean incl = visSeg.getInclusive();
1219 // adjust for inclusive flag.
1220 int pol = (visSeg.getStart() <= visSeg.getEnd()) ? 1 : -1; // polarity of
1222 int start = visSeg.getStart() + (incl ? 0 : pol);
1223 int end = visSeg.getEnd() + (incl ? 0 : -pol);
1224 if (ensureDirection && pol == -1)
1226 // jalview doesn't deal with inverted ranges, yet.
1232 { start, end, pol < 0 ? 1 : 0 };
1238 * @return true if annotation is not to be stored in document
1240 private boolean isJalviewOnly(AlignmentAnnotation annotation)
1242 return annotation.autoCalculated || annotation.label.equals("Quality")
1243 || annotation.label.equals("Conservation")
1244 || annotation.label.equals("Consensus");
1247 boolean dojvsync = true;
1249 // boolean dojvsync = false; // disables Jalview AppData IO
1251 * list of alignment views created when updating Jalview from document.
1253 private final Vector newAlignmentViews = new Vector();
1256 * update local jalview view settings from the stored appdata (if any)
1258 public void updateJalviewFromAppdata()
1260 // recover any existing Jalview data from appdata
1261 // TODO: recover any PDB files stored as attachments in the vamsas session
1262 // and initialise the Jalview2XML.alreadyLoadedPDB hashtable with mappings
1265 final IClientAppdata cappdata = cdoc.getClientAppdata();
1266 if (cappdata != null)
1268 if (cappdata.hasClientAppdata())
1270 // TODO: how to check version of Jalview client app data and whether
1271 // it has been modified
1272 // client data is shared over all app clients
1275 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1276 fromxml.attemptversion1parse = false;
1277 fromxml.setUniqueSetSuffix("");
1278 fromxml.setObjectMappingTables(vobj2jv, jv2vobj); // mapKeysToString
1280 // mapValuesToString
1281 fromxml.setSkipList(skipList);
1282 jalview.util.jarInputStreamProvider jprovider = new jalview.util.jarInputStreamProvider()
1286 public String getFilename()
1289 // TODO Get the vamsas session ID here
1290 return "Jalview Vamsas Document Client Data";
1294 public JarInputStream getJarInputStream() throws IOException
1296 jalview.bin.Cache.log
1297 .debug("Returning client input stream for Jalview from Vamsas Document.");
1298 return new JarInputStream(cappdata.getClientInputStream());
1303 fromxml.LoadJalviewAlign(jprovider);
1305 } catch (Exception e)
1308 } catch (OutOfMemoryError e)
1317 if (cappdata.hasUserAppdata())
1319 // TODO: how to check version of Jalview user app data and whether it
1320 // has been modified
1321 // user data overrides data shared over all app clients ?
1324 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1325 fromxml.attemptversion1parse = false;
1326 fromxml.setUniqueSetSuffix("");
1327 fromxml.setSkipList(skipList);
1328 fromxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1329 mapValuesToString(jv2vobj));
1330 jalview.util.jarInputStreamProvider jarstream = new jalview.util.jarInputStreamProvider()
1334 public String getFilename()
1337 // TODO Get the vamsas session ID here
1338 return "Jalview Vamsas Document User Data";
1342 public JarInputStream getJarInputStream() throws IOException
1344 jalview.bin.Cache.log
1345 .debug("Returning user input stream for Jalview from Vamsas Document.");
1346 return new JarInputStream(cappdata.getUserInputStream());
1351 fromxml.LoadJalviewAlign(jarstream);
1353 } catch (Exception e)
1356 } catch (OutOfMemoryError e)
1366 flushAlignViewports();
1370 * remove any spurious views generated by document synchronization
1372 private void flushAlignViewports()
1374 // remove any additional viewports originally recovered from the vamsas
1376 // search for all alignframes containing viewports generated from document
1378 // and if any contain more than one view, then remove the one generated by
1380 AlignViewport views[], av = null;
1381 AlignFrame af = null;
1382 Iterator newviews = newAlignmentViews.iterator();
1383 while (newviews.hasNext())
1385 av = (AlignViewport) newviews.next();
1386 af = Desktop.getAlignFrameFor(av);
1387 // TODO implement this : af.getNumberOfViews
1388 String seqsetidobj = av.getSequenceSetId();
1389 views = Desktop.getViewports(seqsetidobj);
1390 Cache.log.debug("Found "
1391 + (views == null ? " no " : "" + views.length)
1392 + " views for '" + av.getSequenceSetId() + "'");
1393 if (views.length > 1)
1395 // we need to close the original document view.
1397 // work out how to do this by seeing if the views are gathered.
1398 // pretty clunky but the only way to do this without adding more flags
1399 // to the align frames.
1400 boolean gathered = false;
1401 String newviewid = null;
1402 AlignedCodonFrame[] mappings = av.getAlignment().getCodonFrames();
1403 for (int i = 0; i < views.length; i++)
1407 AlignFrame viewframe = Desktop.getAlignFrameFor(views[i]);
1408 if (viewframe == af)
1412 newviewid = views[i].getSequenceSetId();
1416 // lose the reference to the vamsas document created view
1420 // close the view generated by the vamsas document synchronization
1427 af.closeMenuItem_actionPerformed(false);
1429 replaceJvObjMapping(seqsetidobj, newviewid);
1430 seqsetidobj = newviewid;
1431 // not sure if we need to do this:
1433 if (false) // mappings != null)
1435 // ensure sequence mappings from vamsas document view still
1437 if (mappings != null && mappings.length > 0)
1439 jalview.structure.StructureSelectionManager
1440 .getStructureSelectionManager(Desktop.instance).addMappings(mappings);
1444 // ensure vamsas object binds to the stored views retrieved from
1446 // jalview.structure.StructureSelectionManager
1447 // .getStructureSelectionManager()
1448 // .addStructureViewerListener(viewframe.alignPanel);
1453 newAlignmentViews.clear();
1457 * replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
1460 * @param oldjvobject
1461 * @param newjvobject
1464 private void replaceJvObjMapping(Object oldjvobject, Object newjvobject)
1466 Object vobject = jv2vobj.remove(oldjvobject);
1467 if (vobject == null)
1469 // NOTE: this happens if user deletes object in one session then updates from another client
1471 "IMPLEMENTATION ERROR: old jalview object is not bound ! ("
1472 + oldjvobject + ")");
1474 if (newjvobject != null)
1476 jv2vobj.put(newjvobject, vobject);
1477 vobj2jv.put(vobject, newjvobject);
1482 * Update the jalview client and user appdata from the local jalview settings
1484 public void updateJalviewClientAppdata()
1486 final IClientAppdata cappdata = cdoc.getClientAppdata();
1487 if (cappdata != null)
1491 jalview.gui.Jalview2XML jxml = new jalview.gui.Jalview2XML();
1492 jxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1493 mapValuesToString(jv2vobj));
1494 jxml.setSkipList(skipList);
1497 jxml.SaveState(new JarOutputStream(cappdata
1498 .getClientOutputStream()));
1501 } catch (Exception e)
1503 // TODO raise GUI warning if user requests it.
1504 jalview.bin.Cache.log
1505 .error("Couldn't update jalview client application data. Giving up - local settings probably lost.",
1511 jalview.bin.Cache.log
1512 .error("Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
1517 * translate the Vobject keys to strings for use in Jalview2XML
1522 private IdentityHashMap mapValuesToString(IdentityHashMap jv2vobj2)
1524 IdentityHashMap mapped = new IdentityHashMap();
1525 Iterator keys = jv2vobj2.keySet().iterator();
1526 while (keys.hasNext())
1528 Object key = keys.next();
1529 mapped.put(key, jv2vobj2.get(key).toString());
1535 * translate the Vobject values to strings for use in Jalview2XML
1538 * @return hashtable with string values
1540 private Hashtable mapKeysToString(Hashtable vobj2jv2)
1542 Hashtable mapped = new Hashtable();
1543 Iterator keys = vobj2jv2.keySet().iterator();
1544 while (keys.hasNext())
1546 Object key = keys.next();
1547 mapped.put(key.toString(), vobj2jv2.get(key));
1553 * synchronize Jalview from the vamsas document
1555 * @return number of new views from document
1557 public int updateToJalview()
1559 VAMSAS _roots[] = cdoc.getVamsasRoots();
1561 for (int _root = 0; _root < _roots.length; _root++)
1563 VAMSAS root = _roots[_root];
1564 boolean newds = false;
1565 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1567 // ///////////////////////////////////
1569 DataSet dataset = root.getDataSet(_ds);
1570 int i, iSize = dataset.getSequenceCount();
1571 List<SequenceI> dsseqs;
1572 jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(dataset);
1574 if (jdataset == null)
1576 Cache.log.debug("Initialising new jalview dataset fields");
1578 dsseqs = new Vector();
1582 Cache.log.debug("Update jalview dataset from vamsas.");
1583 jremain = jdataset.getHeight();
1584 dsseqs = jdataset.getSequences();
1587 // TODO: test sequence merging - we preserve existing non vamsas
1588 // sequences but add in any new vamsas ones, and don't yet update any
1589 // sequence attributes
1590 for (i = 0; i < iSize; i++)
1592 Sequence vdseq = dataset.getSequence(i);
1593 jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(
1596 jalview.datamodel.SequenceI dsseq = (SequenceI) dssync.getJvobj();
1597 if (dssync.isAddfromdoc())
1601 if (vdseq.getDbRefCount() > 0)
1603 DbRef[] dbref = vdseq.getDbRef();
1604 for (int db = 0; db < dbref.length; db++)
1606 new jalview.io.vamsas.Dbref(this, dbref[db], vdseq, dsseq);
1609 dsseq.updatePDBIds();
1615 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1616 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1618 seqs[i] = dsseqs.get(i);
1619 dsseqs.set(i, null);
1621 jdataset = new jalview.datamodel.Alignment(seqs);
1622 Cache.log.debug("New vamsas dataset imported into jalview.");
1623 bindjvvobj(jdataset, dataset);
1626 // add any new dataset sequence feature annotations
1627 if (dataset.getDataSetAnnotations() != null)
1629 for (int dsa = 0; dsa < dataset.getDataSetAnnotationsCount(); dsa++)
1631 DataSetAnnotations dseta = dataset.getDataSetAnnotations(dsa);
1632 // TODO: deal with group annotation on datset sequences.
1633 if (dseta.getSeqRefCount() == 1)
1635 SequenceI dsSeq = (SequenceI) getvObj2jv((Vobject) dseta
1636 .getSeqRef(0)); // TODO: deal with group dataset
1640 jalview.bin.Cache.log
1641 .warn("Couldn't resolve jalview sequenceI for dataset object reference "
1642 + ((Vobject) dataset.getDataSetAnnotations(
1643 dsa).getSeqRef(0)).getVorbaId()
1648 if (dseta.getAnnotationElementCount() == 0)
1650 new jalview.io.vamsas.Sequencefeature(this, dseta, dsSeq);
1655 // TODO: deal with alignmentAnnotation style annotation
1656 // appearing on dataset sequences.
1657 // JBPNote: we could just add them to all alignments but
1658 // that may complicate cross references in the jalview
1661 .warn("Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
1668 .warn("Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
1672 if (dataset.getAlignmentCount() > 0)
1674 // LOAD ALIGNMENTS from DATASET
1676 for (int al = 0, nal = dataset.getAlignmentCount(); al < nal; al++)
1678 uk.ac.vamsas.objects.core.Alignment alignment = dataset
1680 // TODO check this handles multiple views properly
1681 AlignViewport av = findViewport(alignment);
1683 jalview.datamodel.AlignmentI jal = null;
1686 // TODO check that correct alignment object is retrieved when
1687 // hidden seqs exist.
1688 jal = (av.hasHiddenRows()) ? av.getAlignment()
1689 .getHiddenSequences().getFullAlignment() : av
1692 iSize = alignment.getAlignmentSequenceCount();
1693 boolean refreshal = false;
1694 Vector newasAnnots = new Vector();
1695 char gapChar = ' '; // default for new alignments read in from the
1699 dsseqs = jal.getSequences(); // for merge/update
1700 gapChar = jal.getGapCharacter();
1704 dsseqs = new Vector();
1706 char valGapchar = alignment.getGapChar().charAt(0);
1707 for (i = 0; i < iSize; i++)
1709 AlignmentSequence valseq = alignment.getAlignmentSequence(i);
1710 jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
1711 if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
1712 dsseqs) && alseq != null)
1715 // updated to sequence from the document
1719 if (valseq.getAlignmentSequenceAnnotationCount() > 0)
1721 AlignmentSequenceAnnotation[] vasannot = valseq
1722 .getAlignmentSequenceAnnotation();
1723 for (int a = 0; a < vasannot.length; a++)
1725 jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO:
1733 int se[] = getBounds(vasannot[a]);
1734 asa = getjAlignmentAnnotation(jal, vasannot[a]);
1735 asa.setSequenceRef(alseq);
1736 asa.createSequenceMapping(alseq, se[0], false); // TODO:
1747 alseq.addAlignmentAnnotation(asa);
1748 bindjvvobj(asa, vasannot[a]);
1750 newasAnnots.add(asa);
1754 // update existing annotation - can do this in place
1755 if (vasannot[a].getModifiable() == null) // TODO: USE
1761 .info("UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
1762 // TODO: should at least replace with new one - otherwise
1763 // things will break
1764 // basically do this:
1765 // int se[] = getBounds(vasannot[a]);
1766 // asa.update(getjAlignmentAnnotation(jal, vasannot[a]));
1767 // // update from another annotation object in place.
1768 // asa.createSequenceMapping(alseq, se[0], false);
1777 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1778 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1780 seqs[i] = dsseqs.get(i);
1783 jal = new jalview.datamodel.Alignment(seqs);
1784 Cache.log.debug("New vamsas alignment imported into jalview "
1785 + alignment.getVorbaId().getId());
1786 jal.setDataset(jdataset);
1788 if (newasAnnots != null && newasAnnots.size() > 0)
1790 // Add the new sequence annotations in to the alignment.
1791 for (int an = 0, anSize = newasAnnots.size(); an < anSize; an++)
1793 jal.addAnnotation((AlignmentAnnotation) newasAnnots
1795 // TODO: check if anything has to be done - like calling
1796 // adjustForAlignment or something.
1797 newasAnnots.setElementAt(null, an);
1801 // //////////////////////////////////////////
1802 // //LOAD ANNOTATIONS FOR THE ALIGNMENT
1803 // ////////////////////////////////////
1804 if (alignment.getAlignmentAnnotationCount() > 0)
1806 uk.ac.vamsas.objects.core.AlignmentAnnotation[] an = alignment
1807 .getAlignmentAnnotation();
1809 for (int j = 0; j < an.length; j++)
1811 jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(an[j]);
1814 // update or stay the same.
1815 // TODO: should at least replace with a new one - otherwise
1816 // things will break
1817 // basically do this:
1818 // jan.update(getjAlignmentAnnotation(jal, an[a])); // update
1819 // from another annotation object in place.
1822 .debug("update from vamsas alignment annotation to existing jalview alignment annotation.");
1823 if (an[j].getModifiable() == null) // TODO: USE VAMSAS
1824 // LIBRARY OBJECT LOCK
1827 // TODO: user defined annotation is totally mutable... - so
1828 // load it up or throw away if locally edited.
1830 .info("NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
1832 // TODO: compare annotation element rows
1833 // TODO: compare props.
1837 jan = getjAlignmentAnnotation(jal, an[j]);
1838 // TODO: ensure we add the alignment annotation before the
1839 // automatic annotation rows
1840 jal.addAnnotation(jan);
1841 bindjvvobj(jan, an[j]);
1846 AlignFrame alignFrame;
1849 Cache.log.debug("New alignframe for alignment "
1850 + alignment.getVorbaId());
1851 // ///////////////////////////////
1852 // construct alignment view
1853 alignFrame = new AlignFrame(jal, AlignFrame.DEFAULT_WIDTH,
1854 AlignFrame.DEFAULT_HEIGHT, alignment.getVorbaId()
1856 av = alignFrame.getViewport();
1857 newAlignmentViews.addElement(av);
1858 String title = alignment
1861 alignment.getProvenance().getEntryCount() - 1)
1863 if (alignment.getPropertyCount() > 0)
1865 for (int p = 0, pe = alignment.getPropertyCount(); p < pe; p++)
1867 if (alignment.getProperty(p).getName().equals("title"))
1869 title = alignment.getProperty(p).getContent();
1873 // TODO: automatically create meaningful title for a vamsas
1874 // alignment using its provenance.
1875 if (Cache.log.isDebugEnabled())
1877 title = title + "(" + alignment.getVorbaId() + ")";
1880 jalview.gui.Desktop.addInternalFrame(alignFrame, title,
1881 AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
1882 bindjvvobj(av.getSequenceSetId(), alignment);
1886 // find the alignFrame for jal.
1887 // TODO: fix this so we retrieve the alignFrame handing av
1888 // *directly* (JBPNote - don't understand this now)
1889 // TODO: make sure all associated views are refreshed
1890 alignFrame = Desktop.getAlignFrameFor(av);
1893 av.alignmentChanged(alignFrame.alignPanel);
1894 alignFrame.alignPanel.adjustAnnotationHeight();
1898 // /////////////////////////////////////
1899 if (alignment.getTreeCount() > 0)
1902 for (int t = 0; t < alignment.getTreeCount(); t++)
1904 jalview.io.vamsas.Tree vstree = new jalview.io.vamsas.Tree(
1905 this, alignFrame, alignment.getTree(t));
1906 TreePanel tp = null;
1907 if (vstree.isValidTree())
1909 tp = alignFrame.ShowNewickTree(vstree.getNewickTree(),
1910 vstree.getTitle(), vstree.getInputData(), 600,
1911 500, t * 20 + 50, t * 20 + 50);
1916 bindjvvobj(tp, alignment.getTree(t));
1919 vstree.UpdateSequenceTreeMap(tp);
1920 } catch (RuntimeException e)
1922 Cache.log.warn("update of labels failed.", e);
1927 Cache.log.warn("Cannot create tree for tree " + t
1929 + alignment.getTree(t).getVorbaId());
1937 // we do sequenceMappings last because they span all datasets in a vamsas
1939 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1941 DataSet dataset = root.getDataSet(_ds);
1942 if (dataset.getSequenceMappingCount() > 0)
1944 for (int sm = 0, smCount = dataset.getSequenceMappingCount(); sm < smCount; sm++)
1946 Rangetype seqmap = new jalview.io.vamsas.Sequencemapping(this,
1947 dataset.getSequenceMapping(sm));
1952 return newAlignmentViews.size();
1955 public AlignViewport findViewport(Alignment alignment)
1957 AlignViewport av = null;
1958 AlignViewport[] avs = Desktop
1959 .getViewports((String) getvObj2jv(alignment));
1967 // bitfields - should be a template in j1.5
1968 private static int HASSECSTR = 0;
1970 private static int HASVALS = 1;
1972 private static int HASHPHOB = 2;
1974 private static int HASDC = 3;
1976 private static int HASDESCSTR = 4;
1978 private static int HASTWOSTATE = 5; // not used yet.
1981 * parses the AnnotationElements - if they exist - into
1982 * jalview.datamodel.Annotation[] rows Two annotation rows are made if there
1983 * are distinct annotation for both at 'pos' and 'after pos' at any particular
1987 * @return { boolean[static int constants ], int[ae.length] - map to annotated
1988 * object frame, jalview.datamodel.Annotation[],
1989 * jalview.datamodel.Annotation[] (after)}
1991 private Object[] parseRangeAnnotation(
1992 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
1994 // set these attributes by looking in the annotation to decide what kind of
1995 // alignment annotation rows will be made
1996 // TODO: potentially we might make several annotation rows from one vamsas
1997 // alignment annotation. the jv2Vobj binding mechanism
1998 // may not quite cope with this (without binding an array of annotations to
1999 // a vamsas alignment annotation)
2000 // summary flags saying what we found over the set of annotation rows.
2001 boolean[] AeContent = new boolean[]
2002 { false, false, false, false, false };
2003 int[] rangeMap = getMapping(annotation);
2004 jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][]
2005 { new jalview.datamodel.Annotation[rangeMap.length],
2006 new jalview.datamodel.Annotation[rangeMap.length] };
2007 boolean mergeable = true; // false if 'after positions cant be placed on
2008 // same annotation row as positions.
2010 if (annotation.getAnnotationElementCount() > 0)
2012 AnnotationElement ae[] = annotation.getAnnotationElement();
2013 for (int aa = 0; aa < ae.length; aa++)
2015 int pos = (int) ae[aa].getPosition() - 1; // pos counts from 1 to
2016 // (|seg.start-seg.end|+1)
2017 if (pos >= 0 && pos < rangeMap.length)
2019 int row = ae[aa].getAfter() ? 1 : 0;
2020 if (anot[row][pos] != null)
2022 // only time this should happen is if the After flag is set.
2023 Cache.log.debug("Ignoring duplicate annotation site at " + pos);
2026 if (anot[1 - row][pos] != null)
2031 if (ae[aa].getDescription() != null)
2033 desc = ae[aa].getDescription();
2034 if (desc.length() > 0)
2036 // have imported valid description string
2037 AeContent[HASDESCSTR] = true;
2040 String dc = null; // ae[aa].getDisplayCharacter()==null ? "dc" :
2041 // ae[aa].getDisplayCharacter();
2042 String ss = null; // ae[aa].getSecondaryStructure()==null ? "ss" :
2043 // ae[aa].getSecondaryStructure();
2044 java.awt.Color colour = null;
2045 if (ae[aa].getGlyphCount() > 0)
2047 Glyph[] glyphs = ae[aa].getGlyph();
2048 for (int g = 0; g < glyphs.length; g++)
2052 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
2054 ss = glyphs[g].getContent();
2055 AeContent[HASSECSTR] = true;
2059 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
2061 Cache.log.debug("ignoring hydrophobicity glyph marker.");
2062 AeContent[HASHPHOB] = true;
2063 char c = (dc = glyphs[g].getContent()).charAt(0);
2064 // dc may get overwritten - but we still set the colour.
2065 colour = new java.awt.Color(c == '+' ? 255 : 0,
2066 c == '.' ? 255 : 0, c == '-' ? 255 : 0);
2069 else if (glyphs[g].getDict().equals(
2070 uk.ac.vamsas.objects.utils.GlyphDictionary.DEFAULT))
2072 dc = glyphs[g].getContent();
2073 AeContent[HASDC] = true;
2078 .debug("IMPLEMENTATION TODO: Ignoring unknown glyph type "
2079 + glyphs[g].getDict());
2084 if (ae[aa].getValueCount() > 0)
2086 AeContent[HASVALS] = true;
2087 if (ae[aa].getValueCount() > 1)
2089 Cache.log.warn("ignoring additional "
2090 + (ae[aa].getValueCount() - 1)
2091 + " values in annotation element.");
2093 val = ae[aa].getValue(0);
2097 anot[row][pos] = new jalview.datamodel.Annotation(
2098 (dc != null) ? dc : "", desc,
2099 (ss != null) ? ss.charAt(0) : ' ', val);
2103 anot[row][pos] = new jalview.datamodel.Annotation(
2104 (dc != null) ? dc : "", desc,
2105 (ss != null) ? ss.charAt(0) : ' ', val, colour);
2110 Cache.log.warn("Ignoring out of bound annotation element " + aa
2111 + " in " + annotation.getVorbaId().getId());
2114 // decide on how many annotation rows are needed.
2117 for (int i = 0; i < anot[0].length; i++)
2119 if (anot[1][i] != null)
2121 anot[0][i] = anot[1][i];
2122 anot[0][i].description = anot[0][i].description + " (after)";
2123 AeContent[HASDESCSTR] = true; // we have valid description string
2132 for (int i = 0; i < anot[0].length; i++)
2134 anot[1][i].description = anot[1][i].description + " (after)";
2138 { AeContent, rangeMap, anot[0], anot[1] };
2142 // no annotations to parse. Just return an empty annotationElement[]
2145 { AeContent, rangeMap, anot[0], anot[1] };
2152 * the jalview alignment to which the annotation will be attached
2153 * (ideally - freshly updated from corresponding vamsas alignment)
2155 * @return unbound jalview alignment annotation object.
2157 private jalview.datamodel.AlignmentAnnotation getjAlignmentAnnotation(
2158 jalview.datamodel.AlignmentI jal,
2159 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
2161 if (annotation == null)
2166 // hasSequenceRef=annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class);
2167 // boolean hasProvenance=hasSequenceRef ||
2168 // (annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentAnnotation.class));
2170 * int se[] = getBounds(annotation); if (se==null) se=new int[]
2171 * {0,jal.getWidth()-1};
2173 Object[] parsedRangeAnnotation = parseRangeAnnotation(annotation);
2174 String a_label = annotation.getLabel();
2175 String a_descr = annotation.getDescription();
2176 GraphLine gl = null;
2178 boolean interp = true; // cleared if annotation is DISCRETE
2179 // set type and other attributes from properties
2180 if (annotation.getPropertyCount() > 0)
2182 // look for special jalview properties
2183 uk.ac.vamsas.objects.core.Property[] props = annotation.getProperty();
2184 for (int p = 0; p < props.length; p++)
2186 if (props[p].getName().equalsIgnoreCase(DISCRETE_ANNOTATION))
2188 type = AlignmentAnnotation.BAR_GRAPH;
2191 else if (props[p].getName().equalsIgnoreCase(CONTINUOUS_ANNOTATION))
2193 type = AlignmentAnnotation.LINE_GRAPH;
2195 else if (props[p].getName().equalsIgnoreCase(THRESHOLD))
2200 val = new Float(props[p].getContent());
2201 } catch (Exception e)
2203 Cache.log.warn("Failed to parse threshold property");
2208 gl = new GraphLine(val.floatValue(), "", java.awt.Color.black);
2212 gl.value = val.floatValue();
2215 else if (props[p].getName().equalsIgnoreCase(THRESHOLD + "Name"))
2218 gl = new GraphLine(0, "", java.awt.Color.black);
2219 gl.label = props[p].getContent();
2223 jalview.datamodel.AlignmentAnnotation jan = null;
2224 if (a_label == null || a_label.length() == 0)
2226 a_label = annotation.getType();
2227 if (a_label.length() == 0)
2229 a_label = "Unamed annotation";
2232 if (a_descr == null || a_descr.length() == 0)
2234 a_descr = "Annotation of type '" + annotation.getType() + "'";
2236 if (parsedRangeAnnotation == null)
2239 .debug("Inserting empty annotation row elements for a whole-alignment annotation.");
2243 if (parsedRangeAnnotation[3] != null)
2245 Cache.log.warn("Ignoring 'After' annotation row in "
2246 + annotation.getVorbaId());
2248 jalview.datamodel.Annotation[] arow = (jalview.datamodel.Annotation[]) parsedRangeAnnotation[2];
2249 boolean[] has = (boolean[]) parsedRangeAnnotation[0];
2250 // VAMSAS: getGraph is only on derived annotation for alignments - in this
2251 // way its 'odd' - there is already an existing TODO about removing this
2252 // flag as being redundant
2254 * if((annotation.getClass().equals(uk.ac.vamsas.objects.core.
2255 * AlignmentAnnotation.class) &&
2256 * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph())
2257 * || (hasSequenceRef=true &&
2258 * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation
2259 * )annotation).getGraph())) {
2265 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default
2271 // no hints - so we ensure HPHOB display is like this.
2272 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH;
2275 // make bounds and automatic description strings for jalview user's
2276 // benefit (these shouldn't be written back to vamsas document)
2277 boolean first = true;
2278 float min = 0, max = 1;
2280 for (int i = 0; i < arow.length; i++)
2282 if (arow[i] != null)
2284 if (i - lastval > 1 && interp)
2286 // do some interpolation *between* points
2287 if (arow[lastval] != null)
2289 float interval = arow[i].value - arow[lastval].value;
2290 interval /= i - lastval;
2291 float base = arow[lastval].value;
2292 for (int ip = lastval + 1, np = 0; ip < i; np++, ip++)
2294 arow[ip] = new jalview.datamodel.Annotation("", "", ' ',
2295 interval * np + base);
2296 // NB - Interpolated points don't get a tooltip and
2302 // check range - shouldn't we have a min and max property in the
2303 // annotation object ?
2306 min = max = arow[i].value;
2311 if (arow[i].value < min)
2313 min = arow[i].value;
2315 else if (arow[i].value > max)
2317 max = arow[i].value;
2320 // make tooltip and display char value
2321 if (!has[HASDESCSTR])
2323 arow[i].description = arow[i].value + "";
2329 if (arow[i].description != null
2330 && arow[i].description.length() < 3)
2332 // copy over the description as the display char.
2333 arow[i].displayCharacter = new String(arow[i].description);
2338 // mark the position as a point used for the interpolation.
2339 arow[i].displayCharacter = arow[i].value + "";
2344 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2345 arow, min, max, type);
2349 if (annotation.getAnnotationElementCount() == 0)
2351 // empty annotation array
2352 // TODO: alignment 'features' compare rangeType spec to alignment
2353 // width - if it is not complete, then mark regions on the annotation
2356 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2358 jan.setThreshold(null);
2359 jan.annotationId = annotation.getVorbaId().toString(); // keep all the
2362 if (annotation.getLinkCount() > 0)
2364 Cache.log.warn("Ignoring " + annotation.getLinkCount()
2365 + "links added to AlignmentAnnotation.");
2367 if (annotation.getModifiable() == null
2368 || annotation.getModifiable().length() == 0) // TODO: USE VAMSAS
2372 jan.editable = true;
2376 if (annotation.getGroup() != null
2377 && annotation.getGroup().length() > 0)
2379 jan.graphGroup = Integer.parseInt(annotation.getGroup()); // TODO:
2387 } catch (Exception e)
2390 .info("UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
2400 * get real bounds of a RangeType's specification. start and end are an
2401 * inclusive range within which all segments and positions lie. TODO: refactor
2405 * @return int[] { start, end}
2407 private int[] getBounds(RangeType dseta)
2412 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2415 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2417 if (dseta.getSegCount() > 0)
2419 se = getSegRange(dseta.getSeg(0), true);
2420 for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++)
2422 int nse[] = getSegRange(dseta.getSeg(s), true);
2433 if (dseta.getPosCount() > 0)
2435 // could do a polarity for pos range too. and pass back indication of
2437 int pos = dseta.getPos(0).getI();
2440 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2442 pos = dseta.getPos(p).getI();
2459 * map from a rangeType's internal frame to the referenced object's coordinate
2463 * @return int [] { ref(pos)...} for all pos in rangeType's frame.
2465 private int[] getMapping(RangeType dseta)
2467 Vector posList = new Vector();
2471 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2474 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2476 if (dseta.getSegCount() > 0)
2478 for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++)
2480 se = getSegRange(dseta.getSeg(s), false);
2481 int se_end = se[1 - se[2]] + (se[2] == 0 ? 1 : -1);
2482 for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1)
2484 posList.add(new Integer(p));
2488 else if (dseta.getPosCount() > 0)
2490 int pos = dseta.getPos(0).getI();
2492 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2494 pos = dseta.getPos(p).getI();
2495 posList.add(new Integer(pos));
2499 if (posList != null && posList.size() > 0)
2501 int[] range = new int[posList.size()];
2502 for (int i = 0; i < range.length; i++)
2504 range[i] = ((Integer) posList.elementAt(i)).intValue();
2515 * where the from range is the local mapped range, and the to range
2516 * is the 'mapped' range in the MapRangeType
2517 * @param default unit for local
2518 * @param default unit for mapped
2521 private jalview.util.MapList parsemapType(MapType maprange, int localu,
2524 jalview.util.MapList ml = null;
2525 int[] localRange = getMapping(maprange.getLocal());
2526 int[] mappedRange = getMapping(maprange.getMapped());
2527 long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit()
2529 long mu = maprange.getMapped().hasUnit() ? maprange.getMapped()
2530 .getUnit() : mappedu;
2531 ml = new jalview.util.MapList(localRange, mappedRange, (int) lu,
2537 * initialise a range type object from a set of start/end inclusive intervals
2542 private void initRangeType(RangeType mrt, int[] range)
2544 for (int i = 0; i < range.length; i += 2)
2546 Seg vSeg = new Seg();
2547 vSeg.setStart(range[i]);
2548 vSeg.setEnd(range[i + 1]);
2554 * initialise a MapType object from a MapList object.
2560 private void initMapType(MapType maprange, jalview.util.MapList ml,
2563 maprange.setLocal(new Local());
2564 maprange.setMapped(new Mapped());
2565 initRangeType(maprange.getLocal(), ml.getFromRanges());
2566 initRangeType(maprange.getMapped(), ml.getToRanges());
2569 maprange.getLocal().setUnit(ml.getFromRatio());
2570 maprange.getLocal().setUnit(ml.getToRatio());
2575 * not needed now. Provenance getVamsasProvenance(jalview.datamodel.Provenance
2576 * jprov) { jalview.datamodel.ProvenanceEntry[] entries = null; // TODO: fix
2577 * App and Action here. Provenance prov = new Provenance();
2578 * org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
2579 * java.util.Date()); Entry provEntry;
2581 * if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
2582 * entries.length; i++) { provEntry = new Entry(); try { date = new
2583 * org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
2584 * { ex.printStackTrace();
2586 * date = new org.exolab.castor.types.Date(entries[i].getDate()); }
2587 * provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
2588 * provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
2589 * else { provEntry = new Entry(); provEntry.setDate(date);
2590 * provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
2591 * provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
2592 * prov.addEntry(provEntry); }
2596 jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
2598 // TODO: fix App and Action entries and check use of provenance in jalview.
2599 jalview.datamodel.Provenance jprov = new jalview.datamodel.Provenance();
2600 for (int i = 0; i < prov.getEntryCount(); i++)
2602 jprov.addEntry(prov.getEntry(i).getUser(), prov.getEntry(i)
2603 .getAction(), prov.getEntry(i).getDate(), prov.getEntry(i)
2612 * @return default initial provenance list for a Jalview created vamsas
2615 Provenance dummyProvenance()
2617 return dummyProvenance(null);
2620 Entry dummyPEntry(String action)
2622 Entry entry = new Entry();
2623 entry.setApp(this.provEntry.getApp());
2626 entry.setAction(action);
2630 entry.setAction("created.");
2632 entry.setDate(new java.util.Date());
2633 entry.setUser(this.provEntry.getUser());
2637 Provenance dummyProvenance(String action)
2639 Provenance prov = new Provenance();
2640 prov.addEntry(dummyPEntry(action));
2644 Entry addProvenance(Provenance p, String action)
2646 Entry dentry = dummyPEntry(action);
2651 public Entry getProvEntry()
2656 public IClientDocument getClientDocument()
2661 public IdentityHashMap getJvObjectBinding()
2666 public Hashtable getVamsasObjectBinding()
2671 public void storeSequenceMappings(AlignViewport viewport, String title)
2674 AlignViewport av = viewport;
2677 jalview.datamodel.AlignmentI jal = av.getAlignment();
2678 // /////////////////////////////////////////
2680 DataSet dataset = null;
2681 if (jal.getDataset() == null)
2683 Cache.log.warn("Creating new dataset for an alignment.");
2684 jal.setDataset(null);
2686 dataset = (DataSet) ((Alignment) getjv2vObj(viewport
2687 .getSequenceSetId())).getV_parent(); // jal.getDataset());
2688 if (dataset == null)
2690 dataset = (DataSet) getjv2vObj(jal.getDataset());
2692 .error("Can't find the correct dataset for the alignment in this view. Creating new one.");
2695 // Store any sequence mappings.
2696 if (av.getAlignment().getCodonFrames() != null
2697 && av.getAlignment().getCodonFrames().length > 0)
2699 jalview.datamodel.AlignedCodonFrame[] cframes = av.getAlignment()
2701 for (int cf = 0; cf < cframes.length; cf++)
2703 if (cframes[cf].getdnaSeqs() != null
2704 && cframes[cf].getdnaSeqs().length > 0)
2706 jalview.datamodel.SequenceI[] dmps = cframes[cf].getdnaSeqs();
2707 jalview.datamodel.Mapping[] mps = cframes[cf].getProtMappings();
2708 for (int smp = 0; smp < mps.length; smp++)
2710 uk.ac.vamsas.objects.core.SequenceType mfrom = (SequenceType) getjv2vObj(dmps[smp]);
2713 new jalview.io.vamsas.Sequencemapping(this, mps[smp],
2719 .warn("NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
2720 + dmps[smp].getDisplayId(true)
2722 + mps[smp].getTo().getName());
2728 } catch (Exception e)
2730 throw new Exception("Couldn't store sequence mappings for " + title,
2735 public void clearSkipList()
2737 if (skipList != null)
2744 * @return the skipList
2746 public Hashtable getSkipList()
2753 * the skipList to set
2755 public void setSkipList(Hashtable skipList)
2757 this.skipList = skipList;
2761 * registry for datastoreItems
2763 DatastoreRegistry dsReg = new DatastoreRegistry();
2765 public DatastoreRegistry getDatastoreRegisty()
2769 dsReg = new DatastoreRegistry();