From 25a1c531a180d6d5620c0d065c3515b06464dd29 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 31 Oct 2005 15:53:31 +0000 Subject: [PATCH] Prompt before blasting --- src/jalview/io/SequenceFeatureFetcher.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jalview/io/SequenceFeatureFetcher.java b/src/jalview/io/SequenceFeatureFetcher.java index 520ba03..35a9a95 100755 --- a/src/jalview/io/SequenceFeatureFetcher.java +++ b/src/jalview/io/SequenceFeatureFetcher.java @@ -96,7 +96,7 @@ public class SequenceFeatureFetcher implements Runnable public SequenceFeatureFetcher(AlignmentI align, AlignmentPanel ap) { unknownSequences = new ArrayList(); - this.align = align; + this.align = align.getDataset(); this.ap = ap; Thread thread = new Thread(this); @@ -139,6 +139,7 @@ public class SequenceFeatureFetcher implements Runnable "xml", null); + if (file != null) { ReadUniprotFile(file, align, ids); @@ -163,6 +164,13 @@ public class SequenceFeatureFetcher implements Runnable if (unknownSequences.size() > 0) { + int reply = javax.swing.JOptionPane.showInternalConfirmDialog( + Desktop.desktop, "Couldn't find a match for "+unknownSequences.size()+" sequences." + +"\nPerform blast for unknown sequences?", + "Blast for Unidentified Sequences", + javax.swing.JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.QUESTION_MESSAGE); + + if(reply == javax.swing.JOptionPane.YES_OPTION) new WSWUBlastClient(ap, align, unknownSequences); } else @@ -194,18 +202,20 @@ public class SequenceFeatureFetcher implements Runnable for (i = 0; i < iSize; i++) { entry = (UniprotEntry) entries.elementAt(i); - String idmatch = entry.getAccession(); + String idmatch = entry.getAccession().elementAt(0).toString(); sequence = align.findName(idmatch); if (sequence == null) { //Sequence maybe Name, not Accession - idmatch = entry.getName(); + + idmatch = entry.getName().elementAt(0).toString();; sequence = align.findName(idmatch); } if (sequence == null) { + System.out.println("not found"); continue; } -- 1.7.10.2