From ac5f3842d7230ae9761f2330b86e515efab29ee5 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 4 Apr 2007 13:10:57 +0000 Subject: [PATCH] flag for dasCoordSysFound added --- src/jalview/io/DasSequenceFeatureFetcher.java | 49 ++++++++++++++++--------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index a4dc777..33791ad 100755 --- a/src/jalview/io/DasSequenceFeatureFetcher.java +++ b/src/jalview/io/DasSequenceFeatureFetcher.java @@ -258,29 +258,42 @@ public class DasSequenceFeatureFetcher // jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord sys sources }); // TODO: minimal list of DAS queries to make by querying with untyped ID if distinct from any typed IDs - if (uprefs != null) + + boolean dasCoordSysFound = false; + + if (uprefs != null) { // do any of these ids match the source's coordinate system ? for (int j = 0; j < uprefs.length; j++) { DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); - - if(cs.length>0 && jalview.util.DBRefUtils - .isDasCoordinateSystem(cs[0].getName(), uprefs[j])) + + for(int csIndex=0; csIndex 0 && jalview.util.DBRefUtils + .isDasCoordinateSystem(cs[csIndex].getName(), uprefs[j])) + { + Cache.log.debug("Launched fetcher for coordinate system " + + cs[0].getName()); + // Will have to pass any mapping information to the fetcher + //- the start/end for the DBRefEntry may not be the same as the sequence's start/end + + System.out.println(seq.getName() + " " + (seq.getDatasetSequence() == null) + + " " + dasSource.getUrl()); + + dasCoordSysFound = false; + createFeatureFetcher(seq, + dasSource, + uprefs[j]); + break; // only do this for one reference - assume same source will send same features for all IDs + } + else + System.out.println("IGNORE " + cs[csIndex].getName()); } } } - else + + if(!dasCoordSysFound) { String id = null; // try and use the name as the sequence id @@ -312,16 +325,16 @@ public class DasSequenceFeatureFetcher * @param seq * @param SourceUrl * @param dbref - */ + */ protected void createFeatureFetcher(final SequenceI seq, final DasSource dasSource, final DBRefEntry dbref) { - + ////////////// /// fetch DAS features final Das1Source source = new Das1Source(); source.setUrl(dasSource.getUrl()); source.setNickname(dasSource.getNickname()); - if (dbref==null || dbref.getAccessionId()==null || dbref.getAccessionId().length()<1) + if (dbref==null || dbref.getAccessionId()==null || dbref.getAccessionId().length()<1) { return; } @@ -361,7 +374,7 @@ public class DasSequenceFeatureFetcher Cache.log.debug("mapping from "+f.getBegin()+" - "+f.getEnd()); SequenceFeature vf[] = dbref.getMap().locateFeature(f); if (vf!=null) { - for (int v=0;v