X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FCrossRef.java;h=1c14240e49f3b49414cec522c5f2d41ee372d53e;hb=153dd62dc91da13ae732600e6ea55ddbe15eab39;hp=7002f07bf305f2a77a91974956ccbf71a9397d32;hpb=2de8acfae59aced665e4c37ad0f7dcc2ed68818e;p=jalview.git diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 7002f07..1c14240 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) - * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) + * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This file is part of Jalview. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.analysis; @@ -79,7 +78,7 @@ public class CrossRef /** * @param dna - * true if seqs are DNA seqs + * true if seqs are DNA seqs * @param seqs * @return a list of sequence database cross reference source types */ @@ -93,7 +92,7 @@ public class CrossRef * any of the direct DBRefEntrys on the given sequences. * * @param dna - * true if seqs are DNA seqs + * true if seqs are DNA seqs * @param seqs * @return a list of sequence database cross reference source types */ @@ -219,7 +218,7 @@ public class CrossRef * @param dna * @param source * @param dataset - * alignment to search for product sequences. + * alignment to search for product sequences. * @return products (as dataset sequences) */ public static Alignment findXrefSequences(SequenceI[] seqs, boolean dna, @@ -286,7 +285,7 @@ public class CrossRef // xrefs on this sequence. if (dataset != null) { - found |= searchDataset(dss, xrfs[r], dataset, rseqs, cf); + found |= searchDataset(dss, xrfs[r], dataset, rseqs, cf); // ,false,!dna); if (found) xrfs[r] = null; // we've recovered seqs for this one. } @@ -449,7 +448,7 @@ public class CrossRef * @param xrf * @param dataset * @param rseqs - * set of unique sequences + * set of unique sequences * @param cf * @return true if one or more unique sequences were found and added */ @@ -468,10 +467,10 @@ public class CrossRef * @param xrf * @param dataset * @param rseqs - * @param direct - - * search all references or only subset + * @param direct + * - search all references or only subset * @param dna - * search dna or protein xrefs (if direct=false) + * search dna or protein xrefs (if direct=false) * @return true if relationship found and sequence added. */ public static boolean searchDataset(SequenceI sequenceI, DBRefEntry xrf, @@ -512,16 +511,15 @@ public class CrossRef } // look for direct or indirect references in common - DBRefEntry[] poss = null, cands = null; + DBRefEntry[] poss = nxt.getDBRef(), cands = null; if (direct) { - cands = jalview.util.DBRefUtils.searchRefs(poss = nxt - .getDBRef(), xrf); + cands = jalview.util.DBRefUtils.searchRefs(poss, xrf); } else { - cands = jalview.util.DBRefUtils.searchRefs(poss = CrossRef - .findXDbRefs(dna, nxt.getDBRef()), xrf); + poss = CrossRef.findXDbRefs(dna, poss); // + cands = jalview.util.DBRefUtils.searchRefs(poss, xrf); } if (cands != null) { @@ -572,8 +570,8 @@ public class CrossRef * @param dna * @param seqs * @param dataset - * @param fake - - * don't actually build lists - just get types + * @param fake + * - don't actually build lists - just get types * @return public static Object[] buildXProductsList(boolean dna, SequenceI[] * seqs, AlignmentI dataset, boolean fake) { String types[] = * jalview.analysis.CrossRef.findSequenceXrefTypes( dna, seqs, @@ -582,19 +580,19 @@ public class CrossRef * System.out.println("Type: " + types[t]); SequenceI[] prod = * jalview.analysis.CrossRef.findXrefSequences(seqs, dna, types[t]); * System.out.println("Found " + ((prod == null) ? "no" : "" + - * prod.length) + " products"); if (prod!=null) { for (int p=0; p