public void full_agg()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            IEnumerable <NeuCodePair> neucodes         = TestExperimentalProteoform.generate_neucode_components(TestExperimentalProteoform.starter_mass).OfType <NeuCodePair>();
            List <Component>          components       = neucodes.Select(nc => nc.neuCodeLight).Concat(neucodes.Select(nc => nc.neuCodeHeavy)).ToList();
            List <Component>          quant_components = TestExperimentalProteoform.generate_neucode_quantitative_components();

            //Must use Sweet.lol.remaining_components because ThreadStart only uses void methods
            //Must use Sweet.lol.remaining_components because ThreadStart only uses void methods
            Sweet.lollipop.neucode_labeled = true;
            Sweet.lollipop.input_files     = new List <InputFile> {
                new InputFile("fake.txt", Purpose.Quantification)
            };
            List <ExperimentalProteoform> vetted_quant = Sweet.lollipop.aggregate_proteoforms(true, neucodes, components, quant_components, 0);

            Assert.AreEqual(1, vetted_quant.Count);
            Assert.AreEqual(2, vetted_quant[0].aggregated.Count);
            Assert.AreEqual(2, vetted_quant[0].lt_verification_components.Count);
            Assert.AreEqual(2, vetted_quant[0].hv_verification_components.Count);
            Assert.AreEqual(1, vetted_quant[0].lt_quant_components.Count);
            Assert.AreEqual(1, vetted_quant[0].hv_quant_components.Count);
            Assert.AreEqual(2, quant_components.Count);
            Assert.AreEqual(0, Sweet.lollipop.remaining_quantification_components.Count);
        }
        public void create_proteoforms_in_bounds_monoisotopic_tolerance()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            List <IAggregatable> components = TestExperimentalProteoform.generate_neucode_components(TestExperimentalProteoform.starter_mass);

            Sweet.lollipop.neucode_labeled = true;
            List <ExperimentalProteoform> pfs = Sweet.lollipop.createProteoforms(components.OfType <NeuCodePair>(), components.OfType <Component>(), 0);

            Assert.AreEqual(1, pfs.Count);
            Assert.AreEqual(2, pfs[0].aggregated.Count);
            Assert.AreEqual(2, components.Count);
            Assert.AreEqual(0, Sweet.lollipop.remaining_to_aggregate.Count);
        }
        public void assign_quant_components_in_bounds_monoisotopic_tolerance()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            IEnumerable <NeuCodePair> neucodes         = TestExperimentalProteoform.generate_neucode_components(TestExperimentalProteoform.starter_mass).OfType <NeuCodePair>();
            List <Component>          quant_components = TestExperimentalProteoform.generate_neucode_quantitative_components();

            // in bounds lowest monoisotopic error
            SaveState.lollipop.neucode_labeled = true;
            List <ExperimentalProteoform> pfs          = SaveState.lollipop.createProteoforms(neucodes, neucodes, 0);
            List <ExperimentalProteoform> vetted_quant = SaveState.lollipop.assignQuantificationComponents(pfs, quant_components);

            Assert.AreEqual(1, vetted_quant.Count);
            Assert.AreEqual(2, vetted_quant[0].aggregated_components.Count);
            Assert.AreEqual(1, vetted_quant[0].lt_quant_components.Count);
            Assert.AreEqual(1, vetted_quant[0].hv_quant_components.Count);
            Assert.AreEqual(2, quant_components.Count);
            Assert.AreEqual(0, SaveState.lollipop.remaining_quantification_components.Count);
        }
        public void vet_proteoforms_in_bounds_monoisotopic_tolerance()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            IEnumerable <NeuCodePair> neucodes = TestExperimentalProteoform.generate_neucode_components(TestExperimentalProteoform.starter_mass).OfType <NeuCodePair>();

            List <Component> components = neucodes.Select(nc => nc.neuCodeLight).Concat(neucodes.Select(nc => nc.neuCodeHeavy)).ToList();

            // in bounds lowest monoisotopic error
            Sweet.lollipop.neucode_labeled = true;
            List <ExperimentalProteoform> pfs    = Sweet.lollipop.createProteoforms(neucodes, components, 0);
            List <ExperimentalProteoform> vetted = Sweet.lollipop.vetExperimentalProteoforms(pfs, components, new List <ExperimentalProteoform>());

            Assert.AreEqual(1, vetted.Count);
            Assert.AreEqual(2, vetted[0].aggregated.Count);
            Assert.AreEqual(2, vetted[0].lt_verification_components.Count);
            Assert.AreEqual(2, vetted[0].hv_verification_components.Count);
            Assert.AreEqual(4, components.Count);
            Assert.AreEqual(0, Sweet.lollipop.remaining_verification_components.Count);
        }
        public void unlabeled_agg()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            List <IAggregatable> components = TestExperimentalProteoform.generate_unlabeled_components(TestExperimentalProteoform.starter_mass);

            Sweet.lollipop.neucode_labeled                   = false;
            Sweet.lollipop.remaining_to_aggregate            = new List <IAggregatable>(components);
            Sweet.lollipop.remaining_verification_components = new HashSet <Component>(components.OfType <Component>());
            Sweet.lollipop.missed_monoisotopics_range        = Enumerable.Range(-3, 3 * 2 + 1).ToList();
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("E");

            e.root = components[0];
            e.aggregate();
            e.verify();

            Assert.AreEqual(2, e.aggregated.Count);
            Assert.AreEqual(2, e.lt_verification_components.Count);
            Assert.AreEqual(0, e.hv_verification_components.Count); // everything goes into light with unlabeled
            Assert.AreEqual(0, e.lt_quant_components.Count);        // no quantitation for unlabeled, yet
            Assert.AreEqual(0, e.hv_quant_components.Count);
        }
        public void unlabeled_agg()
        {
            SaveState.lollipop.min_num_bioreps = 0;
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            List <Component> components = TestExperimentalProteoform.generate_unlabeled_components(TestExperimentalProteoform.starter_mass);

            SaveState.lollipop.neucode_labeled      = false;
            SaveState.lollipop.remaining_components = new List <Component>(components);
            SaveState.lollipop.remaining_verification_components = new List <Component>(components);
            ExperimentalProteoform e = ConstructorsForTesting.ExperimentalProteoform("E");

            e.root = components[0];
            e.aggregate();
            e.verify();

            Assert.AreEqual(2, e.aggregated_components.Count);
            Assert.AreEqual(2, e.lt_verification_components.Count);
            Assert.AreEqual(0, e.hv_verification_components.Count); // everything goes into light with unlabeled
            Assert.AreEqual(0, e.lt_quant_components.Count);        // no quantitation for unlabeled, yet
            Assert.AreEqual(0, e.hv_quant_components.Count);
        }
        public void full_agg_without_validation()
        {
            double max_monoisotopic_mass = TestExperimentalProteoform.starter_mass + TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;
            double min_monoisotopic_mass = TestExperimentalProteoform.starter_mass - TestExperimentalProteoform.missed_monoisotopics * Lollipop.MONOISOTOPIC_UNIT_MASS;

            IEnumerable <NeuCodePair> neucodes         = TestExperimentalProteoform.generate_neucode_components(TestExperimentalProteoform.starter_mass).OfType <NeuCodePair>();
            List <Component>          components       = neucodes.Select(nc => nc.neuCodeLight).Concat(neucodes.Select(nc => nc.neuCodeHeavy)).ToList();
            List <Component>          quant_components = TestExperimentalProteoform.generate_neucode_quantitative_components();

            //Must use Sweet.lol.remaining_components because ThreadStart only uses void methods
            Sweet.lollipop.neucode_labeled = true;
            Sweet.lollipop.decoy_proteoform_communities = new Dictionary <string, ProteoformCommunity> {
                { "1", new ProteoformCommunity() }
            };
            Sweet.lollipop.input_files = new List <InputFile> {
                new InputFile("fake.txt", Purpose.Quantification)
            };
            List <ExperimentalProteoform> vetted_quant = Sweet.lollipop.aggregate_proteoforms(false, neucodes, components, quant_components, 0);

            Assert.AreEqual(1, vetted_quant.Count);
            Assert.AreEqual(1, Sweet.lollipop.decoy_proteoform_communities.First().Value.experimental_proteoforms.Length);
            Assert.AreEqual(2, vetted_quant[0].aggregated.Count);
            Assert.AreEqual(0, vetted_quant[0].lt_verification_components.Count);
            Assert.AreEqual(0, vetted_quant[0].hv_verification_components.Count);
            Assert.AreEqual(1, vetted_quant[0].lt_quant_components.Count);
            Assert.AreEqual(1, vetted_quant[0].hv_quant_components.Count);
            Assert.AreEqual(2, quant_components.Count);
            Assert.AreEqual(0, Sweet.lollipop.remaining_quantification_components.Count);

            Sweet.lollipop.clear_aggregation();
            Assert.True(Sweet.lollipop.decoy_proteoform_communities.All(x => x.Value.experimental_proteoforms.Length == 0));
            Assert.IsEmpty(Sweet.lollipop.target_proteoform_community.experimental_proteoforms);
            Assert.IsEmpty(Sweet.lollipop.remaining_to_aggregate);
            Assert.IsEmpty(Sweet.lollipop.remaining_quantification_components);
            Assert.IsEmpty(Sweet.lollipop.remaining_verification_components);
        }
Пример #8
0
        public void shift_et_peak_unlabeled()
        {
            Sweet.lollipop = new Lollipop();
            ProteoformCommunity test_community = new ProteoformCommunity();

            Sweet.lollipop.target_proteoform_community = test_community;
            Sweet.lollipop.neucode_labeled             = false;

            //Make a few experimental proteoforms
            List <IAggregatable>   n1  = TestExperimentalProteoform.generate_neucode_components(100);
            List <IAggregatable>   n2  = TestExperimentalProteoform.generate_neucode_components(200);
            List <IAggregatable>   n3  = TestExperimentalProteoform.generate_neucode_components(200);
            List <IAggregatable>   n4  = TestExperimentalProteoform.generate_neucode_components(200);
            ExperimentalProteoform pf1 = ConstructorsForTesting.ExperimentalProteoform("E1");

            pf1.aggregated = n1.Select(n => (n as NeuCodePair).neuCodeLight).ToList <IAggregatable>();
            ExperimentalProteoform pf2 = ConstructorsForTesting.ExperimentalProteoform("E2");

            pf2.aggregated = n2.Select(n => (n as NeuCodePair).neuCodeLight).ToList <IAggregatable>();
            ExperimentalProteoform pf3 = ConstructorsForTesting.ExperimentalProteoform("E3");

            pf3.aggregated = n3.Select(n => (n as NeuCodePair).neuCodeLight).ToList <IAggregatable>();
            ExperimentalProteoform pf4 = ConstructorsForTesting.ExperimentalProteoform("E4");

            pf4.aggregated = n4.Select(n => (n as NeuCodePair).neuCodeLight).ToList <IAggregatable>();

            Sweet.lollipop.target_proteoform_community.experimental_proteoforms = new List <ExperimentalProteoform> {
                pf1, pf2, pf3, pf4
            }.ToArray();

            //Connect them to theoreticals to form two peaks
            ProteoformComparison      comparison14 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison25 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison36 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison47 = ProteoformComparison.ExperimentalTheoretical;
            TheoreticalProteoform     pf5          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf6          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf7          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf8          = ConstructorsForTesting.make_a_theoretical();
            ProteoformRelation        pr1          = new ProteoformRelation(pf1, pf5, comparison14, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr2          = new ProteoformRelation(pf2, pf6, comparison25, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr3          = new ProteoformRelation(pf3, pf7, comparison36, 1, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr4          = new ProteoformRelation(pf4, pf8, comparison47, 1, TestContext.CurrentContext.TestDirectory);
            List <ProteoformRelation> prs          = new List <ProteoformRelation> {
                pr1, pr2, pr3, pr4
            };

            foreach (ProteoformRelation pr in prs)
            {
                pr.set_nearby_group(prs, prs.Select(r => r.InstanceId).ToList());
            }
            test_community.accept_deltaMass_peaks(prs, new List <ProteoformRelation>());
            Assert.AreEqual(2, Sweet.lollipop.et_peaks.Count);

            //Shift the peaks, which shifts all of the proteoforms
            DeltaMassPeak d2 = Sweet.lollipop.et_peaks[1];

            d2.shift_experimental_masses(-1, false);

            foreach (Component c in pf3.aggregated.Concat(pf4.aggregated).OfType <Component>())
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }

            Sweet.lollipop.clear_et();
            Assert.AreEqual(0, Sweet.lollipop.et_peaks.Count);

            //don't double shift E if it's in two peaks...
            pr1 = new ProteoformRelation(pf1, pf5, comparison14, 1, TestContext.CurrentContext.TestDirectory);
            pr2 = new ProteoformRelation(pf1, pf6, comparison14, 1, TestContext.CurrentContext.TestDirectory);
            prs = new List <ProteoformRelation> {
                pr1, pr2
            };
            foreach (ProteoformRelation pr in prs)
            {
                pr.set_nearby_group(prs, prs.Select(r => r.InstanceId).ToList());
            }
            test_community.accept_deltaMass_peaks(prs, new List <ProteoformRelation>());
            Assert.AreEqual(1, Sweet.lollipop.et_peaks.Count);

            //Shift the peaks, which shifts all of the proteoforms
            d2 = Sweet.lollipop.et_peaks[0];
            d2.shift_experimental_masses(-1, false);

            foreach (Component c in pf3.aggregated.Concat(pf4.aggregated).OfType <Component>())
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }
        }
Пример #9
0
        public void shift_et_peak_neucode_from_actions()
        {
            Sweet.lollipop = new Lollipop();
            ProteoformCommunity test_community = new ProteoformCommunity();

            Sweet.lollipop.target_proteoform_community = test_community;

            //Make a few experimental proteoforms
            List <IAggregatable>   n1  = TestExperimentalProteoform.generate_neucode_components(100);
            List <IAggregatable>   n2  = TestExperimentalProteoform.generate_neucode_components(100);
            List <IAggregatable>   n3  = TestExperimentalProteoform.generate_neucode_components(200);
            List <IAggregatable>   n4  = TestExperimentalProteoform.generate_neucode_components(200);
            ExperimentalProteoform pf1 = ConstructorsForTesting.ExperimentalProteoform("E1");

            pf1.aggregated = n1;
            ExperimentalProteoform pf2 = ConstructorsForTesting.ExperimentalProteoform("E2");

            pf2.aggregated = n2;
            ExperimentalProteoform pf3 = ConstructorsForTesting.ExperimentalProteoform("E3");

            pf3.aggregated = n3;
            ExperimentalProteoform pf4 = ConstructorsForTesting.ExperimentalProteoform("E4");

            pf4.aggregated = n4;

            Sweet.lollipop.target_proteoform_community.experimental_proteoforms = new List <ExperimentalProteoform> {
                pf1, pf2, pf3, pf4
            }.ToArray();

            //Connect them to theoreticals to form two peaks
            ProteoformComparison      comparison14 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison25 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison36 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison47 = ProteoformComparison.ExperimentalTheoretical;
            TheoreticalProteoform     pf5          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf6          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf7          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf8          = ConstructorsForTesting.make_a_theoretical();
            ProteoformRelation        pr1          = new ProteoformRelation(pf1, pf5, comparison14, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr2          = new ProteoformRelation(pf2, pf6, comparison25, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr3          = new ProteoformRelation(pf3, pf7, comparison36, 1, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr4          = new ProteoformRelation(pf4, pf8, comparison47, 1, TestContext.CurrentContext.TestDirectory);
            List <ProteoformRelation> prs          = new List <ProteoformRelation> {
                pr1, pr2, pr3, pr4
            };

            foreach (ProteoformRelation pr in prs)
            {
                pr.set_nearby_group(prs, prs.Select(r => r.InstanceId).ToList());
            }
            test_community.accept_deltaMass_peaks(prs, new List <ProteoformRelation>());
            Assert.AreEqual(2, Sweet.lollipop.et_peaks.Count);

            //Shift the peaks, which shifts all of the proteoforms
            DeltaMassPeak d2 = Sweet.lollipop.et_peaks[1];

            d2.mass_shifter = "-1";
            Sweet.shift_peak_action(d2);
            d2.mass_shifter = null;
            using (StreamWriter file = new StreamWriter(Path.Combine(TestContext.CurrentContext.TestDirectory, "method.xml")))
                file.WriteLine(Sweet.save_method());
            Sweet.open_method(Path.Combine(TestContext.CurrentContext.TestDirectory, "method.xml"), string.Join(Environment.NewLine, File.ReadAllLines(Path.Combine(TestContext.CurrentContext.TestDirectory, "method.xml"))), true, out string warning);
            Sweet.mass_shifts_from_presets();
            d2.shift_experimental_masses(Convert.ToInt32(d2.mass_shifter), true);

            foreach (Component c in
                     n3.OfType <NeuCodePair>().Select(n => n.neuCodeLight).
                     Concat(n4.OfType <NeuCodePair>().Select(n => n.neuCodeLight)))
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }

            foreach (Component c in
                     n3.OfType <NeuCodePair>().Select(n => n.neuCodeHeavy).
                     Concat(n4.OfType <NeuCodePair>().Select(n => n.neuCodeHeavy)))
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 + TestExperimentalProteoform.starter_lysine_count * Lollipop.NEUCODE_LYSINE_MASS_SHIFT - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }
        }
Пример #10
0
        public void shift_et_peak_neucode()
        {
            SaveState.lollipop = new Lollipop();
            ProteoformCommunity test_community = new ProteoformCommunity();

            SaveState.lollipop.target_proteoform_community = test_community;

            //Make a few experimental proteoforms
            List <Component>       n1  = TestExperimentalProteoform.generate_neucode_components(100);
            List <Component>       n2  = TestExperimentalProteoform.generate_neucode_components(100);
            List <Component>       n3  = TestExperimentalProteoform.generate_neucode_components(200);
            List <Component>       n4  = TestExperimentalProteoform.generate_neucode_components(200);
            ExperimentalProteoform pf1 = ConstructorsForTesting.ExperimentalProteoform("E1");

            pf1.aggregated_components = n1;
            ExperimentalProteoform pf2 = ConstructorsForTesting.ExperimentalProteoform("E2");

            pf2.aggregated_components = n2;
            ExperimentalProteoform pf3 = ConstructorsForTesting.ExperimentalProteoform("E3");

            pf3.aggregated_components = n3;
            ExperimentalProteoform pf4 = ConstructorsForTesting.ExperimentalProteoform("E4");

            pf4.aggregated_components = n4;

            SaveState.lollipop.target_proteoform_community.experimental_proteoforms = new List <ExperimentalProteoform> {
                pf1, pf2, pf3, pf4
            }.ToArray();

            //Connect them to theoreticals to form two peaks
            ProteoformComparison      comparison14 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison25 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison36 = ProteoformComparison.ExperimentalTheoretical;
            ProteoformComparison      comparison47 = ProteoformComparison.ExperimentalTheoretical;
            TheoreticalProteoform     pf5          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf6          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf7          = ConstructorsForTesting.make_a_theoretical();
            TheoreticalProteoform     pf8          = ConstructorsForTesting.make_a_theoretical();
            ProteoformRelation        pr1          = new ProteoformRelation(pf1, pf5, comparison14, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr2          = new ProteoformRelation(pf2, pf6, comparison25, 0, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr3          = new ProteoformRelation(pf3, pf7, comparison36, 1, TestContext.CurrentContext.TestDirectory);
            ProteoformRelation        pr4          = new ProteoformRelation(pf4, pf8, comparison47, 1, TestContext.CurrentContext.TestDirectory);
            List <ProteoformRelation> prs          = new List <ProteoformRelation> {
                pr1, pr2, pr3, pr4
            };

            foreach (ProteoformRelation pr in prs)
            {
                pr.set_nearby_group(prs, prs.Select(r => r.InstanceId).ToList());
            }
            test_community.accept_deltaMass_peaks(prs, new List <ProteoformRelation>());
            Assert.AreEqual(2, SaveState.lollipop.et_peaks.Count);

            //Shift the peaks, which shifts all of the proteoforms
            DeltaMassPeak d2 = SaveState.lollipop.et_peaks[1];

            d2.shift_experimental_masses(-1, true);

            Assert.IsTrue(pf3.mass_shifted);
            Assert.IsTrue(pf4.mass_shifted);
            foreach (Component c in
                     n3.
                     Concat(n4).
                     Concat(n3.Select(n => ((NeuCodePair)n).neuCodeLight)).
                     Concat(n4.Select(n => ((NeuCodePair)n).neuCodeLight)))
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }

            foreach (Component c in
                     n3.Select(n => ((NeuCodePair)n).neuCodeHeavy).
                     Concat(n4.Select(n => ((NeuCodePair)n).neuCodeHeavy)))
            {
                Assert.AreEqual(-1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.manual_mass_shift);
                Assert.AreEqual(200 + TestExperimentalProteoform.starter_lysine_count * Lollipop.NEUCODE_LYSINE_MASS_SHIFT - 1.0 * Lollipop.MONOISOTOPIC_UNIT_MASS, c.weighted_monoisotopic_mass);
            }
        }