Esempio n. 1
0
        public void EstimateParameters(string outcome, string path)
        {
            _transition = new Transition(_states);
            _transition.Estimate(path);

            _emission = new Emission(_states, _alphabet);
            _emission.Estimate(outcome, path);
        }
Esempio n. 2
0
        public void BuildProfile(List <string> alignment, double theta)
        {
            //  build profile matrix
            List <ProfileState> profile = new List <ProfileState>();

            for (int i = 0; i < alignment[0].Length; ++i)
            {
                ProfileState ps = new ProfileState();
                for (int j = 0; j < alignment.Count; ++j)
                {
                    ps.Add(alignment[j][i]);
                }
                ps.gray = ps.Pr('-') > theta;
                profile.Add(ps);
            }

            //  build states
            _states.Add("S");
            _states.Add("I0");
            int m = 1;

            for (int i = 0; i < profile.Count; ++i)
            {
                if (!profile[i].gray)
                {
                    _states.Add("M" + m.ToString());
                    _states.Add("D" + m.ToString());
                    _states.Add("I" + m.ToString());

                    ++m;
                }
            }
            _states.Add("E");

            //  build transition matrix
            _transition = new Transition(_states);

            //  build emission matrix
            _emission = new Emission(_states, _alphabet);
        }
Esempio n. 3
0
 public void ParseEmission(List <string> matrix)
 {
     _emission = new Emission(_states, _alphabet);
     _emission.Parse(matrix);
 }