X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignSeq.java;h=0af85f145b8236d4c2a8d2d5590721d277ed6f8c;hb=ae83cc59079dc5374a41402889b6f4192f66e9e2;hp=464abb025e826fcf08669e0128e9c6e20cb9994a;hpb=88eaada36951276cf8b2863bb95aa37148166ea2;p=jalview.git diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 464abb0..0af85f1 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 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 @@ -63,14 +63,14 @@ public class AlignSeq int[] seq2; SequenceI s1; SequenceI s2; - String s1str; - String s2str; + public String s1str; + public String s2str; int maxi; int maxj; int[] aseq1; int[] aseq2; - public String astr1 = ""; - public String astr2 = ""; + public String astr1=""; + public String astr2=""; /** DOCUMENT ME!! */ public int seq1start; @@ -96,7 +96,6 @@ public class AlignSeq int defInt = 23; StringBuffer output = new StringBuffer(); String type; - Runtime rt; /** * Creates a new AlignSeq object. @@ -107,7 +106,6 @@ public class AlignSeq */ public AlignSeq(SequenceI s1, SequenceI s2, String type) { - rt = Runtime.getRuntime(); SeqInit(s1, s1.getSequence(), s2, s2.getSequence(), type); } @@ -124,7 +122,6 @@ public class AlignSeq String string2, String type) { - rt = Runtime.getRuntime(); SeqInit(s1, string1, s2, string2, type); } @@ -261,9 +258,18 @@ public class AlignSeq String string2, String type) { + s1str = extractGaps(jalview.util.Comparison.GapChars, string1); s2str = extractGaps(jalview.util.Comparison.GapChars, string2); + if(s1str.length()==0 || s2str.length()==0) + { + System.out.println("ALL GAPS: " + + (s1str.length()==0?s1.getName():" ") + +(s2str.length()==0?s2.getName():"")); + return; + } + this.s1 = s1; this.s2 = s2; @@ -745,17 +751,24 @@ public class AlignSeq for (int i = 0; i < s.length(); i++) { - String ss = s.substring(i, i + 1).toUpperCase(); + // String ss = s.substring(i, i + 1).toUpperCase(); + char c = s.charAt(i); + if ('a' <= c && c <= 'z') + { + // TO UPPERCASE !!! + c -= ('a' - 'A'); + } + try { if (type.equals("pep")) { - seq1[i] = ((Integer) ResidueProperties.aaHash.get(ss)).intValue(); + seq1[i] = ResidueProperties.aaIndex[c]; } else if (type.equals("dna")) { - seq1[i] = ((Integer) dnaHash.get(ss)).intValue(); + seq1[i] = ResidueProperties.nucleotideIndex[c]; } if (seq1[i] > 23)