import jalview.schemes.*;
-import jalview.gui.*;
-
import java.io.*;
import java.net.*;
*/
Hashtable viewportsAdded;
+ Hashtable annotationIds = new Hashtable();
+
String uniqueSetSuffix = "";
{
jseq.setHidden(av.alignment.getHiddenSequences().isHidden(jds));
- if(jal.getSequenceAt(i).getHiddenSequences()!=null)
+ if(av.hiddenRepSequences!=null
+ && av.hiddenRepSequences.containsKey(jal.getSequenceAt(i)))
{
- jalview.datamodel.SequenceI [] reps =
- jal.getSequenceAt(i).getHiddenSequences().getSequencesInOrder(jal);
+ jalview.datamodel.SequenceI[] reps =
+ ( (jalview.datamodel.SequenceGroup)
+ av.hiddenRepSequences.get(
+ jal.getSequenceAt(i))).getSequencesInOrder(jal);
for(int h=0; h<reps.length; h++)
{
- jseq.addHiddenSequences(
- jal.findIndex(reps[h])
- );
+ if (reps[h] != jal.getSequenceAt(i))
+ jseq.addHiddenSequences(
+ jal.findIndex(reps[h])
+ );
}
}
}
{
Annotation an = new Annotation();
- if (aa[i].label.equals("Quality") ||
- aa[i].label.equals("Conservation") ||
- aa[i].label.equals("Consensus"))
+ if(aa[i].annotationId!=null)
+ {
+ annotationIds.put(aa[i].annotationId, aa[i]);
+ }
+
+ an.setId(aa[i].annotationId);
+
+ if (aa[i]==av.quality ||
+ aa[i]==av.conservation ||
+ aa[i]==av.consensus)
{
an.setLabel(aa[i].label);
an.setGraph(true);
groups[i].setTextCol2(sg.textColour2.getRGB());
groups[i].setTextColThreshold(sg.thresholdTextColour);
- for (int s = 0; s < sg.getSize(false); s++)
+ for (int s = 0; s < sg.getSize(); s++)
{
jalview.datamodel.Sequence seq =
(jalview.datamodel.Sequence) sg.getSequenceAt(s);
System.out.println("Successfully loaded archive file");
return af;
}
+ ex.printStackTrace();
System.err.println("Exception whilst loading jalview XML file : " +
ex + "\n");
continue;
}
+ if (an[i].getId() != null
+ && annotationIds.containsKey(an[i].getId()))
+ {
+ al.addAnnotation(
+ (jalview.datamodel.AlignmentAnnotation)annotationIds.get(an[i].getId())
+ );
+
+ continue;
+ }
+
AnnotationElement[] ae = an[i].getAnnotationElement();
jalview.datamodel.Annotation[] anot = new jalview.datamodel.Annotation[al.getWidth()];
- for (int aa = 0; aa < ae.length; aa++)
+ 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(),
an[i].getDescription(), anot);
}
+ if(an[i].getId()!=null)
+ {
+ annotationIds.put(an[i].getId(), jaa);
+ jaa.annotationId = an[i].getId();
+ }
+
if(an[i].getSequenceRef()!=null)
{
jaa.createSequenceMapping(
for (int s = 0; s < groups[i].getSeqCount(); s++)
{
String seqId = groups[i].getSeq(s)+"";
- seqs.addElement((jalview.datamodel.SequenceI) seqRefIds.get(seqId));
+ jalview.datamodel.SequenceI ts = (jalview.datamodel.SequenceI)
+ seqRefIds.get(seqId);
+
+ if (ts != null)
+ seqs.addElement(ts);
}
+ if(seqs.size()<1)
+ continue;
+
jalview.datamodel.SequenceGroup sg = new jalview.datamodel.SequenceGroup(seqs,
groups[i].getName(), cs, groups[i].getDisplayBoxes(),
groups[i].getDisplayText(), groups[i].getColourText(),
if (groups[i].getConsThreshold() != 0)
{
jalview.analysis.Conservation c = new jalview.analysis.Conservation("All",
- ResidueProperties.propHash, 3, sg.getSequences(false), 0,
+ ResidueProperties.propHash, 3, sg.getSequences(null), 0,
sg.getWidth() - 1);
c.calculate();
c.verdict(false, 25);
{
for(int s=0; s<JSEQ.length; s++)
{
+ jalview.datamodel.SequenceGroup hidden =
+ new jalview.datamodel.SequenceGroup();
+
for(int r=0; r<JSEQ[s].getHiddenSequencesCount(); r++)
{
- al.getSequenceAt(s).addHiddenSequence(
- al.getSequenceAt( JSEQ[s].getHiddenSequences(r) )
+ hidden.addSequence(
+ al.getSequenceAt(JSEQ[s].getHiddenSequences(r))
+ , false
);
}
+ af.viewport.hideRepSequences(al.getSequenceAt(s), hidden);
}
jalview.datamodel.SequenceI [] hseqs = new
af.alignPanels.clear();
af.closeMenuItem_actionPerformed(true);
+ /* if(ap.av.alignment.getAlignmentAnnotation()!=null)
+ {
+ for(int i=0; i<ap.av.alignment.getAlignmentAnnotation().length; i++)
+ {
+ if(!ap.av.alignment.getAlignmentAnnotation()[i].autoCalculated)
+ {
+ af.alignPanel.av.alignment.getAlignmentAnnotation()[i] =
+ ap.av.alignment.getAlignmentAnnotation()[i];
+ }
+ }
+ } */
+
return af.alignPanel;
}
}