From: Jim Procter Date: Sun, 2 Oct 2016 11:24:30 +0000 (+0100) Subject: JAL-2210 two pass attempt to import retrieved sequences. First pass relies on matchin... X-Git-Tag: Release_2_10_0~20^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=655b78299307682a4c7a6e5af0ed4618cbc9c924;p=jalview.git JAL-2210 two pass attempt to import retrieved sequences. First pass relies on matching DBRefEntry pairs, but if no sequences were added, link sequences and matching xrefs via accessions in sequence names and try import again. --- diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 31b35ec..71b0aa0 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -421,19 +421,27 @@ public class CrossRef if (retrieved != null) { - updateDbrefMappings(seq, xrfs, retrieved, cf, fromDna); + boolean addedXref = false; for (SequenceI retrievedSequence : retrieved) { // dataset gets contaminated ccwith non-ds sequences. why ??! // try: Ensembl -> Nuc->Ensembl, Nuc->Uniprot-->Protein->EMBL-> SequenceI retrievedDss = retrievedSequence.getDatasetSequence() == null ? retrievedSequence : retrievedSequence.getDatasetSequence(); - importCrossRefSeq(cf, dss, retrievedDss); - rseqs.add(retrievedDss); - if (dataset.findIndex(retrievedDss) == -1) + addedXref |= importCrossRefSeq(cf, dss, retrievedDss); + } + if (!addedXref) + { + // try again, after looking for matching IDs + // shouldn't need to do this unless the dbref mechanism has broken. + updateDbrefMappings(seq, xrfs, retrieved, cf, fromDna); + for (SequenceI retrievedSequence : retrieved) { - dataset.addSequence(retrievedDss); - matcher.add(retrievedDss); + // dataset gets contaminated ccwith non-ds sequences. why ??! + // try: Ensembl -> Nuc->Ensembl, Nuc->Uniprot-->Protein->EMBL-> + SequenceI retrievedDss = retrievedSequence.getDatasetSequence() == null ? retrievedSequence + : retrievedSequence.getDatasetSequence(); + addedXref |= importCrossRefSeq(cf, dss, retrievedDss); } } }