/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
import jalview.util.UrlLink;
import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Vector;
import uk.ac.vamsas.objects.core.DataSetAnnotations;
doJvUpdate();
}
+ @Override
public void addToDocument()
{
DataSetAnnotations dsa = (DataSetAnnotations) vobj;
dataset.addDataSetAnnotations(dsa);
}
+ @Override
public void addFromDocument()
{
DataSetAnnotations dsa = (DataSetAnnotations) vobj;
bindjvvobj(sf, dsa);
}
+ @Override
public void conflict()
{
log.warn("Untested sequencefeature conflict code");
addToDocument(); // and create a new feature in the document
}
+ @Override
public void updateToDoc()
{
DataSetAnnotations dsa = (DataSetAnnotations) vobj;
}
+ @Override
public void updateFromDoc()
{
DataSetAnnotations dsa = (DataSetAnnotations) vobj;
}
if (feature.otherDetails != null)
{
- Enumeration iter = feature.otherDetails.keys();
+ Iterator<String> iter = feature.otherDetails.keySet().iterator();
Vector props = dsa.getPropertyAsReference();
- while (iter.hasMoreElements())
+ while (iter.hasNext())
{
- String key = (String) iter.nextElement();
+ String key = iter.next();
if (!key.equalsIgnoreCase("score")
&& !key.equalsIgnoreCase("status"))
{
private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta)
{
int[] se = getBounds(dseta);
- SequenceFeature sf = new jalview.datamodel.SequenceFeature(
- dseta.getType(), dseta.getDescription(), dseta.getStatus(),
- se[0], se[1], dseta.getGroup());
+
+ /*
+ * try to identify feature score
+ */
+ boolean scoreFound = false;
+ float theScore = 0f;
+ String featureType = dseta.getType();
+ if (dseta.getScoreCount() > 0)
+ {
+ Enumeration scr = dseta.enumerateScore();
+ while (scr.hasMoreElements())
+ {
+ Score score = (Score) scr.nextElement();
+ if (score.getName().equals(featureType))
+ {
+ theScore = score.getContent();
+ scoreFound = true;
+ }
+ }
+ }
+
+ SequenceFeature sf = null;
+ if (scoreFound)
+ {
+ sf = new SequenceFeature(featureType, dseta.getDescription(), se[0],
+ se[1], theScore, dseta.getGroup());
+ }
+ else
+ {
+ sf = new SequenceFeature(featureType, dseta.getDescription(), se[0],
+ se[1], dseta.getGroup());
+ }
+ sf.setStatus(dseta.getStatus());
if (dseta.getLinkCount() > 0)
{
Link[] links = dseta.getLink();
while (scr.hasMoreElements())
{
Score score = (Score) scr.nextElement();
- if (score.getName().equals(sf.getType()))
- {
- sf.setScore(score.getContent());
- }
- else
+ if (!score.getName().equals(sf.getType()))
{
sf.setValue(score.getName(), "" + score.getContent());
}