import java.net.*;\r
\r
import java.util.*;\r
+\r
import java.util.jar.*;\r
\r
import javax.swing.*;\r
vamsasSeq.setId(id + "");\r
vamsasSeq.setName(jal.getSequenceAt(i).getName());\r
vamsasSeq.setSequence(jal.getSequenceAt(i).getSequence());\r
+ vamsasSeq.setDescription(jal.getSequenceAt(i).getDescription());\r
\r
jseq = new JSeq();\r
jseq.setStart(jal.getSequenceAt(i).getStart());\r
\r
jseq.setId(id);\r
\r
+ if(jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures()!=null)\r
+ {\r
+ Enumeration en = jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures().elements();\r
+ while(en.hasMoreElements())\r
+ {\r
+ Features features = new Features();\r
+ jalview.datamodel.SequenceFeature sf\r
+ = (jalview.datamodel.SequenceFeature)en.nextElement();\r
+\r
+ features.setBegin(sf.getBegin());\r
+ features.setEnd(sf.getEnd());\r
+ features.setDescription(sf.getDescription());\r
+ features.setStatus(sf.getStatus());\r
+ features.setType(sf.getType());\r
+ features.setFeatureGroup(sf.getFeatureGroup());\r
+ jseq.addFeatures(features);\r
+ }\r
+ }\r
+\r
+ if(jal.getSequenceAt(i).getDatasetSequence().getPDBId()!=null)\r
+ {\r
+ Enumeration en = jal.getSequenceAt(i).getDatasetSequence().getPDBId().elements();\r
+ while(en.hasMoreElements())\r
+ {\r
+ Pdbids pdb = new Pdbids();\r
+ jalview.datamodel.PDBEntry entry\r
+ = (jalview.datamodel.PDBEntry)en.nextElement();\r
+\r
+ pdb.setId(entry.getId());\r
+ pdb.setType(entry.getType());\r
+\r
+ if(entry.getProperty()!=null)\r
+ {\r
+ PdbentryItem item = new PdbentryItem();\r
+ Hashtable properties = entry.getProperty();\r
+ Enumeration en2 = properties.keys();\r
+ while(en2.hasMoreElements())\r
+ {\r
+ Property prop = new Property();\r
+ String key = en2.nextElement().toString();\r
+ prop.setName(key);\r
+ prop.setValue( properties.get(key).toString() );\r
+ item.addProperty(prop);\r
+ }\r
+ pdb.addPdbentryItem(item);\r
+ }\r
+\r
+ jseq.addPdbids(pdb);\r
+ }\r
+ }\r
+\r
jms.addJSeq(jseq);\r
vamsasSet.addSequence(vamsasSeq);\r
id++;\r
\r
Annotation an = new Annotation();\r
an.setDescription(aa[i].description);\r
- an.setGraph(aa[i].isGraph);\r
+ if(aa[i].graph>0)\r
+ {\r
+ an.setGraph(true);\r
+ an.setGraphType(aa[i].graph);\r
+ }\r
an.setLabel(aa[i].label);\r
\r
AnnotationElement ae;\r
jms.setJGroup(groups);\r
}\r
\r
+\r
///////////SAVE VIEWPORT\r
Viewport view = new Viewport();\r
view.setTitle(af.getTitle());\r
view.setShowBoxes(av.getShowBoxes());\r
view.setShowColourText(av.getColourText());\r
view.setShowConservation(av.showConservation);\r
- view.setShowFullId(av.getShowFullId());\r
+ view.setShowFullId(av.getShowJVSuffix());\r
view.setShowIdentity(av.showIdentity);\r
view.setShowQuality(av.showQuality);\r
view.setShowSequenceFeatures(av.showSequenceFeatures);\r
view.setShowText(av.getShowText());\r
view.setWrapAlignment(av.getWrapAlignment());\r
\r
+ if(af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null)\r
+ {\r
+ jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings();\r
+\r
+ Enumeration e = af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours.keys();\r
+ while (e.hasMoreElements())\r
+ {\r
+ String type = e.nextElement().toString();\r
+ Setting setting = new Setting();\r
+ setting.setType(type);\r
+ setting.setColour(\r
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(type).getRGB()\r
+ );\r
+ setting.setDisplay(\r
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed.contains(type)\r
+ );\r
+\r
+ fs.addSetting(setting);\r
+\r
+ }\r
+ jms.setFeatureSettings(fs);\r
+\r
+ }\r
+\r
jms.addViewport(view);\r
\r
+\r
object.setJalviewModelSequence(jms);\r
object.getVamsasModel().addSequenceSet(vamsasSet);\r
\r
//LOAD SEQUENCES\r
jalview.datamodel.Sequence[] jseqs = new jalview.datamodel.Sequence[vamsasSeq.length];\r
JSeq[] JSEQ = object.getJalviewModelSequence().getJSeq();\r
-\r
for (int i = 0; i < vamsasSeq.length; i++)\r
{\r
jseqs[i] = new jalview.datamodel.Sequence(vamsasSeq[i].getName(),\r
vamsasSeq[i].getSequence());\r
+ jseqs[i].setDescription( vamsasSeq[i].getDescription() );\r
\r
jseqs[i].setStart(JSEQ[i].getStart());\r
jseqs[i].setEnd(JSEQ[i].getEnd());\r
seqids.add(jseqs[i]);\r
}\r
\r
+ ///SequenceFeatures are added to the DatasetSequence,\r
+ // so we must create the dataset before loading features\r
/////////////////////////////////\r
jalview.datamodel.Alignment al = new jalview.datamodel.Alignment(jseqs);\r
+ al.setDataset(null);\r
+ /////////////////////////////////\r
+\r
+ for (int i = 0; i < vamsasSeq.length; i++)\r
+ {\r
+ if (JSEQ[i].getFeaturesCount() > 0)\r
+ {\r
+ Features[] features = JSEQ[i].getFeatures();\r
+ for (int f = 0; f < features.length; f++)\r
+ {\r
+ //features[f].getBegin()\r
+ jalview.datamodel.SequenceFeature sf\r
+ = new jalview.datamodel.SequenceFeature(features[f].getType(),\r
+ features[f].getDescription(), features[f].getStatus(),\r
+ features[f].getBegin(), features[f].getEnd());\r
+ sf.setFeatureGroup(features[f].getFeatureGroup());\r
+ al.getSequenceAt(i).getDatasetSequence().addSequenceFeature(sf);\r
+ }\r
+ }\r
+ if (JSEQ[i].getPdbidsCount() > 0)\r
+ {\r
+ Pdbids[] ids = JSEQ[i].getPdbids();\r
+ for (int p = 0; p < ids.length; p++)\r
+ {\r
+ jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();\r
+ entry.setId(ids[p].getId());\r
+ entry.setType(ids[p].getType());\r
+ al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);\r
+ }\r
\r
+ }\r
+ }\r
/////////////////////////////////\r
//////////////////////////////////\r
//LOAD ANNOTATIONS\r
if (an[i].getGraph())\r
{\r
jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),\r
- an[i].getDescription(), anot, 0, 0, 1);\r
+ an[i].getDescription(), anot, 0, 0,\r
+ an[i].getGraphType());\r
}\r
else\r
{\r
\r
AlignFrame af = new AlignFrame(al);\r
\r
+\r
// af.changeColour() );\r
/////////////////////////\r
//LOAD GROUPS\r
view.getHeight());\r
af.viewport.setStartRes(view.getStartRes());\r
af.viewport.setStartSeq(view.getStartSeq());\r
+ af.viewport.setShowAnnotation(view.getShowAnnotation());\r
af.viewport.showConservation = view.getShowConservation();\r
af.viewport.showQuality = view.getShowQuality();\r
af.viewport.showIdentity = view.getShowIdentity();\r
af.viewport.setConservationSelected(view.getConservationSelected());\r
af.conservationMenuItem.setSelected(view.getConservationSelected());\r
\r
- af.viewport.setShowFullId(view.getShowFullId());\r
- af.fullSeqId.setSelected(view.getShowFullId());\r
+ af.viewport.setShowJVSuffix(view.getShowFullId());\r
+ af.seqLimits.setSelected(view.getShowFullId());\r
\r
af.viewport.setFont(new java.awt.Font(view.getFontName(),\r
view.getFontStyle(), view.getFontSize()));\r
\r
if (view.getShowSequenceFeatures())\r
{\r
- af.viewport.showSequenceFeatures = true;\r
- af.sequenceFeatures.setSelected(true);\r
- new SequenceFeatureFetcher(al, af.alignPanel);\r
- al.featuresAdded = true;\r
+ af.viewport.showSequenceFeatures = true;\r
+ af.showSeqFeatures.setSelected(true);\r
+ }\r
+\r
+ if(jms.getFeatureSettings()!=null)\r
+ {\r
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed = new Vector();\r
+ // af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null)\r
+ // jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings();\r
+ for(int fs=0; fs<jms.getFeatureSettings().getSettingCount(); fs++)\r
+ {\r
+ Setting setting = jms.getFeatureSettings().getSetting(fs);\r
+\r
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(setting.getType(),\r
+ new java.awt.Color(setting.getColour()));\r
+ if(setting.getDisplay())\r
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed.addElement(setting.getType());\r
+ }\r
}\r
\r
Desktop.addInternalFrame(af, view.getTitle(),\r