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


C# DataReader.AccumulateFrameData方法代码示例

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


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

示例1: WriteRun

        private void WriteRun(XmlWriter writer, string outputPath, DataReader reader, VoltageGroup voltageGroup)
        {
            writer.WriteStartElement("run");
            string dataset = Path.GetFileNameWithoutExtension(outputPath);
            writer.WriteAttributeString("id", dataset);
            writer.WriteAttributeString("defaultInstrumentConfigurationRef", "IC");
            writer.WriteAttributeString("startTimeStamp", this.dateTime);

            writer.WriteStartElement("spectrumList");
            writer.WriteAttributeString("count", this.scans.ToString(CultureInfo.InvariantCulture));

            int startingFrame = voltageGroup.FirstFrameNumber;
            int endingFrame = voltageGroup.LastFrameNumber;
            Console.Write("Summing frame[{0} - {1}]...    ", startingFrame, endingFrame);

            double[,] summedIntensities = reader.AccumulateFrameData(startingFrame, endingFrame, false, 1, this.scans, 1, this.bins, -1, -1);

            // Use dirft time scan as LC scan to massage skyline
            for (int lcScan = 1; lcScan <= this.scans; lcScan++)
            {
                float[] mzArray;
                float[] intensityArray;

                this.GetMzIntensityArrayAtScan(summedIntensities, lcScan, out mzArray, out intensityArray);

                double mzLow = mzArray[0];
                double mzHigh = mzArray[mzArray.Count()-1];

                // Write the bins as mass spectrum
                writer.WriteStartElement("spectrum");
                writer.WriteAttributeString("index", String.Format("{0}", lcScan - 1));
                writer.WriteAttributeString("id", String.Format("frame={0} scan={1} frameType={2}", 1, lcScan, 1));
                writer.WriteAttributeString("defaultArrayLength", mzArray.Count().ToString(CultureInfo.InvariantCulture));

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000511");
                writer.WriteAttributeString("name", "ms level");
                writer.WriteAttributeString("value", "1");
                writer.WriteEndElement();

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000579");
                writer.WriteAttributeString("name", "MS1 spectrum");
                writer.WriteAttributeString("value", "");
                writer.WriteEndElement();

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000128");
                writer.WriteAttributeString("name", "profile spectrum");
                writer.WriteAttributeString("value", "");
                writer.WriteEndElement();

                writer.WriteStartElement("scanList");
                writer.WriteAttributeString("count", "1");

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000795");
                writer.WriteAttributeString("name", "no combination");
                writer.WriteAttributeString("value", "");
                writer.WriteEndElement();

                writer.WriteStartElement("scan");

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000016");
                writer.WriteAttributeString("name", "scan start time");
                writer.WriteAttributeString("value", reader.GetDriftTime(voltageGroup.FirstFrameNumber, lcScan, true).ToString(CultureInfo.InvariantCulture));
                writer.WriteAttributeString("unitCvRef", "UO");
                writer.WriteAttributeString("unitAccession", "UO:0000031");
                writer.WriteAttributeString("unitName", "minute");

                writer.WriteEndElement();

                writer.WriteStartElement("scanWindowList");
                writer.WriteAttributeString("count", "1");

                writer.WriteStartElement("scanWindow");

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000501");
                writer.WriteAttributeString("name", "scan window lower limit");
                writer.WriteAttributeString("value", mzLow.ToString(CultureInfo.InvariantCulture));
                writer.WriteAttributeString("unitCvRef", "MS");
                writer.WriteAttributeString("unitAccession", "MS:1000040");
                writer.WriteAttributeString("unitName", "m/z");
                writer.WriteEndElement();

                writer.WriteStartElement("cvParam");
                writer.WriteAttributeString("cvRef", "MS");
                writer.WriteAttributeString("accession", "MS:1000500");
                writer.WriteAttributeString("name", "scan window upper limit");
                writer.WriteAttributeString("value", mzHigh.ToString(CultureInfo.InvariantCulture));
                writer.WriteAttributeString("unitCvRef", "MS");
                writer.WriteAttributeString("unitAccession", "MS:1000040");
//.........这里部分代码省略.........
开发者ID:PNNL-Comp-Mass-Spec,项目名称:IMS-Informed-Library,代码行数:101,代码来源:RetentionMobilitySwappedMzMLExporter.cs


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