Ejemplo n.º 1
0
        private Pattern DoGetProfile(AtomComposition ac, int charge)
        {
            AtomComposition ac2;

            if (charge == 0)
            {
                ac2 = ac;
            }
            else
            {
                ac2         = new AtomComposition(ac.GetFormula());
                ac2[Atom.H] = ac2[Atom.H] + charge;
            }

            var result = calculator.Calculate(ac2, 0, charge);

            return(result);
        }
Ejemplo n.º 2
0
    public void TestInitializeData()
    {
      var calc = new EmassCalculator(@"../../../data/ISOTOPE.DAT");

      var fm = "C6H10";

      var result = calc.Calculate(fm, 0, 0);

      //result.ForEach(m => Console.WriteLine("{0:0.000000}\t{1:0.000000}", m.Mz, m.Intensity));

      Assert.AreEqual(82.078250, result[0].Mz, 0.00001);
      Assert.AreEqual(0.93641, result[0].Intensity, 0.00001);

      Assert.AreEqual(83.08166, result[1].Mz, 0.00001);
      Assert.AreEqual(0.06185, result[1].Intensity, 0.00001);

      Assert.AreEqual(84.08508, result[2].Mz, 0.00001);
      Assert.AreEqual(0.00171, result[2].Intensity, 0.00001);

      Assert.AreEqual(85.08854, result[3].Mz, 0.00001);
      Assert.AreEqual(0.00003, result[3].Intensity, 0.00001);
    }
Ejemplo n.º 3
0
        public void TestInitializeData()
        {
            var calc = new EmassCalculator(@TestContext.CurrentContext.TestDirectory + "/../../../data//ISOTOPE.DAT");

            var fm = "C6H10";

            var result = calc.Calculate(fm, 0, 0);

            //result.ForEach(m => Console.WriteLine("{0:0.000000}\t{1:0.000000}", m.Mz, m.Intensity));

            Assert.AreEqual(82.078250, result[0].Mz, 0.00001);
            Assert.AreEqual(0.93641, result[0].Intensity, 0.00001);

            Assert.AreEqual(83.08166, result[1].Mz, 0.00001);
            Assert.AreEqual(0.06185, result[1].Intensity, 0.00001);

            Assert.AreEqual(84.08508, result[2].Mz, 0.00001);
            Assert.AreEqual(0.00171, result[2].Intensity, 0.00001);

            Assert.AreEqual(85.08854, result[3].Mz, 0.00001);
            Assert.AreEqual(0.00003, result[3].Intensity, 0.00001);
        }