Hashtable annotationIds = new Hashtable();
String uniqueSetSuffix = "";
+ /**
+ * List of pdbfiles added to Jar
+ */
+ Vector pdbfiles = null;
// SAVES SEVERAL ALIGNMENT WINDOWS TO SAME JARFILE
public void SaveState(File statefile)
vamsasSet.setGapChar(jal.getGapCharacter() + "");
+ if(jal.getProperties()!=null)
+ {
+ Enumeration en = jal.getProperties().keys();
+ while(en.hasMoreElements())
+ {
+ String key = en.nextElement().toString();
+ SequenceSetProperties ssp = new SequenceSetProperties();
+ ssp.setKey(key);
+ ssp.setValue(jal.getProperties().get(key).toString());
+ vamsasSet.addSequenceSetProperties(ssp);
+ }
+ }
+
JSeq jseq;
- Vector pdbfiles = null;
//SAVE SEQUENCES
int id = 0;
if (!jmol.pdbentry.getId().equals(entry.getId()))
continue;
+
StructureState state = new StructureState();
state.setVisible(true);
state.setXpos(jmol.getX());
state.setWidth(jmol.getWidth());
state.setHeight(jmol.getHeight());
- state.setContent(jmol.viewer.getStateInfo().replaceAll("\n", ""));
-
+ String statestring = jmol.viewer.getStateInfo();
+ if(state!=null)
+ {
+ state.setContent(statestring.replaceAll("\n", ""));
+ }
for (int s = 0; s < jmol.sequence.length; s++)
{
if (jal.findIndex(jmol.sequence[s]) > -1)
}
an.setLabel(aa[i].label);
-
+ if (aa[i].hasScore())
+ {
+ an.setScore(aa[i].getScore());
+ }
AnnotationElement ae;
-
- for (int a = 0; a < aa[i].annotations.length; a++)
+ if (aa[i].annotations!=null)
{
- if ( (aa[i] == null) || (aa[i].annotations[a] == null))
+ an.setScoreOnly(false);
+ for (int a = 0; a < aa[i].annotations.length; a++)
{
- continue;
- }
+ if ((aa[i] == null) || (aa[i].annotations[a] == null))
+ {
+ continue;
+ }
- ae = new AnnotationElement();
- ae.setDescription(aa[i].annotations[a].description);
- ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter);
- ae.setValue(aa[i].annotations[a].value);
- ae.setPosition(a);
- ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure +
- "");
+ ae = new AnnotationElement();
+ if (aa[i].annotations[a].description != null)
+ ae.setDescription(aa[i].annotations[a].description);
+ if(aa[i].annotations[a].displayCharacter!=null)
+ ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter);
- if (aa[i].annotations[a].colour != java.awt.Color.black)
- {
- ae.setColour(aa[i].annotations[a].colour.getRGB());
- }
+ if (!Float.isNaN(aa[i].annotations[a].value))
+ ae.setValue(aa[i].annotations[a].value);
- an.addAnnotationElement(ae);
- }
+ ae.setPosition(a);
+ if (aa[i].annotations[a].secondaryStructure != ' '
+ && aa[i].annotations[a].secondaryStructure != '\0')
+ ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure
+ + "");
+ if (aa[i].annotations[a].colour!=null
+ && aa[i].annotations[a].colour != java.awt.Color.black)
+ {
+ ae.setColour(aa[i].annotations[a].colour.getRGB());
+ }
+
+ an.addAnnotationElement(ae);
+ }
+ } else {
+ an.setScoreOnly(true);
+ }
vamsasSet.addAnnotation(an);
}
}
setting.setDisplay(
av.featuresDisplayed.containsKey(renderOrder[ro])
);
-
+ float rorder=ap.seqPanel.seqCanvas.getFeatureRenderer().getOrder(renderOrder[ro]);
+ if (rorder>-1) {
+ setting.setOrder(rorder);
+ }
fs.addSetting(setting);
settingsAdded.addElement(renderOrder[ro]);
}
);
setting.setDisplay(false);
-
+ float rorder = ap.seqPanel.seqCanvas.getFeatureRenderer().getOrder(key);
+ if (rorder>-1)
+ {
+ setting.setOrder(rorder);
+ }
fs.addSetting(setting);
settingsAdded.addElement(key);
}
-
+ en = ap.seqPanel.seqCanvas.getFeatureRenderer().featureGroups.keys();
+ Vector groupsAdded=new Vector();
+ while (en.hasMoreElements())
+ {
+ String grp = en.nextElement().toString();
+ if (groupsAdded.contains(grp))
+ {
+ continue;
+ }
+ Group g = new Group();
+ g.setName(grp);
+ g.setDisplay(((Boolean)ap.seqPanel.seqCanvas.getFeatureRenderer().featureGroups.get(grp)).booleanValue());
+ fs.addGroup(g);
+ groupsAdded.addElement(grp);
+ }
jms.setFeatureSettings(fs);
}
jalview.datamodel.Alignment al =
new jalview.datamodel.Alignment(orderedSeqs);
+ for(int i=0; i<vamsasSet.getSequenceSetPropertiesCount(); i++ )
+ {
+ SequenceSetProperties ssp = vamsasSet.getSequenceSetProperties(i);
+ al.setProperty(ssp.getKey(), ssp.getValue());
+ }
+
+
al.setDataset(null);
/////////////////////////////////
}
AnnotationElement[] ae = an[i].getAnnotationElement();
- jalview.datamodel.Annotation[] anot = new jalview.datamodel.Annotation[
- al.getWidth()];
+ jalview.datamodel.Annotation[] anot = null;
- for (int aa = 0; aa < ae.length && aa < anot.length; aa++)
+ if (!an[i].getScoreOnly())
{
- anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(ae[aa].
- getDisplayCharacter(),
- ae[aa].getDescription(),
- ae[aa].getSecondaryStructure().length() == 0 ? ' ' :
- ae[aa].getSecondaryStructure().charAt(0),
- ae[aa].getValue());
- anot[ae[aa].getPosition()].colour = new java.awt.Color(ae[aa].
- getColour());
- }
+ anot = new jalview.datamodel.Annotation[
+ al.getWidth()];
+ for (int aa = 0; aa < ae.length && aa < anot.length; aa++)
+ {
+ anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(
+
+ ae[aa].getDisplayCharacter(),
+ ae[aa].getDescription(),
+ (ae[aa].getSecondaryStructure()==null || ae[aa].getSecondaryStructure().length() == 0) ? ' ' :
+ ae[aa].getSecondaryStructure().charAt(0),
+ ae[aa].getValue()
+
+ );
+
+
+ anot[ae[aa].getPosition()].colour = new java.awt.Color(ae[aa].
+ getColour());
+ }
+ }
jalview.datamodel.AlignmentAnnotation jaa = null;
if (an[i].getGraph())
);
al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa);
}
-
+ if (an[i].hasScore())
+ {
+ jaa.setScore(an[i].getScore());
+ }
al.addAnnotation(jaa);
}
}
af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(setting.
getType(),
new java.awt.Color(setting.getColour()));
-
renderOrder[fs] = setting.getType();
-
+ if (setting.hasOrder())
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setOrder(setting.getType(), setting.getOrder());
+ else
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setOrder(setting.getType(), fs/jms.getFeatureSettings().getSettingCount());
if (setting.getDisplay())
{
af.viewport.featuresDisplayed.put(
}
af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().renderOrder =
renderOrder;
+ Hashtable fgtable;
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureGroups = fgtable=new Hashtable();
+ for (int gs=0;gs<jms.getFeatureSettings().getGroupCount(); gs++)
+ {
+ Group grp = jms.getFeatureSettings().getGroup(gs);
+ fgtable.put(grp.getName(), new Boolean(grp.getDisplay()));
+ }
}
if (view.getHiddenColumnsCount() > 0)
else if(comp!=null)
{
StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, pdbFile,
+ .setMapping(seq, null, pdbFile,
jalview.io.AppletFormatAdapter.FILE);
( (AppJMol) comp).addSequence(seq);