/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
- * This program is free software; you can redistribute it and/or
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
*/
package jalview.io;
import jalview.bin.Cache;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
-import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GraphLine;
-import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.io.vamsas.DatastoreItem;
import jalview.io.vamsas.DatastoreRegistry;
import jalview.io.vamsas.Rangetype;
-import jalview.util.UrlLink;
-
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.IdentityHashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Vector;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import uk.ac.vamsas.objects.utils.Properties;
/*
- *
+ *
* static {
* org.exolab.castor.util.LocalConfiguration.getInstance().getProperties().setProperty(
* "org.exolab.castor.serializer", "org.apache.xml.serialize.XMLSerilazizer"); }
- *
+ *
+ */
+/*
+ * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
*/
-
public class VamsasAppDatastore
{
/**
{
return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
}
- // check if we're working with a string - then workaround
+ // check if we're working with a string - then workaround
// the use of IdentityHashTable because different strings
// have different object IDs.
if (jvobj instanceof String)
- {
+ {
Object seqsetidobj = null;
seqsetidobj = getVamsasObjectBinding().get(jvobj);
if (seqsetidobj != null)
// what is expected. object returned by av.getSequenceSetId() -
// reverse lookup to get the 'registered' instance of this string
Vobject obj = getjv2vObj(seqsetidobj);
- if (obj!=null && !(obj instanceof Alignment))
+ if (obj != null && !(obj instanceof Alignment))
{
- Cache.log.warn("IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
- + seqsetidobj + " to object " + obj);
+ Cache.log
+ .warn("IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
+ + seqsetidobj + " to object " + obj);
}
return obj;
}
else
{
Cache.log.warn("Unexpected mapping for Jalview String Object ID "
- + seqsetidobj
- + " to another jalview dataset object " + seqsetidobj);
+ + seqsetidobj + " to another jalview dataset object "
+ + seqsetidobj);
}
}
}
}
/**
- *
+ *
* @param vobj
* @return Jalview datamodel object bound to the vamsas document object
*/
/**
* put the alignment viewed by AlignViewport into cdoc.
- *
+ *
* @param av
- * alignViewport to be stored
+ * alignViewport to be stored
* @param aFtitle
- * title for alignment
- * @return true if alignment associated with viewport was stored/synchronized to document
+ * title for alignment
+ * @return true if alignment associated with viewport was stored/synchronized
+ * to document
*/
public boolean storeVAMSAS(AlignViewport av, String aFtitle)
{
jal.setDataset(null);
jds = jal.getDataset();
}
-
+
// try and get alignment and association for sequence set id
Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId());
- if (alignment!=null)
+ if (alignment != null)
{
dataset = (DataSet) alignment.getV_parent();
- } else {
- // is the dataset already registered
- dataset = (DataSet) getjv2vObj(jds);
}
-
+ else
+ {
+ // is the dataset already registered
+ dataset = (DataSet) getjv2vObj(jds);
+ }
+
if (dataset == null)
{
// it might be that one of the dataset sequences does actually have a
- // binding, so search for it indirectly. If it does, then the local jalview dataset
+ // binding, so search for it indirectly. If it does, then the local
+ // jalview dataset
// must be merged with the existing vamsas dataset.
jalview.datamodel.SequenceI[] jdatset = jds.getSequencesArray();
for (int i = 0; i < jdatset.length; i++)
}
else
{
- if (vbound.getV_parent()!=null && dataset != vbound.getV_parent())
+ if (vbound.getV_parent() != null
+ && dataset != vbound.getV_parent())
{
throw new Error(
"IMPLEMENTATION ERROR: Cannot map an alignment of sequences from different datasets into a single alignment in the vamsas document.");
// referenced
// sequences
// to dataset.
- Datasetsequence dssync = new jalview.io.vamsas.Datasetsequence(this, sq, dict, dataset);
+ Datasetsequence dssync = new jalview.io.vamsas.Datasetsequence(
+ this, sq, dict, dataset);
sequence = (Sequence) dssync.getVobj();
- if (dssync.getModified()) {
- dssmods.addElement(sequence);
- };
+ if (dssync.getModified())
+ {
+ dssmods.addElement(sequence);
+ }
+ ;
}
if (dssmods.size() > 0)
{
{
boolean modified = false;
// check existing sequences in local and in document.
- Vector docseqs = new Vector(alignment
- .getAlignmentSequenceAsReference());
+ Vector docseqs = new Vector(
+ alignment.getAlignmentSequenceAsReference());
for (int i = 0; i < jal.getHeight(); i++)
{
modified |= syncToAlignmentSequence(jal.getSequenceAt(i),
/*
* We do not put local Alignment Sequence Features into the vamsas
* document yet.
- *
- *
+ *
+ *
* jalview.datamodel.SequenceFeature[] features = alseq
* .getSequenceFeatures(); for (int f = 0; f < features.length; f++) {
* if (features[f] != null) { AlignmentSequenceAnnotation valseqf = (
- * AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf ==
- * null) {
- *
+ * AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
+ * == null) {
+ *
* valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
* new AlignmentSequenceAnnotation(), features[i]);
* valseqf.setGraph(false);
- * valseqf.addProperty(newProperty("jalview:feature","boolean","true"));
- * if (valseqf.getProvenance() == null) { valseqf.setProvenance(new
- * Provenance()); } addProvenance(valseqf.getProvenance(), "created"); //
- * JBPNote - // need to // update bindjvvobj(features[i], valseqf);
+ * valseqf.addProperty(newProperty("jalview:feature"
+ * ,"boolean","true")); if (valseqf.getProvenance() == null) {
+ * valseqf.setProvenance(new Provenance()); }
+ * addProvenance(valseqf.getProvenance(), "created"); // JBPNote - //
+ * need to // update bindjvvobj(features[i], valseqf);
* valseq.addAlignmentSequenceAnnotation(valseqf); } } }
*/
}
{
continue;
}
+ if (aa[i].groupRef != null)
+ {
+ // TODO: store any group associated annotation references
+ Cache.log
+ .warn("Group associated sequence annotation is not stored in VAMSAS document.");
+ continue;
+ }
if (aa[i].sequenceRef != null)
{
// Deal with sequence associated annotation
else
{
// first find the alignment sequence to associate this with.
- SequenceI jvalsq = null;
- Enumeration jval = av.getAlignment().getSequences()
- .elements();
- while (jval.hasMoreElements())
- {
- jvalsq = (SequenceI) jval.nextElement();
+ for (SequenceI jvalsq:av.getAlignment().getSequences()) {
// saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
// sref, aa[i]);
if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
if (aa[i].annotations[a].secondaryStructure != ' ')
{
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
- ss
- .setContent(String
- .valueOf(aa[i].annotations[a].secondaryStructure));
+ ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setContent(String
+ .valueOf(aa[i].annotations[a].secondaryStructure));
ae.addGlyph(ss);
}
an.addAnnotationElement(ae);
an.setGroup(Integer.toString(aa[i].graphGroup));
if (aa[i].threshold != null && aa[i].threshold.displayed)
{
- an.addProperty(Properties.newProperty(THRESHOLD, Properties.FLOATTYPE, ""
- + aa[i].threshold.value));
+ an.addProperty(Properties.newProperty(THRESHOLD,
+ Properties.FLOATTYPE, "" + aa[i].threshold.value));
if (aa[i].threshold.label != null)
{
- an.addProperty(Properties.newProperty(THRESHOLD + "Name", Properties.STRINGTYPE,
- "" + aa[i].threshold.label));
+ an.addProperty(Properties.newProperty(THRESHOLD
+ + "Name", Properties.STRINGTYPE, ""
+ + aa[i].threshold.label));
}
}
}
{
TreePanel tp = (TreePanel) frames[t];
- if (tp.getViewPort().getSequenceSetId().equals(av.getSequenceSetId()))
+ if (tp.getViewPort().getSequenceSetId()
+ .equals(av.getSequenceSetId()))
{
DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
jal, alignment);
}
/**
- * very quick test to see if the viewport would be stored in the vamsas document.
- * Reasons for not storing include the unaligned flag being false.
+ * very quick test to see if the viewport would be stored in the vamsas
+ * document. Reasons for not storing include the unaligned flag being false
+ * (for all sequences, including the hidden ones!)
+ *
* @param av
- * @return true if alignment associated with this view will be stored in document.
+ * @return true if alignment associated with this view will be stored in
+ * document.
*/
public boolean alignmentWillBeSkipped(AlignViewport av)
{
/**
* remove docseqs from the given alignment marking provenance appropriately
* and removing any references to the sequences.
- *
+ *
* @param alignment
* @param docseqs
*/
* vamsas alignment sequence for jvalsq and adds it to the alignment if
* necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
* and these are removed after being processed w.r.t a bound jvalsq
- *
+ *
*/
private boolean syncToAlignmentSequence(SequenceI jvalsq,
Alignment alignment, Vector unbounddocseq)
* creates/syncs the jvalsq from the alignment sequence
*/
private boolean syncFromAlignmentSequence(AlignmentSequence valseq,
- char valGapchar, char gapChar, Vector dsseqs)
+ char valGapchar, char gapChar, List<SequenceI> dsseqs)
{
boolean modal = false;
modal = true;
alseq.setName(valseq.getName());
}
- if (alseq.getDescription()==null || (valseq.getDescription() != null && !alseq.getDescription()
- .equals(valseq.getDescription())))
+ if (alseq.getDescription() == null
+ || (valseq.getDescription() != null && !alseq
+ .getDescription().equals(valseq.getDescription())))
{
alseq.setDescription(valseq.getDescription());
modal = true;
else
{
alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
- .getSequence().replace(valGapchar, gapChar), (int) valseq
- .getStart(), (int) valseq.getEnd());
-
+ .getSequence().replace(valGapchar, gapChar),
+ (int) valseq.getStart(), (int) valseq.getEnd());
+
Vobject datsetseq = (Vobject) valseq.getRefid();
if (datsetseq != null)
{
alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
- if (valseq.getDescription()!=null)
+ if (valseq.getDescription() != null)
{
alseq.setDescription(valseq.getDescription());
- } else {
+ }
+ else
+ {
// inherit description line from dataset.
- if (alseq.getDatasetSequence().getDescription()!=null)
+ if (alseq.getDatasetSequence().getDescription() != null)
{
- alseq.setDescription(alseq.getDatasetSequence().getDescription());
+ alseq.setDescription(alseq.getDatasetSequence()
+ .getDescription());
}
}
// if
{
// we only write an annotation where it really exists.
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
ss.setContent(String
.valueOf(alan.annotations[a].secondaryStructure));
ae.addGlyph(ss);
// bits.
if (alan.getThreshold() != null && alan.getThreshold().displayed)
{
- an.addProperty(Properties.newProperty(THRESHOLD, Properties.FLOATTYPE,
- ""
- + alan.getThreshold().value));
+ an.addProperty(Properties.newProperty(THRESHOLD,
+ Properties.FLOATTYPE, "" + alan.getThreshold().value));
if (alan.getThreshold().label != null)
- an.addProperty(Properties.newProperty(THRESHOLD + "Name", Properties.STRINGTYPE, ""
- + alan.getThreshold().label));
+ an.addProperty(Properties.newProperty(THRESHOLD + "Name",
+ Properties.STRINGTYPE, "" + alan.getThreshold().label));
}
((DataSet) sref.getV_parent()).addDataSetAnnotations(an);
bindjvvobj(alan, an);
/**
* set vamsas annotation object type from jalview annotation
- *
+ *
* @param an
* @param alan
*/
switch (alan.graph)
{
case AlignmentAnnotation.BAR_GRAPH:
- an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION, Properties.BOOLEANTYPE, "true"));
+ an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION,
+ Properties.BOOLEANTYPE, "true"));
break;
case AlignmentAnnotation.LINE_GRAPH:
- an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION, Properties.BOOLEANTYPE, "true"));
+ an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION,
+ Properties.BOOLEANTYPE, "true"));
break;
default:
// don't add any kind of discrete or continous property info.
}
}
-
/**
* get start<end range of segment, adjusting for inclusivity flag and
* polarity.
- *
+ *
* @param visSeg
* @param ensureDirection
- * when true - always ensure start is less than end.
+ * when true - always ensure start is less than end.
* @return int[] { start, end, direction} where direction==1 for range running
* from end to start.
*/
}
/**
- *
+ *
* @param annotation
* @return true if annotation is not to be stored in document
*/
/**
* list of alignment views created when updating Jalview from document.
*/
- private Vector newAlignmentViews = new Vector();
+ private final Vector newAlignmentViews = new Vector();
/**
* update local jalview view settings from the stored appdata (if any)
jalview.util.jarInputStreamProvider jprovider = new jalview.util.jarInputStreamProvider()
{
+ @Override
public String getFilename()
{
return "Jalview Vamsas Document Client Data";
}
+ @Override
public JarInputStream getJarInputStream() throws IOException
{
jalview.bin.Cache.log
jalview.util.jarInputStreamProvider jarstream = new jalview.util.jarInputStreamProvider()
{
+ @Override
public String getFilename()
{
return "Jalview Vamsas Document User Data";
}
+ @Override
public JarInputStream getJarInputStream() throws IOException
{
jalview.bin.Cache.log
if (mappings != null && mappings.length > 0)
{
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager().addMappings(mappings);
+ .getStructureSelectionManager(Desktop.instance).addMappings(mappings);
}
}
}
// ensure vamsas object binds to the stored views retrieved from
// Jalview appdata
- //jalview.structure.StructureSelectionManager
- // .getStructureSelectionManager()
- // .addStructureViewerListener(viewframe.alignPanel);
+ // jalview.structure.StructureSelectionManager
+ // .getStructureSelectionManager()
+ // .addStructureViewerListener(viewframe.alignPanel);
}
/**
* replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
* binding tables
- *
+ *
* @param oldjvobject
- * @param newjvobject (may be null)
+ * @param newjvobject
+ * (may be null)
*/
private void replaceJvObjMapping(Object oldjvobject, Object newjvobject)
{
Object vobject = jv2vobj.remove(oldjvobject);
if (vobject == null)
{
+ // NOTE: this happens if user deletes object in one session then updates from another client
throw new Error(
"IMPLEMENTATION ERROR: old jalview object is not bound ! ("
+ oldjvobject + ")");
}
- if (newjvobject!=null)
+ if (newjvobject != null)
{
jv2vobj.put(newjvobject, vobject);
vobj2jv.put(vobject, newjvobject);
{
// TODO raise GUI warning if user requests it.
jalview.bin.Cache.log
- .error(
- "Couldn't update jalview client application data. Giving up - local settings probably lost.",
+ .error("Couldn't update jalview client application data. Giving up - local settings probably lost.",
e);
}
}
/**
* translate the Vobject keys to strings for use in Jalview2XML
- *
+ *
* @param jv2vobj2
* @return
*/
/**
* translate the Vobject values to strings for use in Jalview2XML
- *
+ *
* @param vobj2jv2
* @return hashtable with string values
*/
}
return mapped;
}
+
/**
* synchronize Jalview from the vamsas document
+ *
* @return number of new views from document
*/
public int updateToJalview()
// ///LOAD DATASET
DataSet dataset = root.getDataSet(_ds);
int i, iSize = dataset.getSequenceCount();
- Vector dsseqs;
+ List<SequenceI> dsseqs;
jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(dataset);
int jremain = 0;
if (jdataset == null)
// TODO: test sequence merging - we preserve existing non vamsas
// sequences but add in any new vamsas ones, and don't yet update any
// sequence attributes
- for (i = 0; i < iSize
- ; i++)
+ for (i = 0; i < iSize; i++)
{
Sequence vdseq = dataset.getSequence(i);
- jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(this, vdseq);
-
+ jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(
+ this, vdseq);
+
jalview.datamodel.SequenceI dsseq = (SequenceI) dssync.getJvobj();
if (dssync.isAddfromdoc())
{
SequenceI[] seqs = new SequenceI[dsseqs.size()];
for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
{
- seqs[i] = (SequenceI) dsseqs.elementAt(i);
- dsseqs.setElementAt(null, i);
+ seqs[i] = dsseqs.get(i);
+ dsseqs.set(i, null);
}
jdataset = new jalview.datamodel.Alignment(seqs);
Cache.log.debug("New vamsas dataset imported into jalview.");
if (dseta.getAnnotationElementCount() == 0)
{
new jalview.io.vamsas.Sequencefeature(this, dseta, dsSeq);
-
+
}
else
{
.warn("Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
}
}
- } else {
- Cache.log.warn("Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
+ }
+ else
+ {
+ Cache.log
+ .warn("Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
}
}
}
jal = (av.hasHiddenRows()) ? av.getAlignment()
.getHiddenSequences().getFullAlignment() : av
.getAlignment();
- }
+ }
iSize = alignment.getAlignmentSequenceCount();
boolean refreshal = false;
Vector newasAnnots = new Vector();
AlignmentSequence valseq = alignment.getAlignmentSequence(i);
jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
- dsseqs)
- && alseq != null)
+ dsseqs) && alseq != null)
{
// updated to sequence from the document
// positions.
alseq.addAlignmentAnnotation(asa);
bindjvvobj(asa, vasannot[a]);
+ refreshal = true;
newasAnnots.add(asa);
}
else
SequenceI[] seqs = new SequenceI[dsseqs.size()];
for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
{
- seqs[i] = (SequenceI) dsseqs.elementAt(i);
- dsseqs.setElementAt(null, i);
+ seqs[i] = dsseqs.get(i);
+ dsseqs.set(i,null);
}
jal = new jalview.datamodel.Alignment(seqs);
Cache.log.debug("New vamsas alignment imported into jalview "
else
{
jan = getjAlignmentAnnotation(jal, an[j]);
+ // TODO: ensure we add the alignment annotation before the
+ // automatic annotation rows
jal.addAnnotation(jan);
bindjvvobj(jan, an[j]);
+ refreshal = true;
}
}
}
.toString());
av = alignFrame.getViewport();
newAlignmentViews.addElement(av);
- String title = alignment.getProvenance().getEntry(
- alignment.getProvenance().getEntryCount() - 1)
+ String title = alignment
+ .getProvenance()
+ .getEntry(
+ alignment.getProvenance().getEntryCount() - 1)
.getAction();
if (alignment.getPropertyCount() > 0)
{
if (refreshal)
{
av.alignmentChanged(alignFrame.alignPanel);
+ alignFrame.alignPanel.adjustAnnotationHeight();
}
}
// LOAD TREES
* jalview.datamodel.Annotation[] rows Two annotation rows are made if there
* are distinct annotation for both at 'pos' and 'after pos' at any particular
* site.
- *
+ *
* @param annotation
* @return { boolean[static int constants ], int[ae.length] - map to annotated
* object frame, jalview.datamodel.Annotation[],
{
if (glyphs[g]
.getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
+ .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
{
ss = glyphs[g].getContent();
AeContent[HASSECSTR] = true;
}
else if (glyphs[g]
.getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
+ .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
{
Cache.log.debug("ignoring hydrophobicity glyph marker.");
AeContent[HASHPHOB] = true;
if (colour == null)
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val);
}
else
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val, colour);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val, colour);
}
}
else
/**
* @param jal
- * the jalview alignment to which the annotation will be
- * attached (ideally - freshly updated from corresponding
- * vamsas alignment)
+ * the jalview alignment to which the annotation will be attached
+ * (ideally - freshly updated from corresponding vamsas alignment)
* @param annotation
* @return unbound jalview alignment annotation object.
*/
// way its 'odd' - there is already an existing TODO about removing this
// flag as being redundant
/*
- * if
- * ((annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentAnnotation.class) &&
- * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph()) ||
- * (hasSequenceRef=true &&
- * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation)annotation).getGraph())) {
+ * if((annotation.getClass().equals(uk.ac.vamsas.objects.core.
+ * AlignmentAnnotation.class) &&
+ * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph())
+ * || (hasSequenceRef=true &&
+ * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation
+ * )annotation).getGraph())) {
*/
if (has[HASVALS])
{
return null;
}
-
/**
* get real bounds of a RangeType's specification. start and end are an
* inclusive range within which all segments and positions lie. TODO: refactor
* to vamsas utils
- *
+ *
* @param dseta
* @return int[] { start, end}
*/
/**
* map from a rangeType's internal frame to the referenced object's coordinate
* frame.
- *
+ *
* @param dseta
* @return int [] { ref(pos)...} for all pos in rangeType's frame.
*/
}
/**
- *
+ *
* @param maprange
- * where the from range is the local mapped range, and the to
- * range is the 'mapped' range in the MapRangeType
- * @param default
- * unit for local
- * @param default
- * unit for mapped
+ * where the from range is the local mapped range, and the to range
+ * is the 'mapped' range in the MapRangeType
+ * @param default unit for local
+ * @param default unit for mapped
* @return MapList
*/
private jalview.util.MapList parsemapType(MapType maprange, int localu,
/**
* initialise a range type object from a set of start/end inclusive intervals
- *
+ *
* @param mrt
* @param range
*/
/**
* initialise a MapType object from a MapList object.
- *
+ *
* @param maprange
* @param ml
* @param setUnits
* App and Action here. Provenance prov = new Provenance();
* org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
* java.util.Date()); Entry provEntry;
- *
+ *
* if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
* entries.length; i++) { provEntry = new Entry(); try { date = new
- * org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex) {
- * ex.printStackTrace();
- *
+ * org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
+ * { ex.printStackTrace();
+ *
* date = new org.exolab.castor.types.Date(entries[i].getDate()); }
* provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
* provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
* provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
* provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
* prov.addEntry(provEntry); }
- *
+ *
* return prov; }
*/
jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
}
/**
- *
+ *
* @return default initial provenance list for a Jalview created vamsas
* object.
*/
Cache.log.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
}
- dataset = (DataSet) ((Alignment) getjv2vObj(viewport.getSequenceSetId())).getV_parent(); // jal.getDataset());
- if (dataset==null)
+ dataset = (DataSet) ((Alignment) getjv2vObj(viewport
+ .getSequenceSetId())).getV_parent(); // jal.getDataset());
+ if (dataset == null)
{
dataset = (DataSet) getjv2vObj(jal.getDataset());
- Cache.log.error("Can't find the correct dataset for the alignment in this view. Creating new one.");
+ Cache.log
+ .error("Can't find the correct dataset for the alignment in this view. Creating new one.");
}
// Store any sequence mappings.
.getCodonFrames();
for (int cf = 0; cf < cframes.length; cf++)
{
- if (cframes[cf].getdnaSeqs()!=null && cframes[cf].getdnaSeqs().length > 0)
+ if (cframes[cf].getdnaSeqs() != null
+ && cframes[cf].getdnaSeqs().length > 0)
{
jalview.datamodel.SequenceI[] dmps = cframes[cf].getdnaSeqs();
jalview.datamodel.Mapping[] mps = cframes[cf].getProtMappings();
}
/**
- * @param skipList the skipList to set
+ * @param skipList
+ * the skipList to set
*/
public void setSkipList(Hashtable skipList)
{
this.skipList = skipList;
}
+
/**
* registry for datastoreItems
*/
DatastoreRegistry dsReg = new DatastoreRegistry();
+
public DatastoreRegistry getDatastoreRegisty()
{
- if (dsReg==null)
+ if (dsReg == null)
{
dsReg = new DatastoreRegistry();
}