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


C# DataReader.GetGlobalParams方法代码示例

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


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

示例1: ExportMzML

        public bool ExportMzML(string sourceUIMFPath, string outputPath, VoltageGroup voltageGroup, DataReader originalUIMF, bool averageNotSum)
        {
            FrameParams frameParam = originalUIMF.GetFrameParams(voltageGroup.FirstFrameNumber);
            GlobalParams globalParams = originalUIMF.GetGlobalParams();

            this.scans = (int)frameParam.GetValueDouble(FrameParamKeyType.Scans);
            this.bins = (int)globalParams.GetValueDouble(GlobalParamKeyType.Bins);

            this.calibrationSlope = frameParam.GetValueDouble(FrameParamKeyType.CalibrationSlope);
            this.calibrationIntercept = frameParam.GetValueDouble(FrameParamKeyType.CalibrationIntercept);
            this.binWidth = globalParams.GetValueDouble(GlobalParamKeyType.BinWidth);
            this.tofCorrectionTime = globalParams.GetValueDouble(GlobalParamKeyType.TOFCorrectionTime);

            if (File.Exists(outputPath))
            {
                File.Delete(outputPath);
            }

            this.dateTime = globalParams.GetValue(GlobalParamKeyType.DateStarted);
            string datasetName = Path.GetFileNameWithoutExtension(outputPath);

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Indent = true;

            using (XmlWriter writer = XmlWriter.Create(outputPath, settings))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("mzML", "http://psi.hupo.org/ms/mzml");
                writer.WriteAttributeString("id", datasetName);
                writer.WriteAttributeString("version", "1.1.0");
                writer.WriteAttributeString("xmlns", "xls", string.Empty, "http://www.w3.org/2001/XMLSchema-instance");
                writer.WriteAttributeString("xmlns", "schemaLocation", string.Empty, "http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd");
                this.WriteCVList(writer);
                this.WriteFileDescription(writer, sourceUIMFPath);
                this.WriteSoftwareList(writer);
                this.WriteInstrumentConfigurationList(writer);
                this.WriteDataProcessingList(writer);
                this.WriteRun(writer, outputPath, originalUIMF, voltageGroup);
                writer.WriteEndElement();
                writer.WriteEndDocument();
                return true;
            }
        }
开发者ID:PNNL-Comp-Mass-Spec,项目名称:IMS-Informed-Library,代码行数:43,代码来源:RetentionMobilitySwappedMzMLExporter.cs

示例2: MaxGlobalIntensities

        public static double MaxGlobalIntensities(VoltageGroup group, DataReader reader)
        {
            GlobalParams global = reader.GetGlobalParams();
            FrameParams param = reader.GetFrameParams(@group.FirstFrameNumber);
            int firstFrame = group.FirstFrameNumber;
            int lastFrame = group.LastFrameNumber;
            int firstScan = 1;
            int lastScan = param.Scans;
            int firstBin = 0;
            int lastBin = global.Bins;
            int windowOfBins = 1000;
            int windowOfScans = 20;
            double maxIntensities = 0;
            for (int scan = firstScan; scan <= lastScan; scan += windowOfScans)
            {
                int endScan = (scan + windowOfScans > lastScan) ? lastScan : scan + windowOfScans;
                for (int bin = firstBin; bin <= lastBin; bin += windowOfBins)
                {
                    int endBin = (bin + windowOfBins > lastBin) ? lastBin : bin + windowOfBins;

                    double localMaxIntensities = MaxGlobalIntensities(reader, scan, endScan, bin, endBin, firstFrame, lastFrame);
                    maxIntensities = (localMaxIntensities > maxIntensities) ? localMaxIntensities : maxIntensities;
                }
            }
            return maxIntensities;
        }
开发者ID:PNNL-Comp-Mass-Spec,项目名称:IMS-Informed-Library,代码行数:26,代码来源:IMSUtil.cs

示例3: TestUimFfileReading

        public void TestUimFfileReading()
        {
            double[] mzq = new double[200];
            int[] intensity = new int[100];

            DataReader uimfReader = new DataReader(Cheetah);
            Console.WriteLine("\r\nReading UIMF file at: " + uimfReader.UimfFilePath);
            Console.WriteLine(uimfReader.GetGlobalParams().NumFrames);
            //Console.WriteLine(uimfReader.GetXic(161.1078678, 30, DataReader.FrameType.MS1, DataReader.ToleranceType.PPM));
            //Console.WriteLine(uimfReader.GetXic(20, DataReader.FrameType.MS1));
            //Console.WriteLine(uimfReader.GetXic(161.107, 30, 4, 100, 0, 100, DataReader.FrameType.MS1, DataReader.ToleranceType.PPM));
            //Console.WriteLine("\r\nSpectrum: " + uimfReader.GetSpectrum(1, DataReader.FrameType.MS1, 2, out mzq, out intensity));
            //foreach (var item in intensity)
            //    Console.WriteLine(item);
        }
开发者ID:PNNL-Comp-Mass-Spec,项目名称:IMS-Informed-Library,代码行数:15,代码来源:LCMSPeptidesTest.cs


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