From: amwaterhouse Date: Mon, 5 Dec 2005 13:39:01 +0000 (+0000) Subject: Allow for uniprot in name X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6efabb12ac7f2ed3bb6bb9e47505cf0112784837;p=jalview.git Allow for uniprot in name --- diff --git a/src/jalview/io/SequenceFeatureFetcher.java b/src/jalview/io/SequenceFeatureFetcher.java index b766627..d980b0a 100755 --- a/src/jalview/io/SequenceFeatureFetcher.java +++ b/src/jalview/io/SequenceFeatureFetcher.java @@ -48,6 +48,7 @@ public class SequenceFeatureFetcher implements Runnable ArrayList unknownSequences; CutAndPasteTransfer output = new CutAndPasteTransfer(); StringBuffer sbuffer = new StringBuffer(); + boolean uniprotFlag = false; public SequenceFeatureFetcher() {} @@ -129,6 +130,12 @@ public class SequenceFeatureFetcher implements Runnable StringBuffer remainingIds = new StringBuffer("uniprot:"); for (int i = 0; i < ids.size(); i++) { + if(ids.get(i).toString().indexOf("|")>-1) + { + remainingIds.append(ids.get(i).toString().substring( + ids.get(i).toString().lastIndexOf("|") + 1)); + uniprotFlag = true; + } remainingIds.append(ids.get(i) + ";"); } EBIFetchClient ebi = new EBIFetchClient(); @@ -218,13 +225,21 @@ public class SequenceFeatureFetcher implements Runnable sequence = dataset.findName(idmatch); } - if (sequence == null) + if(sequence!=null) + ids.remove(sequence.getName()); + + else if (sequence == null && uniprotFlag) + { + sequence = dataset.findName("UniProt/Swiss-Prot|"+entry.getAccession().elementAt(0)+"|"+idmatch); + ids.remove(idmatch); + } + + if(sequence ==null) { System.out.println(idmatch+" not found"); continue; } - ids.remove(sequence.getName()); unknownSequences.remove(sequence); String nonGapped = AlignSeq.extractGaps("-. ", sequence.getSequence());