X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FCrossRef.java;h=2da87738f8c9350a6dae9ea7235b621880e76256;hb=49685e6426d5ac136dce4907196751680c667670;hp=f355d1f09c6d139e8c82344e91e46c97de635cd7;hpb=6b406c397d41a0f2d84b75f13e7ab478932bf57d;p=jalview.git diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index f355d1f..2da8773 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -1,3 +1,21 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) + * Copyright (C) 2008 AM Waterhouse, J Procter, 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 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. + * + * 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 + */ package jalview.analysis; import java.util.Enumeration; @@ -158,7 +176,8 @@ public class CrossRef { if (cdna[c].getSource().equals(DBRefSource.EMBLCDS)) { - // retrieve CDS dataset sequences + System.err.println("TODO: unimplemented sequence retrieval for coding region sequence."); + // TODO: retrieve CDS dataset sequences // need global dataset sequence retriever/resolver to reuse refs // and construct Mapping entry. // insert gaps in CDS according to peptide gaps. @@ -444,6 +463,7 @@ public class CrossRef boolean direct, boolean dna) { boolean found = false; + SequenceI[] typer=new SequenceI[1]; if (dataset == null) return false; if (dataset.getSequences() == null) @@ -464,6 +484,17 @@ public class CrossRef } if (nxt != sequenceI && nxt != sequenceI.getDatasetSequence()) { + // check if this is the correct sequence type + { + typer[0] = nxt; + boolean isDna = jalview.util.Comparison.isNucleotide(typer); + if ((direct && isDna == dna) || (!direct && isDna!=dna)) + { + // skip this sequence because it is same molecule type + continue; + } + } + // look for direct or indirect references in common DBRefEntry[] poss = null, cands = null; if (direct) @@ -549,4 +580,4 @@ public class CrossRef * System.out.println("Prod "+p+": "+prod[p].getDisplayId(true)); } } * } } */ -} \ No newline at end of file +}