From 42ed1251f862e7b06be27ab205406afdc6a6f317 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 7 Apr 2009 11:27:06 +0000 Subject: [PATCH] fix to ensure multiple accessions can be fetched for sources like the PDB (see jalview-discuss thread) --- src/jalview/datamodel/Alignment.java | 112 ++++++++++++++++++++++++++++++++- src/jalview/datamodel/AlignmentI.java | 10 +++ src/jalview/gui/AlignFrame.java | 6 ++ src/jalview/gui/SequenceFetcher.java | 64 ++++++++++++++++++- 4 files changed, 188 insertions(+), 4 deletions(-) diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 1312e22..981fdfa 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -442,7 +442,11 @@ public class Alignment implements AlignmentI } - /** */ + /* + * (non-Javadoc) + * + * @see jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SequenceI) + */ public int findIndex(SequenceI s) { int i = 0; @@ -904,4 +908,110 @@ public class Alignment implements AlignmentI } return removed; } + + public void append(AlignmentI toappend) + { + // TODO test this method for a future 2.5 release + // currently tested for use in jalview.gui.SequenceFetcher + boolean samegap = toappend.getGapCharacter()==getGapCharacter(); + char oldc = toappend.getGapCharacter(); + boolean hashidden = toappend.getHiddenSequences()!=null && toappend.getHiddenSequences().hiddenSequences!=null; + // get all sequences including any hidden ones + Vector sqs = (hashidden) ? toappend.getHiddenSequences().getFullAlignment().getSequences() : toappend.getSequences(); + if (sqs != null) + { + Enumeration sq = sqs.elements(); + while (sq.hasMoreElements()) + { + SequenceI addedsq=(SequenceI) sq.nextElement(); + if (!samegap) + { + char[] oldseq = addedsq.getSequence(); + for (int c=0;c0) + { + af.setShowSeqFeatures(true); + break; + } + } + } Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); -- 1.7.10.2