From 4ec235370b49c38ae7e7b3a46f92f926fc430bf1 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 24 Jun 2009 08:28:23 +0000 Subject: [PATCH] all alignment sequences associated with a dataset sequence must have start-end updated (and any mappings adjusted - see TODO) --- src/jalview/ws/DBRefFetcher.java | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java index 1fd9f1c..73d106a 100644 --- a/src/jalview/ws/DBRefFetcher.java +++ b/src/jalview/ws/DBRefFetcher.java @@ -74,6 +74,8 @@ public class DBRefFetcher implements Runnable SequenceFetcher sfetcher; + private SequenceI[] alseqs; + public DBRefFetcher() { } @@ -106,9 +108,11 @@ public class DBRefFetcher implements Runnable public DBRefFetcher(SequenceI[] seqs, AlignFrame af, String[] sources) { this.af = af; + alseqs = new SequenceI[seqs.length]; SequenceI[] ds = new SequenceI[seqs.length]; for (int i = 0; i < seqs.length; i++) { + alseqs[i] = seqs[i]; if (seqs[i].getDatasetSequence() != null) ds[i] = seqs[i].getDatasetSequence(); else @@ -608,8 +612,9 @@ public class DBRefFetcher implements Runnable // absStart+sequence.getStart()+entrySeq.length()-1}, // new int[] { entry.getStart(), entry.getEnd() }, 1, 1); // relocate local features for updated start - if (updateRefFrame && sequence.getSequenceFeatures() != null) - { + if (updateRefFrame) { + if (sequence.getSequenceFeatures() != null) + { SequenceFeature[] sf = sequence.getSequenceFeatures(); int start = sequence.getStart(); int end = sequence.getEnd(); @@ -624,6 +629,7 @@ public class DBRefFetcher implements Runnable sf[sfi].setEnd(sf[sfi].getEnd() + startShift); } } + } } } @@ -638,6 +644,22 @@ public class DBRefFetcher implements Runnable // finally, update local sequence reference frame if we're allowed sequence.setStart(absStart); sequence.setEnd(absEnd); + // search for alignment sequences to update coordinate frame for + for (int alsq = 0; alsq