001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021 022 023package org.biojava.bio.dp; 024 025import org.biojava.bio.dist.Distribution; 026import org.biojava.bio.symbol.Alphabet; 027 028/** 029 * A log odds weight matrix. 030 * <p> 031 * The weight matrix uses computer-coordinates. Thus, a 10 column weight matrix 032 * has columns (0 - 9). I guess that if you try to access columns outside the 033 * logical range, the implementation may throw an IndexOutOfBoundsException. 034 * 035 * @author Matthew Pocock 036 */ 037public interface WeightMatrix { 038 /** 039 * The alphabet for the sequences that this weight matrix models. 040 * 041 * @return the Alphabet 042 */ 043 Alphabet getAlphabet(); 044 045 /** 046 * The number of columns modeled by the weight matrix. 047 * 048 * @return the number of columns 049 */ 050 int columns(); 051 052 /** 053 * Retrieve a column as an EmissionState. 054 * <p> 055 * To find the emission probability for Symbol sym at column col use: 056 * <code>wm.getColumn(col).getWeight(sym)</code>. 057 * 058 * @param column the weight matrix column to retrieve 059 * @throws IndexOutOfBoundsException if column is not between 0 and 060 * columns()-1 061 * @return the EmissionState that represents the individual column 062 */ 063 Distribution getColumn(int column) throws IndexOutOfBoundsException; 064}