From bc2ce1cf981d29d65f44cfcfa7bc4c8f00ee2354 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 2 Nov 2005 16:07:05 +0000 Subject: [PATCH] Allow residue prefix to dataset --- src/jalview/io/SequenceFeatureFetcher.java | 33 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/jalview/io/SequenceFeatureFetcher.java b/src/jalview/io/SequenceFeatureFetcher.java index 44ce60b..108fe08 100755 --- a/src/jalview/io/SequenceFeatureFetcher.java +++ b/src/jalview/io/SequenceFeatureFetcher.java @@ -220,13 +220,38 @@ public class SequenceFeatureFetcher implements Runnable int absStart = entry.getUniprotSequence().getContent().indexOf( nonGapped.toString()); + int residueOffset = 0; if (absStart == -1) { - unknownSequences.add(sequence.getName()); - sbuffer.append(sequence.getName() + - " SEQUENCE NOT %100 MATCH \n"); + // Is UniprotSequence contained in dataset sequence? + absStart = nonGapped.toString().indexOf(entry.getUniprotSequence().getContent()); + if(absStart == -1) + { + unknownSequences.add(sequence.getName()); + sbuffer.append(sequence.getName() + + " SEQUENCE NOT %100 MATCH \n"); + + continue; + } + else + { + if(entry.getFeatures()!=null) + { + Enumeration e = entry.getFeatures().elements(); + while (e.hasMoreElements()) + { + SequenceFeature sf = (SequenceFeature) e.nextElement(); + sf.setBegin(sf.getBegin() + absStart + 1); + sf.setEnd(sf.getEnd() + absStart + 1); + } + } + + sbuffer.append(sequence.getName() + + " HAS "+absStart+" PREFIXED RESIDUES COMPARED TO UNIPROT - ANY SEQUENCE FEATURES" + +" HAVE BEEN ADJUSTED ACCORDINGLY \n"); + absStart = 0; + } - continue; } int absEnd = absStart + nonGapped.toString().length(); -- 1.7.10.2