From: Jim Procter Date: Thu, 27 Nov 2014 15:58:51 +0000 (+0000) Subject: JAL-1177 JAL-905 cannot recover sequences from dataset if dataset is currently being... X-Git-Tag: Jalview_2_9~137^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3ee0ddbd50e6a0fb9f04c00bf845288a5a137f2f;p=jalview.git JAL-1177 JAL-905 cannot recover sequences from dataset if dataset is currently being recovered --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index d56a0dd..d003cb0 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -498,7 +498,7 @@ public class Jalview2XML for (String dssids : dsses.keySet()) { AlignFrame _af = dsses.get(dssids); - String jfileName = MessageManager.formatMessage("label.dataset_for", new String[]{fileName,_af.getTitle()}); + String jfileName = fileName + " Dataset for " + _af.getTitle(); if (!jfileName.endsWith(".xml")) { jfileName = jfileName + ".xml"; @@ -2313,7 +2313,10 @@ public class Jalview2XML } else { - recoverDatasetFor(vamsasSet, al); + // recover dataset - passing on flag indicating if this a 'viewless' + // sequence set (a.k.a. a stored dataset for the project) + recoverDatasetFor(vamsasSet, al, object.getJalviewModelSequence() + .getViewportCount() == 0); } // /////////////////////////////// @@ -3985,7 +3988,8 @@ public class Jalview2XML } } - private void recoverDatasetFor(SequenceSet vamsasSet, Alignment al) + private void recoverDatasetFor(SequenceSet vamsasSet, Alignment al, + boolean ignoreUnrefed) { jalview.datamodel.Alignment ds = getDatasetFor(vamsasSet.getDatasetId()); Vector dseqs = null; @@ -3997,7 +4001,7 @@ public class Jalview2XML for (int i = 0, iSize = vamsasSet.getSequenceCount(); i < iSize; i++) { Sequence vamsasSeq = vamsasSet.getSequence(i); - ensureJalviewDatasetSequence(vamsasSeq, ds, dseqs); + ensureJalviewDatasetSequence(vamsasSeq, ds, dseqs, ignoreUnrefed); } // create a new dataset if (ds == null) @@ -4026,7 +4030,7 @@ public class Jalview2XML * vector to add new dataset sequence to */ private void ensureJalviewDatasetSequence(Sequence vamsasSeq, - AlignmentI ds, Vector dseqs) + AlignmentI ds, Vector dseqs, boolean ignoreUnrefed) { // JBP TODO: Check this is called for AlCodonFrames to support recovery of // xRef Codon Maps @@ -4037,7 +4041,10 @@ public class Jalview2XML { dsq = sq.getDatasetSequence(); } - + if (sq == null && ignoreUnrefed) + { + return; + } String sqid = vamsasSeq.getDsseqid(); if (dsq == null) {