Exemplo n.º 1
0
        public void testBinomialCoefficient()
        {
            int n = 10;
            int k = 2;

            Assert.AreEqual(45, (int)GoTermNumber.binomialCoefficient(n, k));
        }
Exemplo n.º 2
0
        public void testGoTerm_pValue()
        {
            int q = 2;  //count of proteins in selected subset with the particular Go term
            int k = 4;  //count of proteins in selected subset
            int m = 4;  //count of proteins in background with the particular Go term
            int t = 10; //count of proteins in background

            Assert.AreEqual(0.54762, Math.Round((double)GoTermNumber.GoTerm_pValue(q, k, m, t), 5));
        }
Exemplo n.º 3
0
        public void saveall()
        {
            SaveState.lollipop = new Lollipop();
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("asdf");

            SaveState.lollipop.qVals.Add(e.quant);
            GoTermNumber g = new GoTermNumber(new GoTerm("id", "desc", Aspect.BiologicalProcess), 0, 0, 0, 0);

            g.by = -1;
            SaveState.lollipop.goTermNumbers.Add(g);
            ResultsSummaryGenerator.save_all(TestContext.CurrentContext.TestDirectory, SaveState.time_stamp());
        }
Exemplo n.º 4
0
        public void saveall()
        {
            Sweet.lollipop = new Lollipop();
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("asdf");

            Sweet.lollipop.qVals.Add(e.quant);
            GoTermNumber g = new GoTermNumber(new GoTerm("id", "desc", Aspect.BiologicalProcess), 0, 0, 0, 0);

            g.by = -1;
            Sweet.lollipop.TusherAnalysis1.GoAnalysis.goTermNumbers.Add(g);
            Sweet.lollipop.topdown_proteoforms = new List <TopDownProteoform>()
            {
                ConstructorsForTesting.TopDownProteoform("td1", 1000, 10)
            };
            ResultsSummaryGenerator.save_all(TestContext.CurrentContext.TestDirectory, Sweet.time_stamp(), Sweet.lollipop.TusherAnalysis1 as IGoAnalysis, Sweet.lollipop.TusherAnalysis1 as TusherAnalysis);
        }
Exemplo n.º 5
0
        public void testLogOddsRatio()
        {
            int q = 1; // number of enriched proteins with the term
            int k = 2; // number of enriched proteins
            int m = 2; // number of proteins in the background with the term
            int t = 4; // number of proteins in the background

            DatabaseReference d = new DatabaseReference("GO", ":1", new List <Tuple <string, string> > {
                new Tuple <string, string>("term", "P:one")
            });
            GoTerm       g   = new GoTerm(d);
            GoTermNumber gtn = new GoTermNumber(g, q, k, m, t);

            Assert.AreEqual(0, gtn.log_odds_ratio);
            //Assert.AreEqual(0.833333m, Math.Round((decimal)gtn.p_value.Truncate(7), 6));
            Assert.AreEqual(0.833333m, Math.Round(gtn.p_value, 6));

            q = 1; // number of enriched proteins with the term
            k = 2; // number of enriched proteins
            m = 4; // number of proteins in the background with the term
            t = 4; // number of proteins in the background

            gtn = new GoTermNumber(g, q, k, m, t);
            Assert.AreEqual(-1, gtn.log_odds_ratio);
            //Assert.AreEqual(1m, Math.Round((decimal)gtn.p_value.Truncate(7), 6));
            Assert.AreEqual(1m, Math.Round(gtn.p_value, 6));

            q = 2; // number of enriched proteins with the term
            k = 2; // number of enriched proteins
            m = 2; // number of proteins in the background with the term
            t = 4; // number of proteins in the background

            gtn = new GoTermNumber(g, q, k, m, t);
            Assert.AreEqual(1, gtn.log_odds_ratio);
            //Assert.AreEqual(0.166667m, Math.Round((decimal)gtn.p_value.Truncate(7), 6));
            Assert.AreEqual(0.166667m, Math.Round(gtn.p_value, 6));
        }
Exemplo n.º 6
0
 public DisplayGoTermNumber(GoTermNumber g)
     : base(g)
 {
     gtn = g;
 }