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.
23 import jalview.bin.Cache;
24 import jalview.datamodel.AlignedCodonFrame;
25 import jalview.datamodel.AlignmentAnnotation;
26 import jalview.datamodel.GraphLine;
27 import jalview.datamodel.SequenceI;
28 import jalview.gui.AlignFrame;
29 import jalview.gui.AlignViewport;
30 import jalview.gui.Desktop;
31 import jalview.gui.TreePanel;
32 import jalview.io.vamsas.Datasetsequence;
33 import jalview.io.vamsas.DatastoreItem;
34 import jalview.io.vamsas.DatastoreRegistry;
35 import jalview.io.vamsas.Rangetype;
36 import java.io.IOException;
37 import java.util.Enumeration;
38 import java.util.HashMap;
39 import java.util.Hashtable;
40 import java.util.IdentityHashMap;
41 import java.util.Iterator;
42 import java.util.List;
43 import java.util.Vector;
44 import java.util.jar.JarInputStream;
45 import java.util.jar.JarOutputStream;
47 import uk.ac.vamsas.client.*;
48 import uk.ac.vamsas.objects.core.*;
49 import uk.ac.vamsas.objects.utils.Properties;
54 * org.exolab.castor.util.LocalConfiguration.getInstance().getProperties().setProperty(
55 * "org.exolab.castor.serializer", "org.apache.xml.serialize.XMLSerilazizer"); }
59 * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
61 public class VamsasAppDatastore
64 * Type used for general jalview generated annotation added to vamsas document
66 public static final String JALVIEW_ANNOTATION_ROW = "JalviewAnnotation";
69 * AlignmentAnnotation property to indicate that values should not be
72 public static final String DISCRETE_ANNOTATION = "discrete";
75 * continuous property - optional to specify that annotation should be
76 * represented as a continous graph line
78 private static final String CONTINUOUS_ANNOTATION = "continuous";
80 private static final String THRESHOLD = "threshold";
83 * template for provenance entries written to vamsas session document
85 Entry provEntry = null;
88 * Instance of the session document being synchronized with
93 * map Vorba (vamsas object xml ref) IDs to live jalview object references
98 * map live jalview object references to Vorba IDs
100 IdentityHashMap jv2vobj;
103 * map jalview sequence set ID (which is vorba ID for alignment) to last
104 * recorded hash value for the alignment viewport (the undo/redo hash value)
106 Hashtable alignRDHash;
108 public VamsasAppDatastore(IClientDocument cdoc, Hashtable vobj2jv,
109 IdentityHashMap jv2vobj, Entry provEntry, Hashtable alignRDHash)
112 this.vobj2jv = vobj2jv;
113 this.jv2vobj = jv2vobj;
114 this.provEntry = provEntry;
115 this.alignRDHash = alignRDHash;
120 * the skipList used to skip over views from Jalview Appdata's that we've
121 * already syncrhonized
125 private void buildSkipList()
127 skipList = new Hashtable();
128 AlignFrame[] al = Desktop.getAlignframes();
129 for (int f = 0; al != null && f < al.length; f++)
131 skipList.put(al[f].getViewport().getSequenceSetId(), al[f]);
136 * @return the Vobject bound to Jalview datamodel object
138 protected Vobject getjv2vObj(Object jvobj)
140 if (jv2vobj.containsKey(jvobj))
142 return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
144 // check if we're working with a string - then workaround
145 // the use of IdentityHashTable because different strings
146 // have different object IDs.
147 if (jvobj instanceof String)
149 Object seqsetidobj = null;
150 seqsetidobj = getVamsasObjectBinding().get(jvobj);
151 if (seqsetidobj != null)
153 if (seqsetidobj instanceof String)
155 // what is expected. object returned by av.getSequenceSetId() -
156 // reverse lookup to get the 'registered' instance of this string
157 Vobject obj = getjv2vObj(seqsetidobj);
158 if (obj != null && !(obj instanceof Alignment))
161 .warn("IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
162 + seqsetidobj + " to object " + obj);
168 Cache.log.warn("Unexpected mapping for Jalview String Object ID "
169 + seqsetidobj + " to another jalview dataset object "
175 if (Cache.log.isDebugEnabled())
177 Cache.log.debug("Returning null VorbaID binding for jalview object "
186 * @return Jalview datamodel object bound to the vamsas document object
188 protected Object getvObj2jv(uk.ac.vamsas.client.Vobject vobj)
190 VorbaId id = vobj.getVorbaId();
193 id = cdoc.registerObject(vobj);
195 .debug("Registering new object and returning null for getvObj2jv");
198 if (vobj2jv.containsKey(vobj.getVorbaId()))
200 return vobj2jv.get(vobj.getVorbaId());
205 protected void bindjvvobj(Object jvobj, uk.ac.vamsas.client.Vobject vobj)
207 VorbaId id = vobj.getVorbaId();
210 id = cdoc.registerObject(vobj);
211 if (id == null || vobj.getVorbaId() == null
212 || cdoc.getObject(id) != vobj)
214 Cache.log.error("Failed to get id for "
215 + (vobj.isRegisterable() ? "registerable"
216 : "unregisterable") + " object " + vobj);
220 if (vobj2jv.containsKey(vobj.getVorbaId())
221 && !((VorbaId) vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
224 "Warning? Overwriting existing vamsas id binding for "
225 + vobj.getVorbaId(), new Exception(
226 "Overwriting vamsas id binding."));
228 else if (jv2vobj.containsKey(jvobj)
229 && !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
232 "Warning? Overwriting existing jalview object binding for "
233 + jvobj, new Exception(
234 "Overwriting jalview object binding."));
237 * Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id "
238 * +vobj.getVorbaId()+" already bound to "+getvObj2jv(vobj)+" and "+jvobj+"
239 * already bound to "+getjv2vObj(jvobj),new Exception("Excessive call to
242 // we just update the hash's regardless!
243 Cache.log.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
244 vobj2jv.put(vobj.getVorbaId(), jvobj);
245 // JBPNote - better implementing a hybrid invertible hash.
246 jv2vobj.put(jvobj, vobj.getVorbaId());
250 * put the alignment viewed by AlignViewport into cdoc.
253 * alignViewport to be stored
255 * title for alignment
256 * @return true if alignment associated with viewport was stored/synchronized
259 public boolean storeVAMSAS(AlignViewport av, String aFtitle)
263 jalview.datamodel.AlignmentI jal = av.getAlignment();
264 jalview.datamodel.AlignmentI jds = jal.getDataset();
266 VAMSAS root = null; // will be resolved based on Dataset Parent.
267 // /////////////////////////////////////////
269 DataSet dataset = null;
272 Cache.log.warn("Creating new dataset for an alignment.");
273 jal.setDataset(null);
274 jds = jal.getDataset();
277 // try and get alignment and association for sequence set id
279 Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId());
280 if (alignment != null)
282 dataset = (DataSet) alignment.getV_parent();
286 // is the dataset already registered
287 dataset = (DataSet) getjv2vObj(jds);
292 // it might be that one of the dataset sequences does actually have a
293 // binding, so search for it indirectly. If it does, then the local
295 // must be merged with the existing vamsas dataset.
296 jalview.datamodel.SequenceI[] jdatset = jds.getSequencesArray();
297 for (int i = 0; i < jdatset.length; i++)
299 Vobject vbound = getjv2vObj(jdatset[i]);
302 if (vbound instanceof uk.ac.vamsas.objects.core.Sequence)
306 dataset = (DataSet) vbound.getV_parent();
310 if (vbound.getV_parent() != null
311 && dataset != vbound.getV_parent())
314 "IMPLEMENTATION ERROR: Cannot map an alignment of sequences from different datasets into a single alignment in the vamsas document.");
315 // This occurs because the dataset for the alignment we are
326 Cache.log.warn("Creating new vamsas dataset for alignment view "
327 + av.getSequenceSetId());
328 // we create a new dataset on the default vamsas root.
329 root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
330 dataset = new DataSet();
331 root.addDataSet(dataset);
332 bindjvvobj(jds, dataset);
333 dataset.setProvenance(dummyProvenance());
334 // dataset.getProvenance().addEntry(provEntry);
339 root = (VAMSAS) dataset.getV_parent();
343 // set new dataset and alignment sequences based on alignment Nucleotide
345 // this *will* break when alignment contains both nucleotide and amino
347 String dict = jal.isNucleotide() ? uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA
348 : uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA;
349 Vector dssmods = new Vector();
350 for (int i = 0; i < jal.getHeight(); i++)
352 SequenceI sq = jal.getSequenceAt(i).getDatasetSequence(); // only insert
356 Datasetsequence dssync = new jalview.io.vamsas.Datasetsequence(
357 this, sq, dict, dataset);
358 sequence = (Sequence) dssync.getVobj();
359 if (dssync.getModified())
361 dssmods.addElement(sequence);
365 if (dssmods.size() > 0)
369 Entry pentry = this.addProvenance(dataset.getProvenance(),
370 "updated sequences");
371 // pentry.addInput(vInput); could write in which sequences were
373 dssmods.removeAllElements();
376 // dataset.setProvenance(getVamsasProvenance(jal.getDataset().getProvenance()));
377 // ////////////////////////////////////////////
378 if (alignmentWillBeSkipped(av))
380 // TODO: trees could be written - but for the moment we just
382 // add to the JalviewXML skipList and ..
386 if (alignment == null)
388 alignment = new Alignment();
389 bindjvvobj(av.getSequenceSetId(), alignment);
390 if (alignment.getProvenance() == null)
392 alignment.setProvenance(new Provenance());
394 addProvenance(alignment.getProvenance(), "added"); // TODO: insert some
397 dataset.addAlignment(alignment);
399 Property title = new Property();
400 title.setName("title");
401 title.setType("string");
402 title.setContent(aFtitle);
403 alignment.addProperty(title);
405 alignment.setGapChar(String.valueOf(av.getGapCharacter()));
406 for (int i = 0; i < jal.getHeight(); i++)
408 syncToAlignmentSequence(jal.getSequenceAt(i), alignment, null);
410 alignRDHash.put(av.getSequenceSetId(), av.getUndoRedoHash());
414 // always prepare to clone the alignment
415 boolean alismod = av.isUndoRedoHashModified((long[]) alignRDHash
416 .get(av.getSequenceSetId()));
417 // todo: verify and update mutable alignment props.
418 // TODO: Use isLocked methods
419 if (alignment.getModifiable() == null
420 || alignment.getModifiable().length() == 0)
421 // && !alignment.isDependedOn())
423 boolean modified = false;
424 // check existing sequences in local and in document.
425 Vector docseqs = new Vector(
426 alignment.getAlignmentSequenceAsReference());
427 for (int i = 0; i < jal.getHeight(); i++)
429 modified |= syncToAlignmentSequence(jal.getSequenceAt(i),
432 if (docseqs.size() > 0)
434 // removeValignmentSequences(alignment, docseqs);
435 docseqs.removeAllElements();
437 .println("Sequence deletion from alignment is not implemented.");
445 addProvenance(alignment.getProvenance(), "Edited"); // TODO:
454 addProvenance(alignment.getProvenance(), "Attributes Edited"); // TODO:
464 System.out.println("update alignment in document.");
468 System.out.println("alignment in document left unchanged.");
473 // unbind alignment from view.
474 // create new binding and new alignment.
475 // mark trail on new alignment as being derived from old ?
477 .println("update edited alignment to new alignment in document.");
480 // ////////////////////////////////////////////
481 // SAVE Alignment Sequence Features
482 for (int i = 0, iSize = alignment.getAlignmentSequenceCount(); i < iSize; i++)
484 AlignmentSequence valseq;
485 SequenceI alseq = (SequenceI) getvObj2jv(valseq = alignment
486 .getAlignmentSequence(i));
487 if (alseq != null && alseq.getSequenceFeatures() != null)
490 * We do not put local Alignment Sequence Features into the vamsas
494 * jalview.datamodel.SequenceFeature[] features = alseq
495 * .getSequenceFeatures(); for (int f = 0; f < features.length; f++) {
496 * if (features[f] != null) { AlignmentSequenceAnnotation valseqf = (
497 * AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
500 * valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
501 * new AlignmentSequenceAnnotation(), features[i]);
502 * valseqf.setGraph(false);
503 * valseqf.addProperty(newProperty("jalview:feature"
504 * ,"boolean","true")); if (valseqf.getProvenance() == null) {
505 * valseqf.setProvenance(new Provenance()); }
506 * addProvenance(valseqf.getProvenance(), "created"); // JBPNote - //
507 * need to // update bindjvvobj(features[i], valseqf);
508 * valseq.addAlignmentSequenceAnnotation(valseqf); } } }
513 // ////////////////////////////////////////////
515 if (jal.getAlignmentAnnotation() != null)
517 jalview.datamodel.AlignmentAnnotation[] aa = jal
518 .getAlignmentAnnotation();
519 java.util.HashMap AlSeqMaps = new HashMap(); // stores int maps from
520 // alignment columns to
521 // sequence positions.
522 for (int i = 0; i < aa.length; i++)
524 if (aa[i] == null || isJalviewOnly(aa[i]))
528 if (aa[i].groupRef != null)
530 // TODO: store any group associated annotation references
532 .warn("Group associated sequence annotation is not stored in VAMSAS document.");
535 if (aa[i].sequenceRef != null)
537 // Deal with sequence associated annotation
538 Vobject sref = getjv2vObj(aa[i].sequenceRef);
539 if (sref instanceof uk.ac.vamsas.objects.core.AlignmentSequence)
541 saveAlignmentSequenceAnnotation(AlSeqMaps,
542 (AlignmentSequence) sref, aa[i]);
546 // first find the alignment sequence to associate this with.
547 for (SequenceI jvalsq : av.getAlignment().getSequences())
549 // saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
551 if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
553 Vobject alsref = getjv2vObj(jvalsq);
554 saveAlignmentSequenceAnnotation(AlSeqMaps,
555 (AlignmentSequence) alsref, aa[i]);
564 // add Alignment Annotation
565 uk.ac.vamsas.objects.core.AlignmentAnnotation an = (uk.ac.vamsas.objects.core.AlignmentAnnotation) getjv2vObj(aa[i]);
568 an = new uk.ac.vamsas.objects.core.AlignmentAnnotation();
569 an.setType(JALVIEW_ANNOTATION_ROW);
570 an.setDescription(aa[i].description);
571 alignment.addAlignmentAnnotation(an);
572 Seg vSeg = new Seg(); // TODO: refactor to have a default
573 // rangeAnnotationType initer/updater that
574 // takes a set of int ranges.
576 vSeg.setInclusive(true);
577 vSeg.setEnd(jal.getWidth());
581 an.setGraph(true); // aa[i].graph);
583 an.setLabel(aa[i].label);
584 an.setProvenance(dummyProvenance());
585 if (aa[i].graph != AlignmentAnnotation.NO_GRAPH)
587 an.setGroup(Integer.toString(aa[i].graphGroup)); // // JBPNote
602 AnnotationElement ae;
604 for (int a = 0; a < aa[i].annotations.length; a++)
606 if ((aa[i] == null) || (aa[i].annotations[a] == null))
611 ae = new AnnotationElement();
612 ae.setDescription(aa[i].annotations[a].description);
613 ae.addGlyph(new Glyph());
614 ae.getGlyph(0).setContent(
615 aa[i].annotations[a].displayCharacter); // assume
624 ae.addValue(aa[i].annotations[a].value);
626 ae.setPosition(a + 1);
627 if (aa[i].annotations[a].secondaryStructure != ' ')
629 Glyph ss = new Glyph();
630 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
632 .valueOf(aa[i].annotations[a].secondaryStructure));
635 an.addAnnotationElement(ae);
639 // an.addProperty(newProperty("jalview:editable", null,
641 // an.setModifiable(""); // TODO: This is not the way the
642 // modifiable flag is supposed to be used.
644 setAnnotationType(an, aa[i]);
646 if (aa[i].graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
649 an.setGroup(Integer.toString(aa[i].graphGroup));
650 if (aa[i].threshold != null && aa[i].threshold.displayed)
652 an.addProperty(Properties.newProperty(THRESHOLD,
653 Properties.FLOATTYPE, "" + aa[i].threshold.value));
654 if (aa[i].threshold.label != null)
656 an.addProperty(Properties.newProperty(THRESHOLD
657 + "Name", Properties.STRINGTYPE, ""
658 + aa[i].threshold.label));
667 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT
670 // verify annotation - update (perhaps)
672 .info("update alignment sequence annotation. not yet implemented.");
676 // verify annotation - update (perhaps)
678 .info("updated alignment sequence annotation added.");
684 // /////////////////////////////////////////////////////
686 // //////////////////////////////////////////////
688 // /////////////////////////////////
689 // FIND ANY ASSOCIATED TREES
690 if (Desktop.desktop != null)
692 javax.swing.JInternalFrame[] frames = Desktop.instance
695 for (int t = 0; t < frames.length; t++)
697 if (frames[t] instanceof TreePanel)
699 TreePanel tp = (TreePanel) frames[t];
701 if (tp.getViewPort().getSequenceSetId()
702 .equals(av.getSequenceSetId()))
704 DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
710 // Store Jalview specific stuff in the Jalview appData
711 // not implemented in the SimpleDoc interface.
716 ex.printStackTrace();
723 * very quick test to see if the viewport would be stored in the vamsas
724 * document. Reasons for not storing include the unaligned flag being false
725 * (for all sequences, including the hidden ones!)
728 * @return true if alignment associated with this view will be stored in
731 public boolean alignmentWillBeSkipped(AlignViewport av)
733 return (!av.getAlignment().isAligned());
736 private void addToSkipList(AlignViewport av)
738 if (skipList == null)
740 skipList = new Hashtable();
742 skipList.put(av.getSequenceSetId(), av);
746 * remove docseqs from the given alignment marking provenance appropriately
747 * and removing any references to the sequences.
752 private void removeValignmentSequences(Alignment alignment, Vector docseqs)
754 // delete these from document. This really needs to be a generic document
755 // API function derived by CASTOR.
756 Enumeration en = docseqs.elements();
757 while (en.hasMoreElements())
759 alignment.removeAlignmentSequence((AlignmentSequence) en
762 Entry pe = addProvenance(alignment.getProvenance(), "Removed "
763 + docseqs.size() + " sequences");
764 en = alignment.enumerateAlignmentAnnotation();
765 Vector toremove = new Vector();
766 while (en.hasMoreElements())
768 uk.ac.vamsas.objects.core.AlignmentAnnotation alan = (uk.ac.vamsas.objects.core.AlignmentAnnotation) en
770 if (alan.getSeqrefsCount() > 0)
773 Vector storem = new Vector();
774 Enumeration sr = alan.enumerateSeqrefs();
775 while (sr.hasMoreElements())
777 Object alsr = sr.nextElement();
778 if (docseqs.contains(alsr))
780 storem.addElement(alsr);
783 // remove references to the deleted sequences
784 sr = storem.elements();
785 while (sr.hasMoreElements())
787 alan.removeSeqrefs(sr.nextElement());
790 if (alan.getSeqrefsCount() == 0)
792 // should then delete alan from dataset
793 toremove.addElement(alan);
797 // remove any annotation that used to be associated to a specific bunch of
799 en = toremove.elements();
800 while (en.hasMoreElements())
803 .removeAlignmentAnnotation((uk.ac.vamsas.objects.core.AlignmentAnnotation) en
806 // TODO: search through alignment annotations to remove any references to
807 // this alignment sequence
811 * sync a jalview alignment seuqence into a vamsas alignment assumes all lock
812 * transformation/bindings have been sorted out before hand. creates/syncs the
813 * vamsas alignment sequence for jvalsq and adds it to the alignment if
814 * necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
815 * and these are removed after being processed w.r.t a bound jvalsq
818 private boolean syncToAlignmentSequence(SequenceI jvalsq,
819 Alignment alignment, Vector unbounddocseq)
821 boolean modal = false;
822 // todo: islocked method here
823 boolean up2doc = false;
824 AlignmentSequence alseq = (AlignmentSequence) getjv2vObj(jvalsq);
827 alseq = new AlignmentSequence();
832 if (unbounddocseq != null)
834 unbounddocseq.removeElement(alseq);
837 // boolean locked = (alignment.getModifiable()==null ||
838 // alignment.getModifiable().length()>0);
839 // TODO: VAMSAS: translate lowercase symbols to annotation ?
840 if (up2doc || !alseq.getSequence().equals(jvalsq.getSequenceAsString()))
842 alseq.setSequence(jvalsq.getSequenceAsString());
843 alseq.setStart(jvalsq.getStart());
844 alseq.setEnd(jvalsq.getEnd());
847 if (up2doc || !alseq.getName().equals(jvalsq.getName()))
850 alseq.setName(jvalsq.getName());
852 if (jvalsq.getDescription() != null
853 && (alseq.getDescription() == null || !jvalsq.getDescription()
854 .equals(alseq.getDescription())))
857 alseq.setDescription(jvalsq.getDescription());
859 if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
862 .warn("Serious Implementation error - Unbound dataset sequence in alignment: "
863 + jvalsq.getDatasetSequence());
865 alseq.setRefid(getjv2vObj(jvalsq.getDatasetSequence()));
869 alignment.addAlignmentSequence(alseq);
870 bindjvvobj(jvalsq, alseq);
872 return up2doc || modal;
876 * locally sync a jalview alignment seuqence from a vamsas alignment assumes
877 * all lock transformation/bindings have been sorted out before hand.
878 * creates/syncs the jvalsq from the alignment sequence
880 private boolean syncFromAlignmentSequence(AlignmentSequence valseq,
881 char valGapchar, char gapChar, List<SequenceI> dsseqs)
884 boolean modal = false;
885 // todo: islocked method here
886 boolean upFromdoc = false;
887 jalview.datamodel.SequenceI alseq = (SequenceI) getvObj2jv(valseq);
895 // boolean locked = (alignment.getModifiable()==null ||
896 // alignment.getModifiable().length()>0);
897 // TODO: VAMSAS: translate lowercase symbols to annotation ?
899 || !valseq.getSequence().equals(alseq.getSequenceAsString()))
901 // this might go *horribly* wrong
902 alseq.setSequence(new String(valseq.getSequence()).replace(
903 valGapchar, gapChar));
904 alseq.setStart((int) valseq.getStart());
905 alseq.setEnd((int) valseq.getEnd());
908 if (!valseq.getName().equals(alseq.getName()))
911 alseq.setName(valseq.getName());
913 if (alseq.getDescription() == null
914 || (valseq.getDescription() != null && !alseq
915 .getDescription().equals(valseq.getDescription())))
917 alseq.setDescription(valseq.getDescription());
920 if (modal && Cache.log.isDebugEnabled())
922 Cache.log.debug("Updating apparently edited sequence "
928 alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
929 .getSequence().replace(valGapchar, gapChar),
930 (int) valseq.getStart(), (int) valseq.getEnd());
932 Vobject datsetseq = (Vobject) valseq.getRefid();
933 if (datsetseq != null)
935 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
936 if (valseq.getDescription() != null)
938 alseq.setDescription(valseq.getDescription());
942 // inherit description line from dataset.
943 if (alseq.getDatasetSequence().getDescription() != null)
945 alseq.setDescription(alseq.getDatasetSequence()
960 .error("Invalid dataset sequence id (null) for alignment sequence "
961 + valseq.getVorbaId());
963 bindjvvobj(alseq, valseq);
964 alseq.setVamsasId(valseq.getVorbaId().getId());
967 Vobject datsetseq = (Vobject) valseq.getRefid();
968 if (datsetseq != null)
970 if (datsetseq != alseq.getDatasetSequence())
974 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
976 return upFromdoc || modal;
979 private void initRangeAnnotationType(RangeAnnotation an,
980 AlignmentAnnotation alan, int[] gapMap)
982 Seg vSeg = new Seg();
984 vSeg.setInclusive(true);
985 vSeg.setEnd(gapMap.length);
988 // LATER: much of this is verbatim from the alignmentAnnotation
989 // method below. suggests refactoring to make rangeAnnotation the
991 an.setDescription(alan.description);
992 an.setLabel(alan.label);
993 an.setGroup(Integer.toString(alan.graphGroup));
1002 AnnotationElement ae;
1003 for (int a = 0; a < alan.annotations.length; a++)
1005 if (alan.annotations[a] == null)
1010 ae = new AnnotationElement();
1011 ae.setDescription(alan.annotations[a].description);
1012 ae.addGlyph(new Glyph());
1013 ae.getGlyph(0).setContent(alan.annotations[a].displayCharacter); // assume
1020 if (alan.graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
1022 ae.addValue(alan.annotations[a].value);
1024 ae.setPosition(gapMap[a] + 1); // position w.r.t. AlignmentSequence
1026 if (alan.annotations[a].secondaryStructure != ' ')
1028 // we only write an annotation where it really exists.
1029 Glyph ss = new Glyph();
1030 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
1031 ss.setContent(String
1032 .valueOf(alan.annotations[a].secondaryStructure));
1035 an.addAnnotationElement(ae);
1040 private void saveDatasetSequenceAnnotation(HashMap AlSeqMaps,
1041 uk.ac.vamsas.objects.core.Sequence sref, AlignmentAnnotation alan)
1045 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1046 // objects.core.AlignmentSequence) sref;
1047 uk.ac.vamsas.objects.core.DataSetAnnotations an = (uk.ac.vamsas.objects.core.DataSetAnnotations) getjv2vObj(alan);
1048 int[] gapMap = getGapMap(AlSeqMaps, alan);
1051 an = new uk.ac.vamsas.objects.core.DataSetAnnotations();
1052 initRangeAnnotationType(an, alan, gapMap);
1054 an.setProvenance(dummyProvenance()); // get provenance as user
1055 // created, or jnet, or
1057 setAnnotationType(an, alan);
1058 an.setGroup(Integer.toString(alan.graphGroup)); // // JBPNote -
1066 if (alan.getThreshold() != null && alan.getThreshold().displayed)
1068 an.addProperty(Properties.newProperty(THRESHOLD,
1069 Properties.FLOATTYPE, "" + alan.getThreshold().value));
1070 if (alan.getThreshold().label != null)
1071 an.addProperty(Properties.newProperty(THRESHOLD + "Name",
1072 Properties.STRINGTYPE, "" + alan.getThreshold().label));
1074 ((DataSet) sref.getV_parent()).addDataSetAnnotations(an);
1075 bindjvvobj(alan, an);
1079 // update reference sequence Annotation
1080 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1083 // verify existing alignment sequence annotation is up to date
1084 System.out.println("update dataset sequence annotation.");
1088 // verify existing alignment sequence annotation is up to date
1090 .println("make new alignment dataset sequence annotation if modification has happened.");
1096 private int[] getGapMap(HashMap AlSeqMaps, AlignmentAnnotation alan)
1099 if (AlSeqMaps.containsKey(alan.sequenceRef))
1101 gapMap = (int[]) AlSeqMaps.get(alan.sequenceRef);
1105 gapMap = new int[alan.sequenceRef.getLength()];
1106 // map from alignment position to sequence position.
1107 int[] sgapMap = alan.sequenceRef.gapMap();
1108 for (int a = 0; a < sgapMap.length; a++)
1110 gapMap[sgapMap[a]] = a;
1116 private void saveAlignmentSequenceAnnotation(HashMap AlSeqMaps,
1117 AlignmentSequence alsref, AlignmentAnnotation alan)
1121 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1122 // objects.core.AlignmentSequence) sref;
1123 uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation an = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) getjv2vObj(alan);
1124 int[] gapMap = getGapMap(AlSeqMaps, alan);
1127 an = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation();
1128 initRangeAnnotationType(an, alan, gapMap);
1130 * I mean here that we don't actually have a semantic 'type' for the
1131 * annotation (this might be - score, intrinsic property, measurement,
1132 * something extracted from another program, etc)
1134 an.setType(JALVIEW_ANNOTATION_ROW); // TODO: better fix
1135 // this rough guess ;)
1136 alsref.addAlignmentSequenceAnnotation(an);
1137 bindjvvobj(alan, an);
1138 // These properties are directly supported by the
1139 // AlignmentSequenceAnnotation type.
1140 setAnnotationType(an, alan);
1141 an.setProvenance(dummyProvenance()); // get provenance as user
1142 // created, or jnet, or
1147 // update reference sequence Annotation
1148 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1151 // verify existing alignment sequence annotation is up to date
1152 System.out.println("update alignment sequence annotation.");
1156 // verify existing alignment sequence annotation is up to date
1158 .println("make new alignment sequence annotation if modification has happened.");
1164 * set vamsas annotation object type from jalview annotation
1169 private void setAnnotationType(RangeAnnotation an,
1170 AlignmentAnnotation alan)
1172 if (an instanceof AlignmentSequenceAnnotation)
1174 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1176 ((AlignmentSequenceAnnotation) an).setGraph(true);
1180 ((AlignmentSequenceAnnotation) an).setGraph(false);
1183 if (an instanceof uk.ac.vamsas.objects.core.AlignmentAnnotation)
1185 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1187 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an).setGraph(true);
1191 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an)
1197 case AlignmentAnnotation.BAR_GRAPH:
1198 an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION,
1199 Properties.BOOLEANTYPE, "true"));
1201 case AlignmentAnnotation.LINE_GRAPH:
1202 an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION,
1203 Properties.BOOLEANTYPE, "true"));
1206 // don't add any kind of discrete or continous property info.
1211 * get start<end range of segment, adjusting for inclusivity flag and
1215 * @param ensureDirection
1216 * when true - always ensure start is less than end.
1217 * @return int[] { start, end, direction} where direction==1 for range running
1218 * from end to start.
1220 private int[] getSegRange(Seg visSeg, boolean ensureDirection)
1222 boolean incl = visSeg.getInclusive();
1223 // adjust for inclusive flag.
1224 int pol = (visSeg.getStart() <= visSeg.getEnd()) ? 1 : -1; // polarity of
1226 int start = visSeg.getStart() + (incl ? 0 : pol);
1227 int end = visSeg.getEnd() + (incl ? 0 : -pol);
1228 if (ensureDirection && pol == -1)
1230 // jalview doesn't deal with inverted ranges, yet.
1236 { start, end, pol < 0 ? 1 : 0 };
1242 * @return true if annotation is not to be stored in document
1244 private boolean isJalviewOnly(AlignmentAnnotation annotation)
1246 return annotation.autoCalculated || annotation.label.equals("Quality")
1247 || annotation.label.equals("Conservation")
1248 || annotation.label.equals("Consensus");
1251 boolean dojvsync = true;
1253 // boolean dojvsync = false; // disables Jalview AppData IO
1255 * list of alignment views created when updating Jalview from document.
1257 private final Vector newAlignmentViews = new Vector();
1260 * update local jalview view settings from the stored appdata (if any)
1262 public void updateJalviewFromAppdata()
1264 // recover any existing Jalview data from appdata
1265 // TODO: recover any PDB files stored as attachments in the vamsas session
1266 // and initialise the Jalview2XML.alreadyLoadedPDB hashtable with mappings
1269 final IClientAppdata cappdata = cdoc.getClientAppdata();
1270 if (cappdata != null)
1272 if (cappdata.hasClientAppdata())
1274 // TODO: how to check version of Jalview client app data and whether
1275 // it has been modified
1276 // client data is shared over all app clients
1279 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1280 fromxml.attemptversion1parse = false;
1281 fromxml.setUniqueSetSuffix("");
1282 fromxml.setObjectMappingTables(vobj2jv, jv2vobj); // mapKeysToString
1284 // mapValuesToString
1285 fromxml.setSkipList(skipList);
1286 jalview.util.jarInputStreamProvider jprovider = new jalview.util.jarInputStreamProvider()
1290 public String getFilename()
1293 // TODO Get the vamsas session ID here
1294 return "Jalview Vamsas Document Client Data";
1298 public JarInputStream getJarInputStream() throws IOException
1300 jalview.bin.Cache.log
1301 .debug("Returning client input stream for Jalview from Vamsas Document.");
1302 return new JarInputStream(cappdata.getClientInputStream());
1307 fromxml.LoadJalviewAlign(jprovider);
1309 } catch (Exception e)
1312 } catch (OutOfMemoryError e)
1321 if (cappdata.hasUserAppdata())
1323 // TODO: how to check version of Jalview user app data and whether it
1324 // has been modified
1325 // user data overrides data shared over all app clients ?
1328 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1329 fromxml.attemptversion1parse = false;
1330 fromxml.setUniqueSetSuffix("");
1331 fromxml.setSkipList(skipList);
1332 fromxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1333 mapValuesToString(jv2vobj));
1334 jalview.util.jarInputStreamProvider jarstream = new jalview.util.jarInputStreamProvider()
1338 public String getFilename()
1341 // TODO Get the vamsas session ID here
1342 return "Jalview Vamsas Document User Data";
1346 public JarInputStream getJarInputStream() throws IOException
1348 jalview.bin.Cache.log
1349 .debug("Returning user input stream for Jalview from Vamsas Document.");
1350 return new JarInputStream(cappdata.getUserInputStream());
1355 fromxml.LoadJalviewAlign(jarstream);
1357 } catch (Exception e)
1360 } catch (OutOfMemoryError e)
1370 flushAlignViewports();
1374 * remove any spurious views generated by document synchronization
1376 private void flushAlignViewports()
1378 // remove any additional viewports originally recovered from the vamsas
1380 // search for all alignframes containing viewports generated from document
1382 // and if any contain more than one view, then remove the one generated by
1384 AlignViewport views[], av = null;
1385 AlignFrame af = null;
1386 Iterator newviews = newAlignmentViews.iterator();
1387 while (newviews.hasNext())
1389 av = (AlignViewport) newviews.next();
1390 af = Desktop.getAlignFrameFor(av);
1391 // TODO implement this : af.getNumberOfViews
1392 String seqsetidobj = av.getSequenceSetId();
1393 views = Desktop.getViewports(seqsetidobj);
1394 Cache.log.debug("Found "
1395 + (views == null ? " no " : "" + views.length)
1396 + " views for '" + av.getSequenceSetId() + "'");
1397 if (views.length > 1)
1399 // we need to close the original document view.
1401 // work out how to do this by seeing if the views are gathered.
1402 // pretty clunky but the only way to do this without adding more flags
1403 // to the align frames.
1404 boolean gathered = false;
1405 String newviewid = null;
1406 AlignedCodonFrame[] mappings = av.getAlignment().getCodonFrames();
1407 for (int i = 0; i < views.length; i++)
1411 AlignFrame viewframe = Desktop.getAlignFrameFor(views[i]);
1412 if (viewframe == af)
1416 newviewid = views[i].getSequenceSetId();
1420 // lose the reference to the vamsas document created view
1424 // close the view generated by the vamsas document synchronization
1431 af.closeMenuItem_actionPerformed(false);
1433 replaceJvObjMapping(seqsetidobj, newviewid);
1434 seqsetidobj = newviewid;
1435 // not sure if we need to do this:
1437 if (false) // mappings != null)
1439 // ensure sequence mappings from vamsas document view still
1441 if (mappings != null && mappings.length > 0)
1443 jalview.structure.StructureSelectionManager
1444 .getStructureSelectionManager(Desktop.instance)
1445 .addMappings(mappings);
1449 // ensure vamsas object binds to the stored views retrieved from
1451 // jalview.structure.StructureSelectionManager
1452 // .getStructureSelectionManager()
1453 // .addStructureViewerListener(viewframe.alignPanel);
1458 newAlignmentViews.clear();
1462 * replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
1465 * @param oldjvobject
1466 * @param newjvobject
1469 private void replaceJvObjMapping(Object oldjvobject, Object newjvobject)
1471 Object vobject = jv2vobj.remove(oldjvobject);
1472 if (vobject == null)
1474 // NOTE: this happens if user deletes object in one session then updates
1475 // from another client
1477 "IMPLEMENTATION ERROR: old jalview object is not bound ! ("
1478 + oldjvobject + ")");
1480 if (newjvobject != null)
1482 jv2vobj.put(newjvobject, vobject);
1483 vobj2jv.put(vobject, newjvobject);
1488 * Update the jalview client and user appdata from the local jalview settings
1490 public void updateJalviewClientAppdata()
1492 final IClientAppdata cappdata = cdoc.getClientAppdata();
1493 if (cappdata != null)
1497 jalview.gui.Jalview2XML jxml = new jalview.gui.Jalview2XML();
1498 jxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1499 mapValuesToString(jv2vobj));
1500 jxml.setSkipList(skipList);
1503 jxml.SaveState(new JarOutputStream(cappdata
1504 .getClientOutputStream()));
1507 } catch (Exception e)
1509 // TODO raise GUI warning if user requests it.
1510 jalview.bin.Cache.log
1511 .error("Couldn't update jalview client application data. Giving up - local settings probably lost.",
1517 jalview.bin.Cache.log
1518 .error("Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
1523 * translate the Vobject keys to strings for use in Jalview2XML
1528 private IdentityHashMap mapValuesToString(IdentityHashMap jv2vobj2)
1530 IdentityHashMap mapped = new IdentityHashMap();
1531 Iterator keys = jv2vobj2.keySet().iterator();
1532 while (keys.hasNext())
1534 Object key = keys.next();
1535 mapped.put(key, jv2vobj2.get(key).toString());
1541 * translate the Vobject values to strings for use in Jalview2XML
1544 * @return hashtable with string values
1546 private Hashtable mapKeysToString(Hashtable vobj2jv2)
1548 Hashtable mapped = new Hashtable();
1549 Iterator keys = vobj2jv2.keySet().iterator();
1550 while (keys.hasNext())
1552 Object key = keys.next();
1553 mapped.put(key.toString(), vobj2jv2.get(key));
1559 * synchronize Jalview from the vamsas document
1561 * @return number of new views from document
1563 public int updateToJalview()
1565 VAMSAS _roots[] = cdoc.getVamsasRoots();
1567 for (int _root = 0; _root < _roots.length; _root++)
1569 VAMSAS root = _roots[_root];
1570 boolean newds = false;
1571 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1573 // ///////////////////////////////////
1575 DataSet dataset = root.getDataSet(_ds);
1576 int i, iSize = dataset.getSequenceCount();
1577 List<SequenceI> dsseqs;
1578 jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(dataset);
1580 if (jdataset == null)
1582 Cache.log.debug("Initialising new jalview dataset fields");
1584 dsseqs = new Vector();
1588 Cache.log.debug("Update jalview dataset from vamsas.");
1589 jremain = jdataset.getHeight();
1590 dsseqs = jdataset.getSequences();
1593 // TODO: test sequence merging - we preserve existing non vamsas
1594 // sequences but add in any new vamsas ones, and don't yet update any
1595 // sequence attributes
1596 for (i = 0; i < iSize; i++)
1598 Sequence vdseq = dataset.getSequence(i);
1599 jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(
1602 jalview.datamodel.SequenceI dsseq = (SequenceI) dssync.getJvobj();
1603 if (dssync.isAddfromdoc())
1607 if (vdseq.getDbRefCount() > 0)
1609 DbRef[] dbref = vdseq.getDbRef();
1610 for (int db = 0; db < dbref.length; db++)
1612 new jalview.io.vamsas.Dbref(this, dbref[db], vdseq, dsseq);
1615 dsseq.updatePDBIds();
1621 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1622 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1624 seqs[i] = dsseqs.get(i);
1625 dsseqs.set(i, null);
1627 jdataset = new jalview.datamodel.Alignment(seqs);
1628 Cache.log.debug("New vamsas dataset imported into jalview.");
1629 bindjvvobj(jdataset, dataset);
1632 // add any new dataset sequence feature annotations
1633 if (dataset.getDataSetAnnotations() != null)
1635 for (int dsa = 0; dsa < dataset.getDataSetAnnotationsCount(); dsa++)
1637 DataSetAnnotations dseta = dataset.getDataSetAnnotations(dsa);
1638 // TODO: deal with group annotation on datset sequences.
1639 if (dseta.getSeqRefCount() == 1)
1641 SequenceI dsSeq = (SequenceI) getvObj2jv((Vobject) dseta
1642 .getSeqRef(0)); // TODO: deal with group dataset
1646 jalview.bin.Cache.log
1647 .warn("Couldn't resolve jalview sequenceI for dataset object reference "
1648 + ((Vobject) dataset.getDataSetAnnotations(
1649 dsa).getSeqRef(0)).getVorbaId()
1654 if (dseta.getAnnotationElementCount() == 0)
1656 new jalview.io.vamsas.Sequencefeature(this, dseta, dsSeq);
1661 // TODO: deal with alignmentAnnotation style annotation
1662 // appearing on dataset sequences.
1663 // JBPNote: we could just add them to all alignments but
1664 // that may complicate cross references in the jalview
1667 .warn("Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
1674 .warn("Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
1678 if (dataset.getAlignmentCount() > 0)
1680 // LOAD ALIGNMENTS from DATASET
1682 for (int al = 0, nal = dataset.getAlignmentCount(); al < nal; al++)
1684 uk.ac.vamsas.objects.core.Alignment alignment = dataset
1686 // TODO check this handles multiple views properly
1687 AlignViewport av = findViewport(alignment);
1689 jalview.datamodel.AlignmentI jal = null;
1692 // TODO check that correct alignment object is retrieved when
1693 // hidden seqs exist.
1694 jal = (av.hasHiddenRows()) ? av.getAlignment()
1695 .getHiddenSequences().getFullAlignment() : av
1698 iSize = alignment.getAlignmentSequenceCount();
1699 boolean refreshal = false;
1700 Vector newasAnnots = new Vector();
1701 char gapChar = ' '; // default for new alignments read in from the
1705 dsseqs = jal.getSequences(); // for merge/update
1706 gapChar = jal.getGapCharacter();
1710 dsseqs = new Vector();
1712 char valGapchar = alignment.getGapChar().charAt(0);
1713 for (i = 0; i < iSize; i++)
1715 AlignmentSequence valseq = alignment.getAlignmentSequence(i);
1716 jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
1717 if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
1718 dsseqs) && alseq != null)
1721 // updated to sequence from the document
1725 if (valseq.getAlignmentSequenceAnnotationCount() > 0)
1727 AlignmentSequenceAnnotation[] vasannot = valseq
1728 .getAlignmentSequenceAnnotation();
1729 for (int a = 0; a < vasannot.length; a++)
1731 jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO:
1739 int se[] = getBounds(vasannot[a]);
1740 asa = getjAlignmentAnnotation(jal, vasannot[a]);
1741 asa.setSequenceRef(alseq);
1742 asa.createSequenceMapping(alseq, se[0], false); // TODO:
1753 alseq.addAlignmentAnnotation(asa);
1754 bindjvvobj(asa, vasannot[a]);
1756 newasAnnots.add(asa);
1760 // update existing annotation - can do this in place
1761 if (vasannot[a].getModifiable() == null) // TODO: USE
1767 .info("UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
1768 // TODO: should at least replace with new one - otherwise
1769 // things will break
1770 // basically do this:
1771 // int se[] = getBounds(vasannot[a]);
1772 // asa.update(getjAlignmentAnnotation(jal, vasannot[a]));
1773 // // update from another annotation object in place.
1774 // asa.createSequenceMapping(alseq, se[0], false);
1783 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1784 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1786 seqs[i] = dsseqs.get(i);
1787 dsseqs.set(i, null);
1789 jal = new jalview.datamodel.Alignment(seqs);
1790 Cache.log.debug("New vamsas alignment imported into jalview "
1791 + alignment.getVorbaId().getId());
1792 jal.setDataset(jdataset);
1794 if (newasAnnots != null && newasAnnots.size() > 0)
1796 // Add the new sequence annotations in to the alignment.
1797 for (int an = 0, anSize = newasAnnots.size(); an < anSize; an++)
1799 jal.addAnnotation((AlignmentAnnotation) newasAnnots
1801 // TODO: check if anything has to be done - like calling
1802 // adjustForAlignment or something.
1803 newasAnnots.setElementAt(null, an);
1807 // //////////////////////////////////////////
1808 // //LOAD ANNOTATIONS FOR THE ALIGNMENT
1809 // ////////////////////////////////////
1810 if (alignment.getAlignmentAnnotationCount() > 0)
1812 uk.ac.vamsas.objects.core.AlignmentAnnotation[] an = alignment
1813 .getAlignmentAnnotation();
1815 for (int j = 0; j < an.length; j++)
1817 jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(an[j]);
1820 // update or stay the same.
1821 // TODO: should at least replace with a new one - otherwise
1822 // things will break
1823 // basically do this:
1824 // jan.update(getjAlignmentAnnotation(jal, an[a])); // update
1825 // from another annotation object in place.
1828 .debug("update from vamsas alignment annotation to existing jalview alignment annotation.");
1829 if (an[j].getModifiable() == null) // TODO: USE VAMSAS
1830 // LIBRARY OBJECT LOCK
1833 // TODO: user defined annotation is totally mutable... - so
1834 // load it up or throw away if locally edited.
1836 .info("NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
1838 // TODO: compare annotation element rows
1839 // TODO: compare props.
1843 jan = getjAlignmentAnnotation(jal, an[j]);
1844 // TODO: ensure we add the alignment annotation before the
1845 // automatic annotation rows
1846 jal.addAnnotation(jan);
1847 bindjvvobj(jan, an[j]);
1852 AlignFrame alignFrame;
1855 Cache.log.debug("New alignframe for alignment "
1856 + alignment.getVorbaId());
1857 // ///////////////////////////////
1858 // construct alignment view
1859 alignFrame = new AlignFrame(jal, AlignFrame.DEFAULT_WIDTH,
1860 AlignFrame.DEFAULT_HEIGHT, alignment.getVorbaId()
1862 av = alignFrame.getViewport();
1863 newAlignmentViews.addElement(av);
1864 String title = alignment
1867 alignment.getProvenance().getEntryCount() - 1)
1869 if (alignment.getPropertyCount() > 0)
1871 for (int p = 0, pe = alignment.getPropertyCount(); p < pe; p++)
1873 if (alignment.getProperty(p).getName().equals("title"))
1875 title = alignment.getProperty(p).getContent();
1879 // TODO: automatically create meaningful title for a vamsas
1880 // alignment using its provenance.
1881 if (Cache.log.isDebugEnabled())
1883 title = title + "(" + alignment.getVorbaId() + ")";
1886 jalview.gui.Desktop.addInternalFrame(alignFrame, title,
1887 AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
1888 bindjvvobj(av.getSequenceSetId(), alignment);
1892 // find the alignFrame for jal.
1893 // TODO: fix this so we retrieve the alignFrame handing av
1894 // *directly* (JBPNote - don't understand this now)
1895 // TODO: make sure all associated views are refreshed
1896 alignFrame = Desktop.getAlignFrameFor(av);
1899 av.alignmentChanged(alignFrame.alignPanel);
1900 alignFrame.alignPanel.adjustAnnotationHeight();
1904 // /////////////////////////////////////
1905 if (alignment.getTreeCount() > 0)
1908 for (int t = 0; t < alignment.getTreeCount(); t++)
1910 jalview.io.vamsas.Tree vstree = new jalview.io.vamsas.Tree(
1911 this, alignFrame, alignment.getTree(t));
1912 TreePanel tp = null;
1913 if (vstree.isValidTree())
1915 tp = alignFrame.ShowNewickTree(vstree.getNewickTree(),
1916 vstree.getTitle(), vstree.getInputData(), 600,
1917 500, t * 20 + 50, t * 20 + 50);
1922 bindjvvobj(tp, alignment.getTree(t));
1925 vstree.UpdateSequenceTreeMap(tp);
1926 } catch (RuntimeException e)
1928 Cache.log.warn("update of labels failed.", e);
1933 Cache.log.warn("Cannot create tree for tree " + t
1935 + alignment.getTree(t).getVorbaId());
1943 // we do sequenceMappings last because they span all datasets in a vamsas
1945 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1947 DataSet dataset = root.getDataSet(_ds);
1948 if (dataset.getSequenceMappingCount() > 0)
1950 for (int sm = 0, smCount = dataset.getSequenceMappingCount(); sm < smCount; sm++)
1952 Rangetype seqmap = new jalview.io.vamsas.Sequencemapping(this,
1953 dataset.getSequenceMapping(sm));
1958 return newAlignmentViews.size();
1961 public AlignViewport findViewport(Alignment alignment)
1963 AlignViewport av = null;
1964 AlignViewport[] avs = Desktop
1965 .getViewports((String) getvObj2jv(alignment));
1973 // bitfields - should be a template in j1.5
1974 private static int HASSECSTR = 0;
1976 private static int HASVALS = 1;
1978 private static int HASHPHOB = 2;
1980 private static int HASDC = 3;
1982 private static int HASDESCSTR = 4;
1984 private static int HASTWOSTATE = 5; // not used yet.
1987 * parses the AnnotationElements - if they exist - into
1988 * jalview.datamodel.Annotation[] rows Two annotation rows are made if there
1989 * are distinct annotation for both at 'pos' and 'after pos' at any particular
1993 * @return { boolean[static int constants ], int[ae.length] - map to annotated
1994 * object frame, jalview.datamodel.Annotation[],
1995 * jalview.datamodel.Annotation[] (after)}
1997 private Object[] parseRangeAnnotation(
1998 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
2000 // set these attributes by looking in the annotation to decide what kind of
2001 // alignment annotation rows will be made
2002 // TODO: potentially we might make several annotation rows from one vamsas
2003 // alignment annotation. the jv2Vobj binding mechanism
2004 // may not quite cope with this (without binding an array of annotations to
2005 // a vamsas alignment annotation)
2006 // summary flags saying what we found over the set of annotation rows.
2007 boolean[] AeContent = new boolean[]
2008 { false, false, false, false, false };
2009 int[] rangeMap = getMapping(annotation);
2010 jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][]
2011 { new jalview.datamodel.Annotation[rangeMap.length],
2012 new jalview.datamodel.Annotation[rangeMap.length] };
2013 boolean mergeable = true; // false if 'after positions cant be placed on
2014 // same annotation row as positions.
2016 if (annotation.getAnnotationElementCount() > 0)
2018 AnnotationElement ae[] = annotation.getAnnotationElement();
2019 for (int aa = 0; aa < ae.length; aa++)
2021 int pos = (int) ae[aa].getPosition() - 1; // pos counts from 1 to
2022 // (|seg.start-seg.end|+1)
2023 if (pos >= 0 && pos < rangeMap.length)
2025 int row = ae[aa].getAfter() ? 1 : 0;
2026 if (anot[row][pos] != null)
2028 // only time this should happen is if the After flag is set.
2029 Cache.log.debug("Ignoring duplicate annotation site at " + pos);
2032 if (anot[1 - row][pos] != null)
2037 if (ae[aa].getDescription() != null)
2039 desc = ae[aa].getDescription();
2040 if (desc.length() > 0)
2042 // have imported valid description string
2043 AeContent[HASDESCSTR] = true;
2046 String dc = null; // ae[aa].getDisplayCharacter()==null ? "dc" :
2047 // ae[aa].getDisplayCharacter();
2048 String ss = null; // ae[aa].getSecondaryStructure()==null ? "ss" :
2049 // ae[aa].getSecondaryStructure();
2050 java.awt.Color colour = null;
2051 if (ae[aa].getGlyphCount() > 0)
2053 Glyph[] glyphs = ae[aa].getGlyph();
2054 for (int g = 0; g < glyphs.length; g++)
2058 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
2060 ss = glyphs[g].getContent();
2061 AeContent[HASSECSTR] = true;
2065 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
2067 Cache.log.debug("ignoring hydrophobicity glyph marker.");
2068 AeContent[HASHPHOB] = true;
2069 char c = (dc = glyphs[g].getContent()).charAt(0);
2070 // dc may get overwritten - but we still set the colour.
2071 colour = new java.awt.Color(c == '+' ? 255 : 0,
2072 c == '.' ? 255 : 0, c == '-' ? 255 : 0);
2075 else if (glyphs[g].getDict().equals(
2076 uk.ac.vamsas.objects.utils.GlyphDictionary.DEFAULT))
2078 dc = glyphs[g].getContent();
2079 AeContent[HASDC] = true;
2084 .debug("IMPLEMENTATION TODO: Ignoring unknown glyph type "
2085 + glyphs[g].getDict());
2090 if (ae[aa].getValueCount() > 0)
2092 AeContent[HASVALS] = true;
2093 if (ae[aa].getValueCount() > 1)
2095 Cache.log.warn("ignoring additional "
2096 + (ae[aa].getValueCount() - 1)
2097 + " values in annotation element.");
2099 val = ae[aa].getValue(0);
2103 anot[row][pos] = new jalview.datamodel.Annotation(
2104 (dc != null) ? dc : "", desc,
2105 (ss != null) ? ss.charAt(0) : ' ', val);
2109 anot[row][pos] = new jalview.datamodel.Annotation(
2110 (dc != null) ? dc : "", desc,
2111 (ss != null) ? ss.charAt(0) : ' ', val, colour);
2116 Cache.log.warn("Ignoring out of bound annotation element " + aa
2117 + " in " + annotation.getVorbaId().getId());
2120 // decide on how many annotation rows are needed.
2123 for (int i = 0; i < anot[0].length; i++)
2125 if (anot[1][i] != null)
2127 anot[0][i] = anot[1][i];
2128 anot[0][i].description = anot[0][i].description + " (after)";
2129 AeContent[HASDESCSTR] = true; // we have valid description string
2138 for (int i = 0; i < anot[0].length; i++)
2140 anot[1][i].description = anot[1][i].description + " (after)";
2144 { AeContent, rangeMap, anot[0], anot[1] };
2148 // no annotations to parse. Just return an empty annotationElement[]
2151 { AeContent, rangeMap, anot[0], anot[1] };
2158 * the jalview alignment to which the annotation will be attached
2159 * (ideally - freshly updated from corresponding vamsas alignment)
2161 * @return unbound jalview alignment annotation object.
2163 private jalview.datamodel.AlignmentAnnotation getjAlignmentAnnotation(
2164 jalview.datamodel.AlignmentI jal,
2165 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
2167 if (annotation == null)
2172 // hasSequenceRef=annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class);
2173 // boolean hasProvenance=hasSequenceRef ||
2174 // (annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentAnnotation.class));
2176 * int se[] = getBounds(annotation); if (se==null) se=new int[]
2177 * {0,jal.getWidth()-1};
2179 Object[] parsedRangeAnnotation = parseRangeAnnotation(annotation);
2180 String a_label = annotation.getLabel();
2181 String a_descr = annotation.getDescription();
2182 GraphLine gl = null;
2184 boolean interp = true; // cleared if annotation is DISCRETE
2185 // set type and other attributes from properties
2186 if (annotation.getPropertyCount() > 0)
2188 // look for special jalview properties
2189 uk.ac.vamsas.objects.core.Property[] props = annotation.getProperty();
2190 for (int p = 0; p < props.length; p++)
2192 if (props[p].getName().equalsIgnoreCase(DISCRETE_ANNOTATION))
2194 type = AlignmentAnnotation.BAR_GRAPH;
2197 else if (props[p].getName().equalsIgnoreCase(CONTINUOUS_ANNOTATION))
2199 type = AlignmentAnnotation.LINE_GRAPH;
2201 else if (props[p].getName().equalsIgnoreCase(THRESHOLD))
2206 val = new Float(props[p].getContent());
2207 } catch (Exception e)
2209 Cache.log.warn("Failed to parse threshold property");
2214 gl = new GraphLine(val.floatValue(), "", java.awt.Color.black);
2218 gl.value = val.floatValue();
2221 else if (props[p].getName().equalsIgnoreCase(THRESHOLD + "Name"))
2224 gl = new GraphLine(0, "", java.awt.Color.black);
2225 gl.label = props[p].getContent();
2229 jalview.datamodel.AlignmentAnnotation jan = null;
2230 if (a_label == null || a_label.length() == 0)
2232 a_label = annotation.getType();
2233 if (a_label.length() == 0)
2235 a_label = "Unamed annotation";
2238 if (a_descr == null || a_descr.length() == 0)
2240 a_descr = "Annotation of type '" + annotation.getType() + "'";
2242 if (parsedRangeAnnotation == null)
2245 .debug("Inserting empty annotation row elements for a whole-alignment annotation.");
2249 if (parsedRangeAnnotation[3] != null)
2251 Cache.log.warn("Ignoring 'After' annotation row in "
2252 + annotation.getVorbaId());
2254 jalview.datamodel.Annotation[] arow = (jalview.datamodel.Annotation[]) parsedRangeAnnotation[2];
2255 boolean[] has = (boolean[]) parsedRangeAnnotation[0];
2256 // VAMSAS: getGraph is only on derived annotation for alignments - in this
2257 // way its 'odd' - there is already an existing TODO about removing this
2258 // flag as being redundant
2260 * if((annotation.getClass().equals(uk.ac.vamsas.objects.core.
2261 * AlignmentAnnotation.class) &&
2262 * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph())
2263 * || (hasSequenceRef=true &&
2264 * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation
2265 * )annotation).getGraph())) {
2271 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default
2277 // no hints - so we ensure HPHOB display is like this.
2278 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH;
2281 // make bounds and automatic description strings for jalview user's
2282 // benefit (these shouldn't be written back to vamsas document)
2283 boolean first = true;
2284 float min = 0, max = 1;
2286 for (int i = 0; i < arow.length; i++)
2288 if (arow[i] != null)
2290 if (i - lastval > 1 && interp)
2292 // do some interpolation *between* points
2293 if (arow[lastval] != null)
2295 float interval = arow[i].value - arow[lastval].value;
2296 interval /= i - lastval;
2297 float base = arow[lastval].value;
2298 for (int ip = lastval + 1, np = 0; ip < i; np++, ip++)
2300 arow[ip] = new jalview.datamodel.Annotation("", "", ' ',
2301 interval * np + base);
2302 // NB - Interpolated points don't get a tooltip and
2308 // check range - shouldn't we have a min and max property in the
2309 // annotation object ?
2312 min = max = arow[i].value;
2317 if (arow[i].value < min)
2319 min = arow[i].value;
2321 else if (arow[i].value > max)
2323 max = arow[i].value;
2326 // make tooltip and display char value
2327 if (!has[HASDESCSTR])
2329 arow[i].description = arow[i].value + "";
2335 if (arow[i].description != null
2336 && arow[i].description.length() < 3)
2338 // copy over the description as the display char.
2339 arow[i].displayCharacter = new String(arow[i].description);
2344 // mark the position as a point used for the interpolation.
2345 arow[i].displayCharacter = arow[i].value + "";
2350 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2351 arow, min, max, type);
2355 if (annotation.getAnnotationElementCount() == 0)
2357 // empty annotation array
2358 // TODO: alignment 'features' compare rangeType spec to alignment
2359 // width - if it is not complete, then mark regions on the annotation
2362 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2364 jan.setThreshold(null);
2365 jan.annotationId = annotation.getVorbaId().toString(); // keep all the
2368 if (annotation.getLinkCount() > 0)
2370 Cache.log.warn("Ignoring " + annotation.getLinkCount()
2371 + "links added to AlignmentAnnotation.");
2373 if (annotation.getModifiable() == null
2374 || annotation.getModifiable().length() == 0) // TODO: USE VAMSAS
2378 jan.editable = true;
2382 if (annotation.getGroup() != null
2383 && annotation.getGroup().length() > 0)
2385 jan.graphGroup = Integer.parseInt(annotation.getGroup()); // TODO:
2393 } catch (Exception e)
2396 .info("UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
2406 * get real bounds of a RangeType's specification. start and end are an
2407 * inclusive range within which all segments and positions lie. TODO: refactor
2411 * @return int[] { start, end}
2413 private int[] getBounds(RangeType dseta)
2418 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2421 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2423 if (dseta.getSegCount() > 0)
2425 se = getSegRange(dseta.getSeg(0), true);
2426 for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++)
2428 int nse[] = getSegRange(dseta.getSeg(s), true);
2439 if (dseta.getPosCount() > 0)
2441 // could do a polarity for pos range too. and pass back indication of
2443 int pos = dseta.getPos(0).getI();
2446 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2448 pos = dseta.getPos(p).getI();
2465 * map from a rangeType's internal frame to the referenced object's coordinate
2469 * @return int [] { ref(pos)...} for all pos in rangeType's frame.
2471 private int[] getMapping(RangeType dseta)
2473 Vector posList = new Vector();
2477 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2480 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2482 if (dseta.getSegCount() > 0)
2484 for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++)
2486 se = getSegRange(dseta.getSeg(s), false);
2487 int se_end = se[1 - se[2]] + (se[2] == 0 ? 1 : -1);
2488 for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1)
2490 posList.add(new Integer(p));
2494 else if (dseta.getPosCount() > 0)
2496 int pos = dseta.getPos(0).getI();
2498 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2500 pos = dseta.getPos(p).getI();
2501 posList.add(new Integer(pos));
2505 if (posList != null && posList.size() > 0)
2507 int[] range = new int[posList.size()];
2508 for (int i = 0; i < range.length; i++)
2510 range[i] = ((Integer) posList.elementAt(i)).intValue();
2521 * where the from range is the local mapped range, and the to range
2522 * is the 'mapped' range in the MapRangeType
2523 * @param default unit for local
2524 * @param default unit for mapped
2527 private jalview.util.MapList parsemapType(MapType maprange, int localu,
2530 jalview.util.MapList ml = null;
2531 int[] localRange = getMapping(maprange.getLocal());
2532 int[] mappedRange = getMapping(maprange.getMapped());
2533 long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit()
2535 long mu = maprange.getMapped().hasUnit() ? maprange.getMapped()
2536 .getUnit() : mappedu;
2537 ml = new jalview.util.MapList(localRange, mappedRange, (int) lu,
2543 * initialise a range type object from a set of start/end inclusive intervals
2548 private void initRangeType(RangeType mrt, int[] range)
2550 for (int i = 0; i < range.length; i += 2)
2552 Seg vSeg = new Seg();
2553 vSeg.setStart(range[i]);
2554 vSeg.setEnd(range[i + 1]);
2560 * initialise a MapType object from a MapList object.
2566 private void initMapType(MapType maprange, jalview.util.MapList ml,
2569 maprange.setLocal(new Local());
2570 maprange.setMapped(new Mapped());
2571 initRangeType(maprange.getLocal(), ml.getFromRanges());
2572 initRangeType(maprange.getMapped(), ml.getToRanges());
2575 maprange.getLocal().setUnit(ml.getFromRatio());
2576 maprange.getLocal().setUnit(ml.getToRatio());
2581 * not needed now. Provenance getVamsasProvenance(jalview.datamodel.Provenance
2582 * jprov) { jalview.datamodel.ProvenanceEntry[] entries = null; // TODO: fix
2583 * App and Action here. Provenance prov = new Provenance();
2584 * org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
2585 * java.util.Date()); Entry provEntry;
2587 * if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
2588 * entries.length; i++) { provEntry = new Entry(); try { date = new
2589 * org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
2590 * { ex.printStackTrace();
2592 * date = new org.exolab.castor.types.Date(entries[i].getDate()); }
2593 * provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
2594 * provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
2595 * else { provEntry = new Entry(); provEntry.setDate(date);
2596 * provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
2597 * provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
2598 * prov.addEntry(provEntry); }
2602 jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
2604 // TODO: fix App and Action entries and check use of provenance in jalview.
2605 jalview.datamodel.Provenance jprov = new jalview.datamodel.Provenance();
2606 for (int i = 0; i < prov.getEntryCount(); i++)
2608 jprov.addEntry(prov.getEntry(i).getUser(), prov.getEntry(i)
2609 .getAction(), prov.getEntry(i).getDate(), prov.getEntry(i)
2618 * @return default initial provenance list for a Jalview created vamsas
2621 Provenance dummyProvenance()
2623 return dummyProvenance(null);
2626 Entry dummyPEntry(String action)
2628 Entry entry = new Entry();
2629 entry.setApp(this.provEntry.getApp());
2632 entry.setAction(action);
2636 entry.setAction("created.");
2638 entry.setDate(new java.util.Date());
2639 entry.setUser(this.provEntry.getUser());
2643 Provenance dummyProvenance(String action)
2645 Provenance prov = new Provenance();
2646 prov.addEntry(dummyPEntry(action));
2650 Entry addProvenance(Provenance p, String action)
2652 Entry dentry = dummyPEntry(action);
2657 public Entry getProvEntry()
2662 public IClientDocument getClientDocument()
2667 public IdentityHashMap getJvObjectBinding()
2672 public Hashtable getVamsasObjectBinding()
2677 public void storeSequenceMappings(AlignViewport viewport, String title)
2680 AlignViewport av = viewport;
2683 jalview.datamodel.AlignmentI jal = av.getAlignment();
2684 // /////////////////////////////////////////
2686 DataSet dataset = null;
2687 if (jal.getDataset() == null)
2689 Cache.log.warn("Creating new dataset for an alignment.");
2690 jal.setDataset(null);
2692 dataset = (DataSet) ((Alignment) getjv2vObj(viewport
2693 .getSequenceSetId())).getV_parent(); // jal.getDataset());
2694 if (dataset == null)
2696 dataset = (DataSet) getjv2vObj(jal.getDataset());
2698 .error("Can't find the correct dataset for the alignment in this view. Creating new one.");
2701 // Store any sequence mappings.
2702 if (av.getAlignment().getCodonFrames() != null
2703 && av.getAlignment().getCodonFrames().length > 0)
2705 jalview.datamodel.AlignedCodonFrame[] cframes = av.getAlignment()
2707 for (int cf = 0; cf < cframes.length; cf++)
2709 if (cframes[cf].getdnaSeqs() != null
2710 && cframes[cf].getdnaSeqs().length > 0)
2712 jalview.datamodel.SequenceI[] dmps = cframes[cf].getdnaSeqs();
2713 jalview.datamodel.Mapping[] mps = cframes[cf].getProtMappings();
2714 for (int smp = 0; smp < mps.length; smp++)
2716 uk.ac.vamsas.objects.core.SequenceType mfrom = (SequenceType) getjv2vObj(dmps[smp]);
2719 new jalview.io.vamsas.Sequencemapping(this, mps[smp],
2725 .warn("NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
2726 + dmps[smp].getDisplayId(true)
2728 + mps[smp].getTo().getName());
2734 } catch (Exception e)
2736 throw new Exception("Couldn't store sequence mappings for " + title,
2741 public void clearSkipList()
2743 if (skipList != null)
2750 * @return the skipList
2752 public Hashtable getSkipList()
2759 * the skipList to set
2761 public void setSkipList(Hashtable skipList)
2763 this.skipList = skipList;
2767 * registry for datastoreItems
2769 DatastoreRegistry dsReg = new DatastoreRegistry();
2771 public DatastoreRegistry getDatastoreRegisty()
2775 dsReg = new DatastoreRegistry();