X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FDasSequenceFeatureFetcher.java;h=676a4b61d1fd69bd39c563eadb19ae086727ce0b;hb=c5cece0a9d56e59293c8e6497b5afa6e26842646;hp=808d9a076c125ad7597cd4ec09e646d42f73986a;hpb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;p=jalview.git diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java index 808d9a0..676a4b6 100644 --- a/src/jalview/ws/DasSequenceFeatureFetcher.java +++ b/src/jalview/ws/DasSequenceFeatureFetcher.java @@ -22,11 +22,14 @@ package jalview.ws; import jalview.bin.Cache; import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.gui.Desktop; import jalview.gui.FeatureSettings; +import jalview.gui.JvOptionPane; +import jalview.util.DBRefUtils; import jalview.util.MessageManager; import jalview.util.UrlLink; import jalview.ws.dbsources.das.api.DasSourceRegistryI; @@ -44,8 +47,6 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.Vector; -import javax.swing.JOptionPane; - import org.biodas.jdas.client.FeaturesClient; import org.biodas.jdas.client.adapters.features.DasGFFAdapter; import org.biodas.jdas.client.adapters.features.DasGFFAdapter.GFFAdapter; @@ -181,13 +182,12 @@ public class DasSequenceFeatureFetcher int refCount = 0; for (int i = 0; i < sequences.length; i++) { - DBRefEntry[] dbref = sequences[i].getDBRef(); + DBRefEntry[] dbref = sequences[i].getDBRefs(); if (dbref != null) { for (int j = 0; j < dbref.length; j++) { - if (dbref[j].getSource().equals( - jalview.datamodel.DBRefSource.UNIPROT)) + if (dbref[j].getSource().equals(DBRefSource.UNIPROT)) { refCount++; break; @@ -199,21 +199,21 @@ public class DasSequenceFeatureFetcher if (checkDbrefs && refCount < sequences.length && uniprotCount > 0) { - int reply = JOptionPane.YES_OPTION; + int reply = JvOptionPane.YES_OPTION; if (promptFetchDbrefs) { - reply = JOptionPane + reply = JvOptionPane .showInternalConfirmDialog( Desktop.desktop, MessageManager .getString("info.you_want_jalview_to_find_uniprot_accessions"), MessageManager .getString("label.find_uniprot_accession_ids"), - JOptionPane.YES_NO_OPTION, - JOptionPane.QUESTION_MESSAGE); + JvOptionPane.YES_NO_OPTION, + JvOptionPane.QUESTION_MESSAGE); } - if (reply == JOptionPane.YES_OPTION) + if (reply == JvOptionPane.YES_OPTION) { Thread thread = new Thread(new FetchDBRefs()); thread.start(); @@ -238,6 +238,7 @@ public class DasSequenceFeatureFetcher class FetchSeqFeatures implements Runnable { + @Override public void run() { startFetching(); @@ -247,10 +248,14 @@ public class DasSequenceFeatureFetcher class FetchDBRefs implements Runnable { + @Override public void run() { running = true; - new DBRefFetcher(sequences, af).fetchDBRefs(true); + boolean isNucleotide = af.getViewport().getAlignment().isNucleotide(); + new DBRefFetcher(sequences, af, null, af.featureSettings, + isNucleotide).fetchDBRefs(true); + startFetching(); setGuiFetchComplete(); } @@ -280,8 +285,7 @@ public class DasSequenceFeatureFetcher { jalviewSourceI[] sources = sourceRegistry.getSources().toArray( new jalviewSourceI[0]); - String active = jalview.bin.Cache.getDefault("DAS_ACTIVE_SOURCE", - "uniprot"); + String active = Cache.getDefault("DAS_ACTIVE_SOURCE", "uniprot"); StringTokenizer st = new StringTokenizer(active, "\t"); selectedSources = new Vector(); String token; @@ -637,10 +641,10 @@ public class DasSequenceFeatureFetcher { return null; } - DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs( - seq.getDBRef(), new String[] { + DBRefEntry[] uprefs = DBRefUtils.selectRefs(seq.getDBRefs(), + new String[] { // jalview.datamodel.DBRefSource.PDB, - jalview.datamodel.DBRefSource.UNIPROT, + DBRefSource.UNIPROT, // jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord // sys sources }); @@ -659,8 +663,8 @@ public class DasSequenceFeatureFetcher for (COORDINATES csys : dasSource.getVersion().getCOORDINATES()) { - if (jalview.util.DBRefUtils.isDasCoordinateSystem( - csys.getAuthority(), uprefs[j])) + if (DBRefUtils.isDasCoordinateSystem(csys.getAuthority(), + uprefs[j])) { debug("Launched fetcher for coordinate system " + csys.getAuthority());