X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FComparison.java;h=d4fc233b901a57835f85c8a3705bb797072fa254;hb=20b398cdef84acd33f817d2f529139073f2771b3;hp=17d3a7013b7b3f7de10ff6ff17268ede7f957bd0;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/util/Comparison.java b/src/jalview/util/Comparison.java index 17d3a70..d4fc233 100644 --- a/src/jalview/util/Comparison.java +++ b/src/jalview/util/Comparison.java @@ -285,35 +285,10 @@ public class Comparison { return false; } - char[][] letters = new char[seqs.length][]; - for (int i = 0; i < seqs.length; i++) - { - if (seqs[i] != null) - { - char[] sequence = seqs[i].getSequence(); - if (sequence != null) - { - letters[i] = sequence; - } - } - } - - return areNucleotide(letters); - } - /** - * Answers true if more than 85% of the sequence residues (ignoring gaps) are - * A, G, C, T or U, else false. This is just a heuristic guess and may give a - * wrong answer (as AGCT are also amino acid codes). - * - * @param letters - * @return - */ - static final boolean areNucleotide(char[][] letters) - { int ntCount = 0; int aaCount = 0; - for (char[] seq : letters) + for (SequenceI seq : seqs) { if (seq == null) { @@ -321,8 +296,10 @@ public class Comparison } // TODO could possibly make an informed guess just from the first sequence // to save a lengthy calculation - for (char c : seq) + int len = seq.getLength(); + for (int i = 0; i < len; i++) { + char c = seq.getCharAt(i); if (isNucleotide(c)) { ntCount++;