[Biojava-l] odds ratio

wendy wong wendy.wong at gmail.com
Mon Mar 6 06:16:46 EST 2006


Hi, here is what I have done:

First, I set up the distribution for a state, then do
siteDistribution.setNullModel(nullDistribution);
to set up the null Distribution

then use this function to get the odds ratio of my C3 state (the one i
am interested in). Maybe I can try getting the odds ratio for the
background state and see what numers I got?

public static void getC3PosteriorOdds(MarkovModel model, SymbolList
obsSymList) throws IllegalArgumentException, BioException {
		DP dp = DPFactory.DEFAULT.createDP(model);
		SymbolList[] obs_array = {obsSymList};
		DPMatrix dpMatrix = dp.forwardsBackwards(obs_array, ScoreType.ODDS);
		State [] states = dp.getStates();
		
		//find the C3 site
		int c3Index = -1;
		for (int s = 0; s < dp.getDotStatesIndex(); s++) {
    	 		if (states[s].getName().equalsIgnoreCase("C.3")) {
    	 			c3Index = s;
    	 			break;
    	 		}
		}
		
		for (int i = 0; i < obsSymList.length(); i++) {
			int[] array = { c3Index, i };
			log.debug(i+1 + " " + dpMatrix.getCell(array));	
		}
		
	}


thanks,
wendy

On 3/6/06, mark.schreiber at novartis.com <mark.schreiber at novartis.com> wrote:
> >Hi,
> >
> >I am trying to set up an HMM wth a few states. I have a background
> >state with background distribution. For the rest of the states, I set
> >up the distribution and then use the setNullModel to set the  null
> >distribution to the background distribution. Am I doing the right
> >thing?
>
> Sounds correct.
>
> >The reason why I am asking is when I tried using the forward backward
> >algorithm, the scores of the state that I am interested in at each
> >site is greater than 2000. I would expect some sites to have a number
> >less than 1 to indicate that it is more likely to be in the null
> >distribution, or am I doing something totally wrong here?
>
> If you used an odds scoring function then you have done things correctly.
> Sounds wierd.
>
> - Mark
>
>



More information about the Biojava-l mailing list