+ this.selectedSources = selectedSources;\r
+ this.sequences = sequences;\r
+ this.af = af;\r
+\r
+ int uniprotCount = 0;\r
+ for (int i = 0; i < selectedSources.size(); i++)\r
+ {\r
+ DasSource source = (DasSource) selectedSources.elementAt(i);\r
+ DasCoordinateSystem[] coords = source.getCoordinateSystem();\r
+ for (int c = 0; c < coords.length; c++)\r
+ {\r
+ System.out.println(coords[c].getName());\r
+ if (coords[c].getName().indexOf("UniProt")>-1)\r
+ {\r
+ uniprotCount++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ int refCount = 0;\r
+ for(int i=0; i<sequences.length; i++)\r
+ {\r
+ DBRefEntry [] dbref = sequences[i].getDBRef();\r
+ if(dbref!=null)\r
+ {\r
+ for(int j=0; j<dbref.length; j++)\r
+ {\r
+ System.out.println(dbref[j].getSource()\r
+ +" "+jalview.datamodel.DBRefSource.UNIPROT);\r
+ if(dbref[j].getSource()\r
+ .equals(jalview.datamodel.DBRefSource.UNIPROT))\r
+ {\r
+ System.out.println("got a match");\r
+ refCount++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ System.out.println(refCount+" "+uniprotCount+" "+sequences.length);\r
+ if(refCount<sequences.length && uniprotCount>0)\r
+ {\r
+\r
+ int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,\r
+ "Do you want Jalview to find\n"\r
+ +"Uniprot Accession ids for given sequence names?",\r
+ "Find Uniprot Accession Ids",\r
+ JOptionPane.YES_NO_OPTION,\r
+ JOptionPane.QUESTION_MESSAGE);\r
+\r
+ if(reply == JOptionPane.YES_OPTION)\r
+ {\r
+ new DBRefFetcher(\r
+ af.getViewport().getAlignment(), af).fetchDBRefs(true);\r
+\r
+ }\r
+ }\r
+\r
+ System.out.println("User selection is "\r
+ +\r
+ ( ( (float) uniprotCount / (float) selectedSources.size()) * 100)\r
+ + " % Uniprot, and "+refCount+" / " +sequences.length+" have uniprot accession");\r
+\r