/**
* A class that can parse a file containing a substitution matrix and register
* it for use in Jalview
+ * <p>
+ * Accepts 'NCBI' format (e.g.
+ * https://www.ncbi.nlm.nih.gov/Class/FieldGuide/BLOSUM62.txt), with the
+ * addition of a header line to provide a matrix name, e.g.
*
- * @author gmcarstairs
- *
+ * <pre>
+ * ScoreMatrix BLOSUM62
+ * </pre>
+ *
+ * Also accepts 'aaindex' format (as described at
+ * http://www.genome.jp/aaindex/aaindex_help.html) with the minimum data
+ * required being
+ *
+ * <pre>
+ * H accession number (used as score matrix identifier in Jalview)
+ * D description (used for tooltip in Jalview)
+ * M rows = symbolList
+ * and the substitution scores
+ * </pre>
*/
-// TODO modify the AlignFile / IdentifyFile pattern so that non-alignment files
-// like this are handled more naturally
public class ScoreMatrixFile extends AlignFile implements
AlignmentFileReaderI
{
* optionally with the symbol as the first column for readability
*/
StringTokenizer scoreLine = new StringTokenizer(data, DELIMITERS);
- if (scoreLine.countTokens() == size + 1)
+ int tokenCount = scoreLine.countTokens();
+ if (tokenCount == size + 1)
{
/*
* check 'guide' symbol is the row'th letter of the alphabet