From f1671000d7556b46d63e676b83b3f7b6e9179849 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 10 Nov 2005 11:08:31 +0000 Subject: [PATCH] OnlyAddPDBEntries --- src/jalview/io/SequenceFeatureFetcher.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/jalview/io/SequenceFeatureFetcher.java b/src/jalview/io/SequenceFeatureFetcher.java index 8bd9bab..5ecb417 100755 --- a/src/jalview/io/SequenceFeatureFetcher.java +++ b/src/jalview/io/SequenceFeatureFetcher.java @@ -196,7 +196,6 @@ public class SequenceFeatureFetcher implements Runnable return; SequenceI sequence = null; - // String pdb = null; Vector entries = getUniprotEntries(file); @@ -217,7 +216,7 @@ public class SequenceFeatureFetcher implements Runnable if (sequence == null) { - System.out.println("not found"); + System.out.println(idmatch+" not found"); continue; } @@ -229,7 +228,6 @@ public class SequenceFeatureFetcher implements Runnable int absStart = entry.getUniprotSequence().getContent().indexOf( nonGapped.toString()); - int residueOffset = 0; if (absStart == -1) { // Is UniprotSequence contained in dataset sequence? @@ -244,9 +242,9 @@ public class SequenceFeatureFetcher implements Runnable } else { - if(entry.getFeatures()!=null) + if(entry.getFeature()!=null) { - Enumeration e = entry.getFeatures().elements(); + Enumeration e = entry.getFeature().elements(); while (e.hasMoreElements()) { SequenceFeature sf = (SequenceFeature) e.nextElement(); @@ -266,7 +264,19 @@ public class SequenceFeatureFetcher implements Runnable int absEnd = absStart + nonGapped.toString().length(); absStart += 1; - sequence.setSequenceFeatures(entry.getFeatures()); + Enumeration e = entry.getDbReference().elements(); + Vector onlyPdbEntries = new Vector(); + while(e.hasMoreElements()) + { + PDBEntry pdb = (PDBEntry)e.nextElement(); + if(!pdb.getType().equals("PDB")) + continue; + + onlyPdbEntries.addElement(pdb); + } + + sequence.setPDBId(onlyPdbEntries); + sequence.setSequenceFeatures(entry.getFeature()); sequence.setStart(absStart); sequence.setEnd(absEnd); -- 1.7.10.2