X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FDasSequenceFeatureFetcher.java;h=2f94d64bf721402d910b9ff9744d8ee3e4ab5b2c;hb=4741fc6fc72b7c5ffd75af5b1bc17070fef448f9;hp=33791ad773008352344294067f74eeb425336896;hpb=ac5f3842d7230ae9761f2330b86e515efab29ee5;p=jalview.git diff --git a/src/jalview/io/DasSequenceFeatureFetcher.java b/src/jalview/io/DasSequenceFeatureFetcher.java index 33791ad..2f94d64 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(); } } @@ -173,6 +172,8 @@ public class DasSequenceFeatureFetcher { System.out.println("No DAS Sources active"); af.setProgressBar("No DAS Sources Active", startTime); + cancelled = true; + fsettings.noDasSourceActive(); return; } @@ -250,7 +251,9 @@ public class DasSequenceFeatureFetcher void nextSequence(DasSource dasSource, SequenceI seq) { - DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), + if (cancelled) + return; + DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), new String[] { // jalview.datamodel.DBRefSource.PDB, @@ -264,11 +267,11 @@ public class DasSequenceFeatureFetcher if (uprefs != null) { // do any of these ids match the source's coordinate system ? - for (int j = 0; j < uprefs.length; j++) + for (int j = 0; !dasCoordSysFound && j < uprefs.length; j++) { DasCoordinateSystem cs[] = dasSource.getCoordinateSystem(); - for(int csIndex=0; csIndex 0 && jalview.util.DBRefUtils .isDasCoordinateSystem(cs[csIndex].getName(), uprefs[j])) @@ -281,11 +284,10 @@ public class DasSequenceFeatureFetcher System.out.println(seq.getName() + " " + (seq.getDatasetSequence() == null) + " " + dasSource.getUrl()); - dasCoordSysFound = false; + dasCoordSysFound = true; // break's out of the loop 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()); @@ -372,7 +374,19 @@ public class DasSequenceFeatureFetcher source.getNickname()); if (dbref.getMap()!=null && f.getBegin()>0 && f.getEnd()>0) { Cache.log.debug("mapping from "+f.getBegin()+" - "+f.getEnd()); - SequenceFeature vf[] = dbref.getMap().locateFeature(f); + SequenceFeature vf[]=null; + + try { + vf = dbref.getMap().locateFeature(f); + } + catch (Exception ex) + { + Cache.log.info("Error in 'experimental' mapping of features. Please try to reproduce and then report info to help@jalview.org."); + Cache.log.info("Mapping feature from "+f.getBegin()+" to "+f.getEnd()+" in dbref "+dbref.getAccessionId()+" in "+dbref.getSource()); + Cache.log.info("using das Source "+ds.getUrl()); + Cache.log.info(ex); + } + if (vf!=null) { for (int v=0;v