From 655b78299307682a4c7a6e5af0ed4618cbc9c924 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 2 Oct 2016 12:24:30 +0100 Subject: [PATCH] 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. --- src/jalview/analysis/CrossRef.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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); } } } -- 1.7.10.2