[Biojava-l] SubstitutionMatrix

Stefan Bleckmann Stefan.Bleckmann at uni-duesseldorf.de
Wed Apr 7 12:08:45 UTC 2010


Hi all!

I have a problems reading the NUC4.2 and 4.4 matrix files with the SubstitutionMatrix class included in BioJava 1.7.1. 
A small example:


		File d = new File("/Users/-----/Desktop/NUC");
		FiniteAlphabet alphabet = (FiniteAlphabet) AlphabetManager.alphabetForName("DNA");
		try {
			@SuppressWarnings("unused")
			final SubstitutionMatrix matrix = new SubstitutionMatrix(alphabet,d);
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (NoSuchElementException e) {
			e.printStackTrace();
		} catch (BioException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}


Thrown exception:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:686)
	at org.biojava.bio.alignment.SubstitutionMatrix.parseMatrix(SubstitutionMatrix.java:304)
	at org.biojava.bio.alignment.SubstitutionMatrix.<init>(SubstitutionMatrix.java:100)
	at MatrixTest.main(MatrixTest.java:30)


All BLOSUM matrix files I have downloaded work, so I don't think there is a problem like wrong encoding or something similar.
Anybody an idea?

Cheers Stefan






More information about the Biojava-l mailing list