当前位置: 首页>>代码示例>>C#>>正文


C# SrmDocument.ImportMassList方法代码示例

本文整理汇总了C#中SrmDocument.ImportMassList方法的典型用法代码示例。如果您正苦于以下问题:C# SrmDocument.ImportMassList方法的具体用法?C# SrmDocument.ImportMassList怎么用?C# SrmDocument.ImportMassList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SrmDocument的用法示例。


在下文中一共展示了SrmDocument.ImportMassList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VariableModImportListTest

        public void VariableModImportListTest()
        {
            // TODO: Deal with multiple variable modifications that produce the same
            //       precursor mass but different product ion masses
            SrmDocument document = new SrmDocument(SrmSettingsList.GetDefault());
            var staticMods = new List<StaticMod>(document.Settings.PeptideSettings.Modifications.StaticModifications);
            staticMods.AddRange(new[]
                                    {
                                        new StaticMod("Met Sulfoxide", "M", null, true, "O", LabelAtoms.None,
                                            RelativeRT.Matching, null, null, new[] { new FragmentLoss("SOCH4") }),
                                        new StaticMod("Met Sulfone", "M", null, true, "O2", LabelAtoms.None,
                                            RelativeRT.Matching, null, null, null),
                                        new StaticMod("Phospho", "S,T,Y", null, true, "PO3H", LabelAtoms.None,
                                            RelativeRT.Matching, null, null, new[] {new FragmentLoss("PO4H3")}),
                                        new StaticMod("K(GlyGly)", "K", null, true, "N2H6C4O2", LabelAtoms.None,
                                            RelativeRT.Matching, null, null, null),
                                    });
            document = document.ChangeSettings(document.Settings.ChangePeptideModifications(mods =>
                mods.ChangeStaticModifications(staticMods)));
            IdentityPath pathTo;
            List<MeasuredRetentionTime> irtPeptides;
            List<SpectrumMzInfo> librarySpectra;
            List<TransitionImportErrorInfo> errorList;
            var inputsPhospho = new MassListInputs(TEXT_PHOSPHO_TRANSITION_LIST, CultureInfo.InvariantCulture, TextUtil.SEPARATOR_CSV);
            document.ImportMassList(inputsPhospho, null, out pathTo, out irtPeptides, out librarySpectra, out errorList);
            Assert.AreEqual(27, errorList.Count);
            AssertEx.AreComparableStrings(TextUtil.SpaceSeparate(Resources.MassListRowReader_CalcTransitionExplanations_The_product_m_z__0__is_out_of_range_for_the_instrument_settings__in_the_peptide_sequence__1_,
                                                Resources.MassListRowReader_CalcPrecursorExplanations_Check_the_Instrument_tab_in_the_Transition_Settings),
                                         errorList[0].ErrorMessage,
                                         2);
            Assert.AreEqual(1, errorList[0].Column);
            Assert.AreEqual(40, errorList[0].Row);

            var docHighMax = document.ChangeSettings(document.Settings.ChangeTransitionInstrument(inst => inst.ChangeMaxMz(1800)));
            var docList = docHighMax.ImportMassList(inputsPhospho, null, out pathTo);

            AssertEx.Serializable(docList);
            AssertEx.IsDocumentState(docList, 3, 68, 134, 157, 481);
            foreach (var nodeTran in docList.PeptideTransitions)
            {
                var it = nodeTran.Transition.IonType;
                Assert.IsTrue(it == IonType.y || it == IonType.b || it == IonType.precursor, "Found unexpected non b, y or precursor ion type.");
            }

            var inputsMultiLoss = new MassListInputs(TEXT_PHOSPHO_MULTI_LOSS, CultureInfo.InvariantCulture, TextUtil.SEPARATOR_CSV);
            docHighMax.ImportMassList(inputsMultiLoss, null, out pathTo, out irtPeptides, out librarySpectra, out errorList);
            Assert.AreEqual(5, errorList.Count);
            AssertEx.AreComparableStrings(Resources.MassListRowReader_CalcTransitionExplanations_Product_m_z_value__0__in_peptide__1__has_no_matching_product_ion,
                                         errorList[0].ErrorMessage,
                                         2);
            Assert.AreEqual(1, errorList[0].Column);
            Assert.AreEqual(2, errorList[0].Row);

            var docMultiLos = docHighMax.ChangeSettings(docHighMax.Settings.ChangePeptideModifications(mods =>
                mods.ChangeMaxNeutralLosses(2)));
            docList = docMultiLos.ImportMassList(inputsMultiLoss, null, out pathTo);

            AssertEx.IsDocumentState(docList, 4, 4, 4, 12);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:59,代码来源:VariableModTest.cs

示例2: InitWiffDocument

        private static SrmDocument InitWiffDocument(TestFilesDir testFilesDir)
        {
            const LabelAtoms labelAtoms = LabelAtoms.C13 | LabelAtoms.N15;
            List<StaticMod> heavyMods = new List<StaticMod>
                {
                    new StaticMod("Heavy K", "K", ModTerminus.C, null, labelAtoms, null, null),
                    new StaticMod("Heavy R", "R", ModTerminus.C, null, labelAtoms, null, null),
                };
            SrmSettings settings = SrmSettingsList.GetDefault();
            settings = settings.ChangePeptideModifications(mods => mods.ChangeHeavyModifications(heavyMods));
            SrmDocument doc = new SrmDocument(settings);

            IdentityPath selectPath;
            string path = testFilesDir.GetTestPath("051309_transition list.csv");
            // Product m/z out of range
            var docError = doc;
            List<MeasuredRetentionTime> irtPeptides;
            List<SpectrumMzInfo> librarySpectra;
            List<TransitionImportErrorInfo> errorList;
            var inputs = new MassListInputs(path)
            {
                FormatProvider = CultureInfo.InvariantCulture,
                Separator = TextUtil.SEPARATOR_CSV
            };
            docError.ImportMassList(inputs, null, out selectPath, out irtPeptides, out librarySpectra, out errorList);
            Assert.AreEqual(errorList.Count, 1);
            AssertEx.AreComparableStrings(TextUtil.SpaceSeparate(Resources.MassListRowReader_CalcTransitionExplanations_The_product_m_z__0__is_out_of_range_for_the_instrument_settings__in_the_peptide_sequence__1_,
                                                Resources.MassListRowReader_CalcPrecursorExplanations_Check_the_Instrument_tab_in_the_Transition_Settings),
                                            errorList[0].ErrorMessage,
                                            2);
            Assert.AreEqual(errorList[0].Column, 1);
            Assert.AreEqual(errorList[0].Row, 19);

            doc = doc.ChangeSettings(settings.ChangeTransitionInstrument(inst => inst.ChangeMaxMz(1800)));
            inputs = new MassListInputs(path)
            {
                FormatProvider = CultureInfo.InvariantCulture,
                Separator = TextUtil.SEPARATOR_CSV
            };
            doc = doc.ImportMassList(inputs, null, out selectPath);

            AssertEx.IsDocumentState(doc, 2, 9, 9, 18, 54);
            return doc;
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:44,代码来源:SmallWiffTest.cs


注:本文中的SrmDocument.ImportMassList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。