2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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())
546 // saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
548 if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
550 Vobject alsref = getjv2vObj(jvalsq);
551 saveAlignmentSequenceAnnotation(AlSeqMaps,
552 (AlignmentSequence) alsref, aa[i]);
561 // add Alignment Annotation
562 uk.ac.vamsas.objects.core.AlignmentAnnotation an = (uk.ac.vamsas.objects.core.AlignmentAnnotation) getjv2vObj(aa[i]);
565 an = new uk.ac.vamsas.objects.core.AlignmentAnnotation();
566 an.setType(JALVIEW_ANNOTATION_ROW);
567 an.setDescription(aa[i].description);
568 alignment.addAlignmentAnnotation(an);
569 Seg vSeg = new Seg(); // TODO: refactor to have a default
570 // rangeAnnotationType initer/updater that
571 // takes a set of int ranges.
573 vSeg.setInclusive(true);
574 vSeg.setEnd(jal.getWidth());
578 an.setGraph(true); // aa[i].graph);
580 an.setLabel(aa[i].label);
581 an.setProvenance(dummyProvenance());
582 if (aa[i].graph != AlignmentAnnotation.NO_GRAPH)
584 an.setGroup(Integer.toString(aa[i].graphGroup)); // // JBPNote
599 AnnotationElement ae;
601 for (int a = 0; a < aa[i].annotations.length; a++)
603 if ((aa[i] == null) || (aa[i].annotations[a] == null))
608 ae = new AnnotationElement();
609 ae.setDescription(aa[i].annotations[a].description);
610 ae.addGlyph(new Glyph());
611 ae.getGlyph(0).setContent(
612 aa[i].annotations[a].displayCharacter); // assume
621 ae.addValue(aa[i].annotations[a].value);
623 ae.setPosition(a + 1);
624 if (aa[i].annotations[a].secondaryStructure != ' ')
626 Glyph ss = new Glyph();
627 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
629 .valueOf(aa[i].annotations[a].secondaryStructure));
632 an.addAnnotationElement(ae);
636 // an.addProperty(newProperty("jalview:editable", null,
638 // an.setModifiable(""); // TODO: This is not the way the
639 // modifiable flag is supposed to be used.
641 setAnnotationType(an, aa[i]);
643 if (aa[i].graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
646 an.setGroup(Integer.toString(aa[i].graphGroup));
647 if (aa[i].threshold != null && aa[i].threshold.displayed)
649 an.addProperty(Properties.newProperty(THRESHOLD,
650 Properties.FLOATTYPE, "" + aa[i].threshold.value));
651 if (aa[i].threshold.label != null)
653 an.addProperty(Properties.newProperty(THRESHOLD
654 + "Name", Properties.STRINGTYPE, ""
655 + aa[i].threshold.label));
664 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT
667 // verify annotation - update (perhaps)
669 .info("update alignment sequence annotation. not yet implemented.");
673 // verify annotation - update (perhaps)
675 .info("updated alignment sequence annotation added.");
681 // /////////////////////////////////////////////////////
683 // //////////////////////////////////////////////
685 // /////////////////////////////////
686 // FIND ANY ASSOCIATED TREES
687 if (Desktop.desktop != null)
689 javax.swing.JInternalFrame[] frames = Desktop.instance
692 for (int t = 0; t < frames.length; t++)
694 if (frames[t] instanceof TreePanel)
696 TreePanel tp = (TreePanel) frames[t];
698 if (tp.getViewPort().getSequenceSetId()
699 .equals(av.getSequenceSetId()))
701 DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
707 // Store Jalview specific stuff in the Jalview appData
708 // not implemented in the SimpleDoc interface.
713 ex.printStackTrace();
720 * very quick test to see if the viewport would be stored in the vamsas
721 * document. Reasons for not storing include the unaligned flag being false
722 * (for all sequences, including the hidden ones!)
725 * @return true if alignment associated with this view will be stored in
728 public boolean alignmentWillBeSkipped(AlignViewport av)
730 return (!av.getAlignment().isAligned());
733 private void addToSkipList(AlignViewport av)
735 if (skipList == null)
737 skipList = new Hashtable();
739 skipList.put(av.getSequenceSetId(), av);
743 * remove docseqs from the given alignment marking provenance appropriately
744 * and removing any references to the sequences.
749 private void removeValignmentSequences(Alignment alignment, Vector docseqs)
751 // delete these from document. This really needs to be a generic document
752 // API function derived by CASTOR.
753 Enumeration en = docseqs.elements();
754 while (en.hasMoreElements())
756 alignment.removeAlignmentSequence((AlignmentSequence) en
759 Entry pe = addProvenance(alignment.getProvenance(), "Removed "
760 + docseqs.size() + " sequences");
761 en = alignment.enumerateAlignmentAnnotation();
762 Vector toremove = new Vector();
763 while (en.hasMoreElements())
765 uk.ac.vamsas.objects.core.AlignmentAnnotation alan = (uk.ac.vamsas.objects.core.AlignmentAnnotation) en
767 if (alan.getSeqrefsCount() > 0)
770 Vector storem = new Vector();
771 Enumeration sr = alan.enumerateSeqrefs();
772 while (sr.hasMoreElements())
774 Object alsr = sr.nextElement();
775 if (docseqs.contains(alsr))
777 storem.addElement(alsr);
780 // remove references to the deleted sequences
781 sr = storem.elements();
782 while (sr.hasMoreElements())
784 alan.removeSeqrefs(sr.nextElement());
787 if (alan.getSeqrefsCount() == 0)
789 // should then delete alan from dataset
790 toremove.addElement(alan);
794 // remove any annotation that used to be associated to a specific bunch of
796 en = toremove.elements();
797 while (en.hasMoreElements())
800 .removeAlignmentAnnotation((uk.ac.vamsas.objects.core.AlignmentAnnotation) en
803 // TODO: search through alignment annotations to remove any references to
804 // this alignment sequence
808 * sync a jalview alignment seuqence into a vamsas alignment assumes all lock
809 * transformation/bindings have been sorted out before hand. creates/syncs the
810 * vamsas alignment sequence for jvalsq and adds it to the alignment if
811 * necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
812 * and these are removed after being processed w.r.t a bound jvalsq
815 private boolean syncToAlignmentSequence(SequenceI jvalsq,
816 Alignment alignment, Vector unbounddocseq)
818 boolean modal = false;
819 // todo: islocked method here
820 boolean up2doc = false;
821 AlignmentSequence alseq = (AlignmentSequence) getjv2vObj(jvalsq);
824 alseq = new AlignmentSequence();
829 if (unbounddocseq != null)
831 unbounddocseq.removeElement(alseq);
834 // boolean locked = (alignment.getModifiable()==null ||
835 // alignment.getModifiable().length()>0);
836 // TODO: VAMSAS: translate lowercase symbols to annotation ?
837 if (up2doc || !alseq.getSequence().equals(jvalsq.getSequenceAsString()))
839 alseq.setSequence(jvalsq.getSequenceAsString());
840 alseq.setStart(jvalsq.getStart());
841 alseq.setEnd(jvalsq.getEnd());
844 if (up2doc || !alseq.getName().equals(jvalsq.getName()))
847 alseq.setName(jvalsq.getName());
849 if (jvalsq.getDescription() != null
850 && (alseq.getDescription() == null || !jvalsq.getDescription()
851 .equals(alseq.getDescription())))
854 alseq.setDescription(jvalsq.getDescription());
856 if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
859 .warn("Serious Implementation error - Unbound dataset sequence in alignment: "
860 + jvalsq.getDatasetSequence());
862 alseq.setRefid(getjv2vObj(jvalsq.getDatasetSequence()));
866 alignment.addAlignmentSequence(alseq);
867 bindjvvobj(jvalsq, alseq);
869 return up2doc || modal;
873 * locally sync a jalview alignment seuqence from a vamsas alignment assumes
874 * all lock transformation/bindings have been sorted out before hand.
875 * creates/syncs the jvalsq from the alignment sequence
877 private boolean syncFromAlignmentSequence(AlignmentSequence valseq,
878 char valGapchar, char gapChar, List<SequenceI> dsseqs)
881 boolean modal = false;
882 // todo: islocked method here
883 boolean upFromdoc = false;
884 jalview.datamodel.SequenceI alseq = (SequenceI) getvObj2jv(valseq);
892 // boolean locked = (alignment.getModifiable()==null ||
893 // alignment.getModifiable().length()>0);
894 // TODO: VAMSAS: translate lowercase symbols to annotation ?
896 || !valseq.getSequence().equals(alseq.getSequenceAsString()))
898 // this might go *horribly* wrong
899 alseq.setSequence(new String(valseq.getSequence()).replace(
900 valGapchar, gapChar));
901 alseq.setStart((int) valseq.getStart());
902 alseq.setEnd((int) valseq.getEnd());
905 if (!valseq.getName().equals(alseq.getName()))
908 alseq.setName(valseq.getName());
910 if (alseq.getDescription() == null
911 || (valseq.getDescription() != null && !alseq
912 .getDescription().equals(valseq.getDescription())))
914 alseq.setDescription(valseq.getDescription());
917 if (modal && Cache.log.isDebugEnabled())
919 Cache.log.debug("Updating apparently edited sequence "
925 alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
926 .getSequence().replace(valGapchar, gapChar),
927 (int) valseq.getStart(), (int) valseq.getEnd());
929 Vobject datsetseq = (Vobject) valseq.getRefid();
930 if (datsetseq != null)
932 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
933 if (valseq.getDescription() != null)
935 alseq.setDescription(valseq.getDescription());
939 // inherit description line from dataset.
940 if (alseq.getDatasetSequence().getDescription() != null)
942 alseq.setDescription(alseq.getDatasetSequence()
957 .error("Invalid dataset sequence id (null) for alignment sequence "
958 + valseq.getVorbaId());
960 bindjvvobj(alseq, valseq);
961 alseq.setVamsasId(valseq.getVorbaId().getId());
964 Vobject datsetseq = (Vobject) valseq.getRefid();
965 if (datsetseq != null)
967 if (datsetseq != alseq.getDatasetSequence())
971 alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
973 return upFromdoc || modal;
976 private void initRangeAnnotationType(RangeAnnotation an,
977 AlignmentAnnotation alan, int[] gapMap)
979 Seg vSeg = new Seg();
981 vSeg.setInclusive(true);
982 vSeg.setEnd(gapMap.length);
985 // LATER: much of this is verbatim from the alignmentAnnotation
986 // method below. suggests refactoring to make rangeAnnotation the
988 an.setDescription(alan.description);
989 an.setLabel(alan.label);
990 an.setGroup(Integer.toString(alan.graphGroup));
999 AnnotationElement ae;
1000 for (int a = 0; a < alan.annotations.length; a++)
1002 if (alan.annotations[a] == null)
1007 ae = new AnnotationElement();
1008 ae.setDescription(alan.annotations[a].description);
1009 ae.addGlyph(new Glyph());
1010 ae.getGlyph(0).setContent(alan.annotations[a].displayCharacter); // assume
1017 if (alan.graph != jalview.datamodel.AlignmentAnnotation.NO_GRAPH)
1019 ae.addValue(alan.annotations[a].value);
1021 ae.setPosition(gapMap[a] + 1); // position w.r.t. AlignmentSequence
1023 if (alan.annotations[a].secondaryStructure != ' ')
1025 // we only write an annotation where it really exists.
1026 Glyph ss = new Glyph();
1027 ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
1028 ss.setContent(String
1029 .valueOf(alan.annotations[a].secondaryStructure));
1032 an.addAnnotationElement(ae);
1037 private void saveDatasetSequenceAnnotation(HashMap AlSeqMaps,
1038 uk.ac.vamsas.objects.core.Sequence sref, AlignmentAnnotation alan)
1042 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1043 // objects.core.AlignmentSequence) sref;
1044 uk.ac.vamsas.objects.core.DataSetAnnotations an = (uk.ac.vamsas.objects.core.DataSetAnnotations) getjv2vObj(alan);
1045 int[] gapMap = getGapMap(AlSeqMaps, alan);
1048 an = new uk.ac.vamsas.objects.core.DataSetAnnotations();
1049 initRangeAnnotationType(an, alan, gapMap);
1051 an.setProvenance(dummyProvenance()); // get provenance as user
1052 // created, or jnet, or
1054 setAnnotationType(an, alan);
1055 an.setGroup(Integer.toString(alan.graphGroup)); // // JBPNote -
1063 if (alan.getThreshold() != null && alan.getThreshold().displayed)
1065 an.addProperty(Properties.newProperty(THRESHOLD,
1066 Properties.FLOATTYPE, "" + alan.getThreshold().value));
1067 if (alan.getThreshold().label != null)
1068 an.addProperty(Properties.newProperty(THRESHOLD + "Name",
1069 Properties.STRINGTYPE, "" + alan.getThreshold().label));
1071 ((DataSet) sref.getV_parent()).addDataSetAnnotations(an);
1072 bindjvvobj(alan, an);
1076 // update reference sequence Annotation
1077 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1080 // verify existing alignment sequence annotation is up to date
1081 System.out.println("update dataset sequence annotation.");
1085 // verify existing alignment sequence annotation is up to date
1087 .println("make new alignment dataset sequence annotation if modification has happened.");
1093 private int[] getGapMap(HashMap AlSeqMaps, AlignmentAnnotation alan)
1096 if (AlSeqMaps.containsKey(alan.sequenceRef))
1098 gapMap = (int[]) AlSeqMaps.get(alan.sequenceRef);
1102 gapMap = new int[alan.sequenceRef.getLength()];
1103 // map from alignment position to sequence position.
1104 int[] sgapMap = alan.sequenceRef.gapMap();
1105 for (int a = 0; a < sgapMap.length; a++)
1107 gapMap[sgapMap[a]] = a;
1113 private void saveAlignmentSequenceAnnotation(HashMap AlSeqMaps,
1114 AlignmentSequence alsref, AlignmentAnnotation alan)
1118 // objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
1119 // objects.core.AlignmentSequence) sref;
1120 uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation an = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) getjv2vObj(alan);
1121 int[] gapMap = getGapMap(AlSeqMaps, alan);
1124 an = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation();
1125 initRangeAnnotationType(an, alan, gapMap);
1127 * I mean here that we don't actually have a semantic 'type' for the
1128 * annotation (this might be - score, intrinsic property, measurement,
1129 * something extracted from another program, etc)
1131 an.setType(JALVIEW_ANNOTATION_ROW); // TODO: better fix
1132 // this rough guess ;)
1133 alsref.addAlignmentSequenceAnnotation(an);
1134 bindjvvobj(alan, an);
1135 // These properties are directly supported by the
1136 // AlignmentSequenceAnnotation type.
1137 setAnnotationType(an, alan);
1138 an.setProvenance(dummyProvenance()); // get provenance as user
1139 // created, or jnet, or
1144 // update reference sequence Annotation
1145 if (an.getModifiable() == null) // TODO: USE VAMSAS LIBRARY OBJECT LOCK
1148 // verify existing alignment sequence annotation is up to date
1149 System.out.println("update alignment sequence annotation.");
1153 // verify existing alignment sequence annotation is up to date
1155 .println("make new alignment sequence annotation if modification has happened.");
1161 * set vamsas annotation object type from jalview annotation
1166 private void setAnnotationType(RangeAnnotation an,
1167 AlignmentAnnotation alan)
1169 if (an instanceof AlignmentSequenceAnnotation)
1171 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1173 ((AlignmentSequenceAnnotation) an).setGraph(true);
1177 ((AlignmentSequenceAnnotation) an).setGraph(false);
1180 if (an instanceof uk.ac.vamsas.objects.core.AlignmentAnnotation)
1182 if (alan.graph != AlignmentAnnotation.NO_GRAPH)
1184 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an).setGraph(true);
1188 ((uk.ac.vamsas.objects.core.AlignmentAnnotation) an)
1194 case AlignmentAnnotation.BAR_GRAPH:
1195 an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION,
1196 Properties.BOOLEANTYPE, "true"));
1198 case AlignmentAnnotation.LINE_GRAPH:
1199 an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION,
1200 Properties.BOOLEANTYPE, "true"));
1203 // don't add any kind of discrete or continous property info.
1208 * get start<end range of segment, adjusting for inclusivity flag and
1212 * @param ensureDirection
1213 * when true - always ensure start is less than end.
1214 * @return int[] { start, end, direction} where direction==1 for range running
1215 * from end to start.
1217 private int[] getSegRange(Seg visSeg, boolean ensureDirection)
1219 boolean incl = visSeg.getInclusive();
1220 // adjust for inclusive flag.
1221 int pol = (visSeg.getStart() <= visSeg.getEnd()) ? 1 : -1; // polarity of
1223 int start = visSeg.getStart() + (incl ? 0 : pol);
1224 int end = visSeg.getEnd() + (incl ? 0 : -pol);
1225 if (ensureDirection && pol == -1)
1227 // jalview doesn't deal with inverted ranges, yet.
1233 { start, end, pol < 0 ? 1 : 0 };
1239 * @return true if annotation is not to be stored in document
1241 private boolean isJalviewOnly(AlignmentAnnotation annotation)
1243 return annotation.autoCalculated || annotation.label.equals("Quality")
1244 || annotation.label.equals("Conservation")
1245 || annotation.label.equals("Consensus");
1248 boolean dojvsync = true;
1250 // boolean dojvsync = false; // disables Jalview AppData IO
1252 * list of alignment views created when updating Jalview from document.
1254 private final Vector newAlignmentViews = new Vector();
1257 * update local jalview view settings from the stored appdata (if any)
1259 public void updateJalviewFromAppdata()
1261 // recover any existing Jalview data from appdata
1262 // TODO: recover any PDB files stored as attachments in the vamsas session
1263 // and initialise the Jalview2XML.alreadyLoadedPDB hashtable with mappings
1266 final IClientAppdata cappdata = cdoc.getClientAppdata();
1267 if (cappdata != null)
1269 if (cappdata.hasClientAppdata())
1271 // TODO: how to check version of Jalview client app data and whether
1272 // it has been modified
1273 // client data is shared over all app clients
1276 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1277 fromxml.attemptversion1parse = false;
1278 fromxml.setUniqueSetSuffix("");
1279 fromxml.setObjectMappingTables(vobj2jv, jv2vobj); // mapKeysToString
1281 // mapValuesToString
1282 fromxml.setSkipList(skipList);
1283 jalview.util.jarInputStreamProvider jprovider = new jalview.util.jarInputStreamProvider()
1287 public String getFilename()
1290 // TODO Get the vamsas session ID here
1291 return "Jalview Vamsas Document Client Data";
1295 public JarInputStream getJarInputStream() throws IOException
1297 jalview.bin.Cache.log
1298 .debug("Returning client input stream for Jalview from Vamsas Document.");
1299 return new JarInputStream(cappdata.getClientInputStream());
1304 fromxml.LoadJalviewAlign(jprovider);
1306 } catch (Exception e)
1309 } catch (OutOfMemoryError e)
1318 if (cappdata.hasUserAppdata())
1320 // TODO: how to check version of Jalview user app data and whether it
1321 // has been modified
1322 // user data overrides data shared over all app clients ?
1325 jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
1326 fromxml.attemptversion1parse = false;
1327 fromxml.setUniqueSetSuffix("");
1328 fromxml.setSkipList(skipList);
1329 fromxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1330 mapValuesToString(jv2vobj));
1331 jalview.util.jarInputStreamProvider jarstream = new jalview.util.jarInputStreamProvider()
1335 public String getFilename()
1338 // TODO Get the vamsas session ID here
1339 return "Jalview Vamsas Document User Data";
1343 public JarInputStream getJarInputStream() throws IOException
1345 jalview.bin.Cache.log
1346 .debug("Returning user input stream for Jalview from Vamsas Document.");
1347 return new JarInputStream(cappdata.getUserInputStream());
1352 fromxml.LoadJalviewAlign(jarstream);
1354 } catch (Exception e)
1357 } catch (OutOfMemoryError e)
1367 flushAlignViewports();
1371 * remove any spurious views generated by document synchronization
1373 private void flushAlignViewports()
1375 // remove any additional viewports originally recovered from the vamsas
1377 // search for all alignframes containing viewports generated from document
1379 // and if any contain more than one view, then remove the one generated by
1381 AlignViewport views[], av = null;
1382 AlignFrame af = null;
1383 Iterator newviews = newAlignmentViews.iterator();
1384 while (newviews.hasNext())
1386 av = (AlignViewport) newviews.next();
1387 af = Desktop.getAlignFrameFor(av);
1388 // TODO implement this : af.getNumberOfViews
1389 String seqsetidobj = av.getSequenceSetId();
1390 views = Desktop.getViewports(seqsetidobj);
1391 Cache.log.debug("Found "
1392 + (views == null ? " no " : "" + views.length)
1393 + " views for '" + av.getSequenceSetId() + "'");
1394 if (views.length > 1)
1396 // we need to close the original document view.
1398 // work out how to do this by seeing if the views are gathered.
1399 // pretty clunky but the only way to do this without adding more flags
1400 // to the align frames.
1401 boolean gathered = false;
1402 String newviewid = null;
1403 AlignedCodonFrame[] mappings = av.getAlignment().getCodonFrames();
1404 for (int i = 0; i < views.length; i++)
1408 AlignFrame viewframe = Desktop.getAlignFrameFor(views[i]);
1409 if (viewframe == af)
1413 newviewid = views[i].getSequenceSetId();
1417 // lose the reference to the vamsas document created view
1421 // close the view generated by the vamsas document synchronization
1428 af.closeMenuItem_actionPerformed(false);
1430 replaceJvObjMapping(seqsetidobj, newviewid);
1431 seqsetidobj = newviewid;
1432 // not sure if we need to do this:
1434 if (false) // mappings != null)
1436 // ensure sequence mappings from vamsas document view still
1438 if (mappings != null && mappings.length > 0)
1440 jalview.structure.StructureSelectionManager
1441 .getStructureSelectionManager(Desktop.instance)
1442 .addMappings(mappings);
1446 // ensure vamsas object binds to the stored views retrieved from
1448 // jalview.structure.StructureSelectionManager
1449 // .getStructureSelectionManager()
1450 // .addStructureViewerListener(viewframe.alignPanel);
1455 newAlignmentViews.clear();
1459 * replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
1462 * @param oldjvobject
1463 * @param newjvobject
1466 private void replaceJvObjMapping(Object oldjvobject, Object newjvobject)
1468 Object vobject = jv2vobj.remove(oldjvobject);
1469 if (vobject == null)
1471 // NOTE: this happens if user deletes object in one session then updates
1472 // from another client
1474 "IMPLEMENTATION ERROR: old jalview object is not bound ! ("
1475 + oldjvobject + ")");
1477 if (newjvobject != null)
1479 jv2vobj.put(newjvobject, vobject);
1480 vobj2jv.put(vobject, newjvobject);
1485 * Update the jalview client and user appdata from the local jalview settings
1487 public void updateJalviewClientAppdata()
1489 final IClientAppdata cappdata = cdoc.getClientAppdata();
1490 if (cappdata != null)
1494 jalview.gui.Jalview2XML jxml = new jalview.gui.Jalview2XML();
1495 jxml.setObjectMappingTables(mapKeysToString(vobj2jv),
1496 mapValuesToString(jv2vobj));
1497 jxml.setSkipList(skipList);
1500 jxml.SaveState(new JarOutputStream(cappdata
1501 .getClientOutputStream()));
1504 } catch (Exception e)
1506 // TODO raise GUI warning if user requests it.
1507 jalview.bin.Cache.log
1508 .error("Couldn't update jalview client application data. Giving up - local settings probably lost.",
1514 jalview.bin.Cache.log
1515 .error("Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
1520 * translate the Vobject keys to strings for use in Jalview2XML
1525 private IdentityHashMap mapValuesToString(IdentityHashMap jv2vobj2)
1527 IdentityHashMap mapped = new IdentityHashMap();
1528 Iterator keys = jv2vobj2.keySet().iterator();
1529 while (keys.hasNext())
1531 Object key = keys.next();
1532 mapped.put(key, jv2vobj2.get(key).toString());
1538 * translate the Vobject values to strings for use in Jalview2XML
1541 * @return hashtable with string values
1543 private Hashtable mapKeysToString(Hashtable vobj2jv2)
1545 Hashtable mapped = new Hashtable();
1546 Iterator keys = vobj2jv2.keySet().iterator();
1547 while (keys.hasNext())
1549 Object key = keys.next();
1550 mapped.put(key.toString(), vobj2jv2.get(key));
1556 * synchronize Jalview from the vamsas document
1558 * @return number of new views from document
1560 public int updateToJalview()
1562 VAMSAS _roots[] = cdoc.getVamsasRoots();
1564 for (int _root = 0; _root < _roots.length; _root++)
1566 VAMSAS root = _roots[_root];
1567 boolean newds = false;
1568 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1570 // ///////////////////////////////////
1572 DataSet dataset = root.getDataSet(_ds);
1573 int i, iSize = dataset.getSequenceCount();
1574 List<SequenceI> dsseqs;
1575 jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(dataset);
1577 if (jdataset == null)
1579 Cache.log.debug("Initialising new jalview dataset fields");
1581 dsseqs = new Vector();
1585 Cache.log.debug("Update jalview dataset from vamsas.");
1586 jremain = jdataset.getHeight();
1587 dsseqs = jdataset.getSequences();
1590 // TODO: test sequence merging - we preserve existing non vamsas
1591 // sequences but add in any new vamsas ones, and don't yet update any
1592 // sequence attributes
1593 for (i = 0; i < iSize; i++)
1595 Sequence vdseq = dataset.getSequence(i);
1596 jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(
1599 jalview.datamodel.SequenceI dsseq = (SequenceI) dssync.getJvobj();
1600 if (dssync.isAddfromdoc())
1604 if (vdseq.getDbRefCount() > 0)
1606 DbRef[] dbref = vdseq.getDbRef();
1607 for (int db = 0; db < dbref.length; db++)
1609 new jalview.io.vamsas.Dbref(this, dbref[db], vdseq, dsseq);
1612 dsseq.updatePDBIds();
1618 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1619 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1621 seqs[i] = dsseqs.get(i);
1622 dsseqs.set(i, null);
1624 jdataset = new jalview.datamodel.Alignment(seqs);
1625 Cache.log.debug("New vamsas dataset imported into jalview.");
1626 bindjvvobj(jdataset, dataset);
1629 // add any new dataset sequence feature annotations
1630 if (dataset.getDataSetAnnotations() != null)
1632 for (int dsa = 0; dsa < dataset.getDataSetAnnotationsCount(); dsa++)
1634 DataSetAnnotations dseta = dataset.getDataSetAnnotations(dsa);
1635 // TODO: deal with group annotation on datset sequences.
1636 if (dseta.getSeqRefCount() == 1)
1638 SequenceI dsSeq = (SequenceI) getvObj2jv((Vobject) dseta
1639 .getSeqRef(0)); // TODO: deal with group dataset
1643 jalview.bin.Cache.log
1644 .warn("Couldn't resolve jalview sequenceI for dataset object reference "
1645 + ((Vobject) dataset.getDataSetAnnotations(
1646 dsa).getSeqRef(0)).getVorbaId()
1651 if (dseta.getAnnotationElementCount() == 0)
1653 new jalview.io.vamsas.Sequencefeature(this, dseta, dsSeq);
1658 // TODO: deal with alignmentAnnotation style annotation
1659 // appearing on dataset sequences.
1660 // JBPNote: we could just add them to all alignments but
1661 // that may complicate cross references in the jalview
1664 .warn("Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
1671 .warn("Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
1675 if (dataset.getAlignmentCount() > 0)
1677 // LOAD ALIGNMENTS from DATASET
1679 for (int al = 0, nal = dataset.getAlignmentCount(); al < nal; al++)
1681 uk.ac.vamsas.objects.core.Alignment alignment = dataset
1683 // TODO check this handles multiple views properly
1684 AlignViewport av = findViewport(alignment);
1686 jalview.datamodel.AlignmentI jal = null;
1689 // TODO check that correct alignment object is retrieved when
1690 // hidden seqs exist.
1691 jal = (av.hasHiddenRows()) ? av.getAlignment()
1692 .getHiddenSequences().getFullAlignment() : av
1695 iSize = alignment.getAlignmentSequenceCount();
1696 boolean refreshal = false;
1697 Vector newasAnnots = new Vector();
1698 char gapChar = ' '; // default for new alignments read in from the
1702 dsseqs = jal.getSequences(); // for merge/update
1703 gapChar = jal.getGapCharacter();
1707 dsseqs = new Vector();
1709 char valGapchar = alignment.getGapChar().charAt(0);
1710 for (i = 0; i < iSize; i++)
1712 AlignmentSequence valseq = alignment.getAlignmentSequence(i);
1713 jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
1714 if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
1715 dsseqs) && alseq != null)
1718 // updated to sequence from the document
1722 if (valseq.getAlignmentSequenceAnnotationCount() > 0)
1724 AlignmentSequenceAnnotation[] vasannot = valseq
1725 .getAlignmentSequenceAnnotation();
1726 for (int a = 0; a < vasannot.length; a++)
1728 jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO:
1736 int se[] = getBounds(vasannot[a]);
1737 asa = getjAlignmentAnnotation(jal, vasannot[a]);
1738 asa.setSequenceRef(alseq);
1739 asa.createSequenceMapping(alseq, se[0], false); // TODO:
1750 alseq.addAlignmentAnnotation(asa);
1751 bindjvvobj(asa, vasannot[a]);
1753 newasAnnots.add(asa);
1757 // update existing annotation - can do this in place
1758 if (vasannot[a].getModifiable() == null) // TODO: USE
1764 .info("UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
1765 // TODO: should at least replace with new one - otherwise
1766 // things will break
1767 // basically do this:
1768 // int se[] = getBounds(vasannot[a]);
1769 // asa.update(getjAlignmentAnnotation(jal, vasannot[a]));
1770 // // update from another annotation object in place.
1771 // asa.createSequenceMapping(alseq, se[0], false);
1780 SequenceI[] seqs = new SequenceI[dsseqs.size()];
1781 for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
1783 seqs[i] = dsseqs.get(i);
1784 dsseqs.set(i, null);
1786 jal = new jalview.datamodel.Alignment(seqs);
1787 Cache.log.debug("New vamsas alignment imported into jalview "
1788 + alignment.getVorbaId().getId());
1789 jal.setDataset(jdataset);
1791 if (newasAnnots != null && newasAnnots.size() > 0)
1793 // Add the new sequence annotations in to the alignment.
1794 for (int an = 0, anSize = newasAnnots.size(); an < anSize; an++)
1796 jal.addAnnotation((AlignmentAnnotation) newasAnnots
1798 // TODO: check if anything has to be done - like calling
1799 // adjustForAlignment or something.
1800 newasAnnots.setElementAt(null, an);
1804 // //////////////////////////////////////////
1805 // //LOAD ANNOTATIONS FOR THE ALIGNMENT
1806 // ////////////////////////////////////
1807 if (alignment.getAlignmentAnnotationCount() > 0)
1809 uk.ac.vamsas.objects.core.AlignmentAnnotation[] an = alignment
1810 .getAlignmentAnnotation();
1812 for (int j = 0; j < an.length; j++)
1814 jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(an[j]);
1817 // update or stay the same.
1818 // TODO: should at least replace with a new one - otherwise
1819 // things will break
1820 // basically do this:
1821 // jan.update(getjAlignmentAnnotation(jal, an[a])); // update
1822 // from another annotation object in place.
1825 .debug("update from vamsas alignment annotation to existing jalview alignment annotation.");
1826 if (an[j].getModifiable() == null) // TODO: USE VAMSAS
1827 // LIBRARY OBJECT LOCK
1830 // TODO: user defined annotation is totally mutable... - so
1831 // load it up or throw away if locally edited.
1833 .info("NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
1835 // TODO: compare annotation element rows
1836 // TODO: compare props.
1840 jan = getjAlignmentAnnotation(jal, an[j]);
1841 // TODO: ensure we add the alignment annotation before the
1842 // automatic annotation rows
1843 jal.addAnnotation(jan);
1844 bindjvvobj(jan, an[j]);
1849 AlignFrame alignFrame;
1852 Cache.log.debug("New alignframe for alignment "
1853 + alignment.getVorbaId());
1854 // ///////////////////////////////
1855 // construct alignment view
1856 alignFrame = new AlignFrame(jal, AlignFrame.DEFAULT_WIDTH,
1857 AlignFrame.DEFAULT_HEIGHT, alignment.getVorbaId()
1859 av = alignFrame.getViewport();
1860 newAlignmentViews.addElement(av);
1861 String title = alignment
1864 alignment.getProvenance().getEntryCount() - 1)
1866 if (alignment.getPropertyCount() > 0)
1868 for (int p = 0, pe = alignment.getPropertyCount(); p < pe; p++)
1870 if (alignment.getProperty(p).getName().equals("title"))
1872 title = alignment.getProperty(p).getContent();
1876 // TODO: automatically create meaningful title for a vamsas
1877 // alignment using its provenance.
1878 if (Cache.log.isDebugEnabled())
1880 title = title + "(" + alignment.getVorbaId() + ")";
1883 jalview.gui.Desktop.addInternalFrame(alignFrame, title,
1884 AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
1885 bindjvvobj(av.getSequenceSetId(), alignment);
1889 // find the alignFrame for jal.
1890 // TODO: fix this so we retrieve the alignFrame handing av
1891 // *directly* (JBPNote - don't understand this now)
1892 // TODO: make sure all associated views are refreshed
1893 alignFrame = Desktop.getAlignFrameFor(av);
1896 av.alignmentChanged(alignFrame.alignPanel);
1897 alignFrame.alignPanel.adjustAnnotationHeight();
1901 // /////////////////////////////////////
1902 if (alignment.getTreeCount() > 0)
1905 for (int t = 0; t < alignment.getTreeCount(); t++)
1907 jalview.io.vamsas.Tree vstree = new jalview.io.vamsas.Tree(
1908 this, alignFrame, alignment.getTree(t));
1909 TreePanel tp = null;
1910 if (vstree.isValidTree())
1912 tp = alignFrame.ShowNewickTree(vstree.getNewickTree(),
1913 vstree.getTitle(), vstree.getInputData(), 600,
1914 500, t * 20 + 50, t * 20 + 50);
1919 bindjvvobj(tp, alignment.getTree(t));
1922 vstree.UpdateSequenceTreeMap(tp);
1923 } catch (RuntimeException e)
1925 Cache.log.warn("update of labels failed.", e);
1930 Cache.log.warn("Cannot create tree for tree " + t
1932 + alignment.getTree(t).getVorbaId());
1940 // we do sequenceMappings last because they span all datasets in a vamsas
1942 for (int _ds = 0, _nds = root.getDataSetCount(); _ds < _nds; _ds++)
1944 DataSet dataset = root.getDataSet(_ds);
1945 if (dataset.getSequenceMappingCount() > 0)
1947 for (int sm = 0, smCount = dataset.getSequenceMappingCount(); sm < smCount; sm++)
1949 Rangetype seqmap = new jalview.io.vamsas.Sequencemapping(this,
1950 dataset.getSequenceMapping(sm));
1955 return newAlignmentViews.size();
1958 public AlignViewport findViewport(Alignment alignment)
1960 AlignViewport av = null;
1961 AlignViewport[] avs = Desktop
1962 .getViewports((String) getvObj2jv(alignment));
1970 // bitfields - should be a template in j1.5
1971 private static int HASSECSTR = 0;
1973 private static int HASVALS = 1;
1975 private static int HASHPHOB = 2;
1977 private static int HASDC = 3;
1979 private static int HASDESCSTR = 4;
1981 private static int HASTWOSTATE = 5; // not used yet.
1984 * parses the AnnotationElements - if they exist - into
1985 * jalview.datamodel.Annotation[] rows Two annotation rows are made if there
1986 * are distinct annotation for both at 'pos' and 'after pos' at any particular
1990 * @return { boolean[static int constants ], int[ae.length] - map to annotated
1991 * object frame, jalview.datamodel.Annotation[],
1992 * jalview.datamodel.Annotation[] (after)}
1994 private Object[] parseRangeAnnotation(
1995 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
1997 // set these attributes by looking in the annotation to decide what kind of
1998 // alignment annotation rows will be made
1999 // TODO: potentially we might make several annotation rows from one vamsas
2000 // alignment annotation. the jv2Vobj binding mechanism
2001 // may not quite cope with this (without binding an array of annotations to
2002 // a vamsas alignment annotation)
2003 // summary flags saying what we found over the set of annotation rows.
2004 boolean[] AeContent = new boolean[]
2005 { false, false, false, false, false };
2006 int[] rangeMap = getMapping(annotation);
2007 jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][]
2008 { new jalview.datamodel.Annotation[rangeMap.length],
2009 new jalview.datamodel.Annotation[rangeMap.length] };
2010 boolean mergeable = true; // false if 'after positions cant be placed on
2011 // same annotation row as positions.
2013 if (annotation.getAnnotationElementCount() > 0)
2015 AnnotationElement ae[] = annotation.getAnnotationElement();
2016 for (int aa = 0; aa < ae.length; aa++)
2018 int pos = (int) ae[aa].getPosition() - 1; // pos counts from 1 to
2019 // (|seg.start-seg.end|+1)
2020 if (pos >= 0 && pos < rangeMap.length)
2022 int row = ae[aa].getAfter() ? 1 : 0;
2023 if (anot[row][pos] != null)
2025 // only time this should happen is if the After flag is set.
2026 Cache.log.debug("Ignoring duplicate annotation site at " + pos);
2029 if (anot[1 - row][pos] != null)
2034 if (ae[aa].getDescription() != null)
2036 desc = ae[aa].getDescription();
2037 if (desc.length() > 0)
2039 // have imported valid description string
2040 AeContent[HASDESCSTR] = true;
2043 String dc = null; // ae[aa].getDisplayCharacter()==null ? "dc" :
2044 // ae[aa].getDisplayCharacter();
2045 String ss = null; // ae[aa].getSecondaryStructure()==null ? "ss" :
2046 // ae[aa].getSecondaryStructure();
2047 java.awt.Color colour = null;
2048 if (ae[aa].getGlyphCount() > 0)
2050 Glyph[] glyphs = ae[aa].getGlyph();
2051 for (int g = 0; g < glyphs.length; g++)
2055 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
2057 ss = glyphs[g].getContent();
2058 AeContent[HASSECSTR] = true;
2062 .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
2064 Cache.log.debug("ignoring hydrophobicity glyph marker.");
2065 AeContent[HASHPHOB] = true;
2066 char c = (dc = glyphs[g].getContent()).charAt(0);
2067 // dc may get overwritten - but we still set the colour.
2068 colour = new java.awt.Color(c == '+' ? 255 : 0,
2069 c == '.' ? 255 : 0, c == '-' ? 255 : 0);
2072 else if (glyphs[g].getDict().equals(
2073 uk.ac.vamsas.objects.utils.GlyphDictionary.DEFAULT))
2075 dc = glyphs[g].getContent();
2076 AeContent[HASDC] = true;
2081 .debug("IMPLEMENTATION TODO: Ignoring unknown glyph type "
2082 + glyphs[g].getDict());
2087 if (ae[aa].getValueCount() > 0)
2089 AeContent[HASVALS] = true;
2090 if (ae[aa].getValueCount() > 1)
2092 Cache.log.warn("ignoring additional "
2093 + (ae[aa].getValueCount() - 1)
2094 + " values in annotation element.");
2096 val = ae[aa].getValue(0);
2100 anot[row][pos] = new jalview.datamodel.Annotation(
2101 (dc != null) ? dc : "", desc,
2102 (ss != null) ? ss.charAt(0) : ' ', val);
2106 anot[row][pos] = new jalview.datamodel.Annotation(
2107 (dc != null) ? dc : "", desc,
2108 (ss != null) ? ss.charAt(0) : ' ', val, colour);
2113 Cache.log.warn("Ignoring out of bound annotation element " + aa
2114 + " in " + annotation.getVorbaId().getId());
2117 // decide on how many annotation rows are needed.
2120 for (int i = 0; i < anot[0].length; i++)
2122 if (anot[1][i] != null)
2124 anot[0][i] = anot[1][i];
2125 anot[0][i].description = anot[0][i].description + " (after)";
2126 AeContent[HASDESCSTR] = true; // we have valid description string
2135 for (int i = 0; i < anot[0].length; i++)
2137 anot[1][i].description = anot[1][i].description + " (after)";
2141 { AeContent, rangeMap, anot[0], anot[1] };
2145 // no annotations to parse. Just return an empty annotationElement[]
2148 { AeContent, rangeMap, anot[0], anot[1] };
2155 * the jalview alignment to which the annotation will be attached
2156 * (ideally - freshly updated from corresponding vamsas alignment)
2158 * @return unbound jalview alignment annotation object.
2160 private jalview.datamodel.AlignmentAnnotation getjAlignmentAnnotation(
2161 jalview.datamodel.AlignmentI jal,
2162 uk.ac.vamsas.objects.core.RangeAnnotation annotation)
2164 if (annotation == null)
2169 // hasSequenceRef=annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class);
2170 // boolean hasProvenance=hasSequenceRef ||
2171 // (annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentAnnotation.class));
2173 * int se[] = getBounds(annotation); if (se==null) se=new int[]
2174 * {0,jal.getWidth()-1};
2176 Object[] parsedRangeAnnotation = parseRangeAnnotation(annotation);
2177 String a_label = annotation.getLabel();
2178 String a_descr = annotation.getDescription();
2179 GraphLine gl = null;
2181 boolean interp = true; // cleared if annotation is DISCRETE
2182 // set type and other attributes from properties
2183 if (annotation.getPropertyCount() > 0)
2185 // look for special jalview properties
2186 uk.ac.vamsas.objects.core.Property[] props = annotation.getProperty();
2187 for (int p = 0; p < props.length; p++)
2189 if (props[p].getName().equalsIgnoreCase(DISCRETE_ANNOTATION))
2191 type = AlignmentAnnotation.BAR_GRAPH;
2194 else if (props[p].getName().equalsIgnoreCase(CONTINUOUS_ANNOTATION))
2196 type = AlignmentAnnotation.LINE_GRAPH;
2198 else if (props[p].getName().equalsIgnoreCase(THRESHOLD))
2203 val = new Float(props[p].getContent());
2204 } catch (Exception e)
2206 Cache.log.warn("Failed to parse threshold property");
2211 gl = new GraphLine(val.floatValue(), "", java.awt.Color.black);
2215 gl.value = val.floatValue();
2218 else if (props[p].getName().equalsIgnoreCase(THRESHOLD + "Name"))
2221 gl = new GraphLine(0, "", java.awt.Color.black);
2222 gl.label = props[p].getContent();
2226 jalview.datamodel.AlignmentAnnotation jan = null;
2227 if (a_label == null || a_label.length() == 0)
2229 a_label = annotation.getType();
2230 if (a_label.length() == 0)
2232 a_label = "Unamed annotation";
2235 if (a_descr == null || a_descr.length() == 0)
2237 a_descr = "Annotation of type '" + annotation.getType() + "'";
2239 if (parsedRangeAnnotation == null)
2242 .debug("Inserting empty annotation row elements for a whole-alignment annotation.");
2246 if (parsedRangeAnnotation[3] != null)
2248 Cache.log.warn("Ignoring 'After' annotation row in "
2249 + annotation.getVorbaId());
2251 jalview.datamodel.Annotation[] arow = (jalview.datamodel.Annotation[]) parsedRangeAnnotation[2];
2252 boolean[] has = (boolean[]) parsedRangeAnnotation[0];
2253 // VAMSAS: getGraph is only on derived annotation for alignments - in this
2254 // way its 'odd' - there is already an existing TODO about removing this
2255 // flag as being redundant
2257 * if((annotation.getClass().equals(uk.ac.vamsas.objects.core.
2258 * AlignmentAnnotation.class) &&
2259 * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph())
2260 * || (hasSequenceRef=true &&
2261 * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation
2262 * )annotation).getGraph())) {
2268 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default
2274 // no hints - so we ensure HPHOB display is like this.
2275 type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH;
2278 // make bounds and automatic description strings for jalview user's
2279 // benefit (these shouldn't be written back to vamsas document)
2280 boolean first = true;
2281 float min = 0, max = 1;
2283 for (int i = 0; i < arow.length; i++)
2285 if (arow[i] != null)
2287 if (i - lastval > 1 && interp)
2289 // do some interpolation *between* points
2290 if (arow[lastval] != null)
2292 float interval = arow[i].value - arow[lastval].value;
2293 interval /= i - lastval;
2294 float base = arow[lastval].value;
2295 for (int ip = lastval + 1, np = 0; ip < i; np++, ip++)
2297 arow[ip] = new jalview.datamodel.Annotation("", "", ' ',
2298 interval * np + base);
2299 // NB - Interpolated points don't get a tooltip and
2305 // check range - shouldn't we have a min and max property in the
2306 // annotation object ?
2309 min = max = arow[i].value;
2314 if (arow[i].value < min)
2316 min = arow[i].value;
2318 else if (arow[i].value > max)
2320 max = arow[i].value;
2323 // make tooltip and display char value
2324 if (!has[HASDESCSTR])
2326 arow[i].description = arow[i].value + "";
2332 if (arow[i].description != null
2333 && arow[i].description.length() < 3)
2335 // copy over the description as the display char.
2336 arow[i].displayCharacter = new String(arow[i].description);
2341 // mark the position as a point used for the interpolation.
2342 arow[i].displayCharacter = arow[i].value + "";
2347 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2348 arow, min, max, type);
2352 if (annotation.getAnnotationElementCount() == 0)
2354 // empty annotation array
2355 // TODO: alignment 'features' compare rangeType spec to alignment
2356 // width - if it is not complete, then mark regions on the annotation
2359 jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
2361 jan.setThreshold(null);
2362 jan.annotationId = annotation.getVorbaId().toString(); // keep all the
2365 if (annotation.getLinkCount() > 0)
2367 Cache.log.warn("Ignoring " + annotation.getLinkCount()
2368 + "links added to AlignmentAnnotation.");
2370 if (annotation.getModifiable() == null
2371 || annotation.getModifiable().length() == 0) // TODO: USE VAMSAS
2375 jan.editable = true;
2379 if (annotation.getGroup() != null
2380 && annotation.getGroup().length() > 0)
2382 jan.graphGroup = Integer.parseInt(annotation.getGroup()); // TODO:
2390 } catch (Exception e)
2393 .info("UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
2403 * get real bounds of a RangeType's specification. start and end are an
2404 * inclusive range within which all segments and positions lie. TODO: refactor
2408 * @return int[] { start, end}
2410 private int[] getBounds(RangeType dseta)
2415 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2418 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2420 if (dseta.getSegCount() > 0)
2422 se = getSegRange(dseta.getSeg(0), true);
2423 for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++)
2425 int nse[] = getSegRange(dseta.getSeg(s), true);
2436 if (dseta.getPosCount() > 0)
2438 // could do a polarity for pos range too. and pass back indication of
2440 int pos = dseta.getPos(0).getI();
2443 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2445 pos = dseta.getPos(p).getI();
2462 * map from a rangeType's internal frame to the referenced object's coordinate
2466 * @return int [] { ref(pos)...} for all pos in rangeType's frame.
2468 private int[] getMapping(RangeType dseta)
2470 Vector posList = new Vector();
2474 if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
2477 "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
2479 if (dseta.getSegCount() > 0)
2481 for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++)
2483 se = getSegRange(dseta.getSeg(s), false);
2484 int se_end = se[1 - se[2]] + (se[2] == 0 ? 1 : -1);
2485 for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1)
2487 posList.add(new Integer(p));
2491 else if (dseta.getPosCount() > 0)
2493 int pos = dseta.getPos(0).getI();
2495 for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
2497 pos = dseta.getPos(p).getI();
2498 posList.add(new Integer(pos));
2502 if (posList != null && posList.size() > 0)
2504 int[] range = new int[posList.size()];
2505 for (int i = 0; i < range.length; i++)
2507 range[i] = ((Integer) posList.elementAt(i)).intValue();
2518 * where the from range is the local mapped range, and the to range
2519 * is the 'mapped' range in the MapRangeType
2520 * @param default unit for local
2521 * @param default unit for mapped
2524 private jalview.util.MapList parsemapType(MapType maprange, int localu,
2527 jalview.util.MapList ml = null;
2528 int[] localRange = getMapping(maprange.getLocal());
2529 int[] mappedRange = getMapping(maprange.getMapped());
2530 long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit()
2532 long mu = maprange.getMapped().hasUnit() ? maprange.getMapped()
2533 .getUnit() : mappedu;
2534 ml = new jalview.util.MapList(localRange, mappedRange, (int) lu,
2540 * initialise a range type object from a set of start/end inclusive intervals
2545 private void initRangeType(RangeType mrt, int[] range)
2547 for (int i = 0; i < range.length; i += 2)
2549 Seg vSeg = new Seg();
2550 vSeg.setStart(range[i]);
2551 vSeg.setEnd(range[i + 1]);
2557 * initialise a MapType object from a MapList object.
2563 private void initMapType(MapType maprange, jalview.util.MapList ml,
2566 maprange.setLocal(new Local());
2567 maprange.setMapped(new Mapped());
2568 initRangeType(maprange.getLocal(), ml.getFromRanges());
2569 initRangeType(maprange.getMapped(), ml.getToRanges());
2572 maprange.getLocal().setUnit(ml.getFromRatio());
2573 maprange.getLocal().setUnit(ml.getToRatio());
2578 * not needed now. Provenance getVamsasProvenance(jalview.datamodel.Provenance
2579 * jprov) { jalview.datamodel.ProvenanceEntry[] entries = null; // TODO: fix
2580 * App and Action here. Provenance prov = new Provenance();
2581 * org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
2582 * java.util.Date()); Entry provEntry;
2584 * if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
2585 * entries.length; i++) { provEntry = new Entry(); try { date = new
2586 * org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
2587 * { ex.printStackTrace();
2589 * date = new org.exolab.castor.types.Date(entries[i].getDate()); }
2590 * provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
2591 * provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
2592 * else { provEntry = new Entry(); provEntry.setDate(date);
2593 * provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
2594 * provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
2595 * prov.addEntry(provEntry); }
2599 jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
2601 // TODO: fix App and Action entries and check use of provenance in jalview.
2602 jalview.datamodel.Provenance jprov = new jalview.datamodel.Provenance();
2603 for (int i = 0; i < prov.getEntryCount(); i++)
2605 jprov.addEntry(prov.getEntry(i).getUser(), prov.getEntry(i)
2606 .getAction(), prov.getEntry(i).getDate(), prov.getEntry(i)
2615 * @return default initial provenance list for a Jalview created vamsas
2618 Provenance dummyProvenance()
2620 return dummyProvenance(null);
2623 Entry dummyPEntry(String action)
2625 Entry entry = new Entry();
2626 entry.setApp(this.provEntry.getApp());
2629 entry.setAction(action);
2633 entry.setAction("created.");
2635 entry.setDate(new java.util.Date());
2636 entry.setUser(this.provEntry.getUser());
2640 Provenance dummyProvenance(String action)
2642 Provenance prov = new Provenance();
2643 prov.addEntry(dummyPEntry(action));
2647 Entry addProvenance(Provenance p, String action)
2649 Entry dentry = dummyPEntry(action);
2654 public Entry getProvEntry()
2659 public IClientDocument getClientDocument()
2664 public IdentityHashMap getJvObjectBinding()
2669 public Hashtable getVamsasObjectBinding()
2674 public void storeSequenceMappings(AlignViewport viewport, String title)
2677 AlignViewport av = viewport;
2680 jalview.datamodel.AlignmentI jal = av.getAlignment();
2681 // /////////////////////////////////////////
2683 DataSet dataset = null;
2684 if (jal.getDataset() == null)
2686 Cache.log.warn("Creating new dataset for an alignment.");
2687 jal.setDataset(null);
2689 dataset = (DataSet) ((Alignment) getjv2vObj(viewport
2690 .getSequenceSetId())).getV_parent(); // jal.getDataset());
2691 if (dataset == null)
2693 dataset = (DataSet) getjv2vObj(jal.getDataset());
2695 .error("Can't find the correct dataset for the alignment in this view. Creating new one.");
2698 // Store any sequence mappings.
2699 if (av.getAlignment().getCodonFrames() != null
2700 && av.getAlignment().getCodonFrames().length > 0)
2702 jalview.datamodel.AlignedCodonFrame[] cframes = av.getAlignment()
2704 for (int cf = 0; cf < cframes.length; cf++)
2706 if (cframes[cf].getdnaSeqs() != null
2707 && cframes[cf].getdnaSeqs().length > 0)
2709 jalview.datamodel.SequenceI[] dmps = cframes[cf].getdnaSeqs();
2710 jalview.datamodel.Mapping[] mps = cframes[cf].getProtMappings();
2711 for (int smp = 0; smp < mps.length; smp++)
2713 uk.ac.vamsas.objects.core.SequenceType mfrom = (SequenceType) getjv2vObj(dmps[smp]);
2716 new jalview.io.vamsas.Sequencemapping(this, mps[smp],
2722 .warn("NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
2723 + dmps[smp].getDisplayId(true)
2725 + mps[smp].getTo().getName());
2731 } catch (Exception e)
2733 throw new Exception("Couldn't store sequence mappings for " + title,
2738 public void clearSkipList()
2740 if (skipList != null)
2747 * @return the skipList
2749 public Hashtable getSkipList()
2756 * the skipList to set
2758 public void setSkipList(Hashtable skipList)
2760 this.skipList = skipList;
2764 * registry for datastoreItems
2766 DatastoreRegistry dsReg = new DatastoreRegistry();
2768 public DatastoreRegistry getDatastoreRegisty()
2772 dsReg = new DatastoreRegistry();