From: amwaterhouse Date: Mon, 23 Apr 2007 11:44:46 +0000 (+0000) Subject: Only fetch refs for seelcted sequences X-Git-Tag: Release_2_3~198 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e7a099f0fa94511b2bfe092533a0b75e99fc3d29;p=jalview.git Only fetch refs for seelcted sequences --- diff --git a/src/jalview/io/DBRefFetcher.java b/src/jalview/io/DBRefFetcher.java index 437fee7..6d589f9 100644 --- a/src/jalview/io/DBRefFetcher.java +++ b/src/jalview/io/DBRefFetcher.java @@ -36,7 +36,7 @@ import jalview.gui.*; public class DBRefFetcher implements Runnable { - AlignmentI dataset; + SequenceI [] dataset; AlignFrame af; CutAndPasteTransfer output = new CutAndPasteTransfer(); StringBuffer sbuffer = new StringBuffer(); @@ -80,10 +80,18 @@ public class DBRefFetcher * @param align DOCUMENT ME! * @param ap DOCUMENT ME! */ - public DBRefFetcher(AlignmentI align, AlignFrame af) + public DBRefFetcher(SequenceI [] seqs, AlignFrame af) { this.af = af; - this.dataset = align.getDataset(); + SequenceI [] ds = new SequenceI[seqs.length]; + for (int i = 0; i < seqs.length; i++) + { + if(seqs[i].getDatasetSequence()!=null) + ds[i] = seqs[i].getDatasetSequence(); + else + ds[i] = seqs[i]; + } + this.dataset = ds; } public boolean fetchDBRefs(boolean waitTillFinished) @@ -157,16 +165,15 @@ public class DBRefFetcher try { int seqIndex = 0; - Vector sequences = dataset.getSequences(); - while (seqIndex < sequences.size()) + while (seqIndex < dataset.length) { StringBuffer queryString = new StringBuffer("uniprot:"); - for (int i = 0; (seqIndex < sequences.size()) && (i < 50); + for (int i = 0; (seqIndex < dataset.length) && (i < 50); seqIndex++, i++) { - Sequence sequence = (Sequence) sequences.get(seqIndex); + SequenceI sequence = dataset[seqIndex]; DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(sequence. getDBRef(), new String[] { diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index 33791ad..c8b5d3e 100755 --- a/src/jalview/io/DasSequenceFeatureFetcher.java +++ b/src/jalview/io/DasSequenceFeatureFetcher.java @@ -130,8 +130,7 @@ public class DasSequenceFeatureFetcher { public void run() { - new DBRefFetcher( - af.getViewport().getAlignment(), af).fetchDBRefs(true); + new DBRefFetcher(sequences, af).fetchDBRefs(true); startFetching(); } }