X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblXmlSource.java;h=73e67aa2ea377c7a912ee4885174cf685cea5ac6;hb=30b2b47cbdfa35b127b0fb09e911815cddd9ed7b;hp=008522136f00a787cda134b3f3e0cfad4ea7c3ac;hpb=9fe87bd08ab29b6fe53364f387d7a2e3a8d39994;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index 0085221..73e67aa 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -63,7 +63,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy try { reply = dbFetch.fetchDataAsFile( - emprefx.toLowerCase() + ":" + query.trim(), "emblxml", null, + emprefx.toLowerCase() + ":" + query.trim(), "display=xml", ".xml"); } catch (Exception e) { @@ -72,7 +72,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy "exception.ebiembl_retrieval_failed_on", new String[] { emprefx.toLowerCase(), query.trim() }), e); } - return getEmblSequenceRecords(emprefx, query, reply); + return getEmblSequenceRecords(emprefx, reply); } /** @@ -81,46 +81,38 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy * @param emprefx * either EMBL or EMBLCDS strings are allowed - anything else will * not retrieve emblxml - * @param query * @param file * the EMBL XML file containing the results of a query * @return * @throws Exception */ - public AlignmentI getEmblSequenceRecords(String emprefx, String query, - File reply) throws Exception + public AlignmentI getEmblSequenceRecords(String emprefx, File reply) + throws Exception { - EmblFile efile = null; - List seqs = new ArrayList(); + EmblEntry entry = null; if (reply != null && reply.exists()) { file = reply.getAbsolutePath(); if (reply.length() > EMBL_NOT_FOUND_REPLY.length()) { - efile = EmblFile.getEmblFile(reply); + entry = EmblFile.getEmblEntry(reply); } } + // TODO don't need peptides any more? List peptides = new ArrayList(); - if (efile != null) + AlignmentI al = null; + if (entry != null) { - for (EmblEntry entry : efile.getEntries()) + SequenceI seq = entry.getSequence(emprefx, peptides); + if (seq != null) { - SequenceI seq = entry.getSequence(emprefx, peptides); - if (seq != null) - { - seqs.add(seq.deriveSequence()); - // place DBReferences on dataset and refer - } + seq.deriveSequence(); + // place DBReferences on dataset and refer + al = new Alignment(new SequenceI[] { seq }); } } - - AlignmentI al = null; - if (!seqs.isEmpty()) - { - al = new Alignment(seqs.toArray(new SequenceI[seqs.size()])); - } stopQuery(); return al; }