X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FBinarySequence.java;h=49e35431f060805faf6fc6dc0a056b30ce3da8e3;hb=c766c1829042b039ea2ff56fc05f4a0100c2a73d;hp=7d034041258e80654a0721825f290d1ac572946a;hpb=b8b5c2410e8814caf24d216545f2266c8854f963;p=jalview.git diff --git a/src/jalview/datamodel/BinarySequence.java b/src/jalview/datamodel/BinarySequence.java index 7d03404..49e3543 100755 --- a/src/jalview/datamodel/BinarySequence.java +++ b/src/jalview/datamodel/BinarySequence.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 @@ -49,7 +49,7 @@ public class BinarySequence extends Sequence public void encode() { // Set all matrix to 0 - dbinary = new double[getSequence().length() * 21]; + dbinary = new double[getSequence().length * 21]; int nores = 21; @@ -58,15 +58,13 @@ public class BinarySequence extends Sequence dbinary[i] = 0.0; } - for (int i = 0; i < getSequence().length(); i++) + for (int i = 0; i < getSequence().length; i++) { int aanum = 20; try { - aanum = ((Integer) ResidueProperties.getAAHash().get(getSequence() - .substring(i, - i + 1))).intValue(); + aanum = ResidueProperties.aaIndex[getCharAt(i)]; } catch (NullPointerException e) { @@ -88,22 +86,20 @@ public class BinarySequence extends Sequence public void blosumEncode() { // Set all matrix to 0 - dbinary = new double[getSequence().length() * 21]; + dbinary = new double[getSequence().length * 21]; int nores = 21; //for (int i = 0; i < dbinary.length; i++) { // dbinary[i] = 0.0; //} - for (int i = 0; i < getSequence().length(); i++) + for (int i = 0; i < getSequence().length; i++) { int aanum = 20; try { - aanum = ((Integer) ResidueProperties.getAAHash().get(getSequence() - .substring(i, - i + 1))).intValue(); + aanum = ResidueProperties.aaIndex[getCharAt(i)]; } catch (NullPointerException e) {