Example #1
0
        public void ReadXml(XmlReader reader)
        {
            // Consume tag
            if (reader.IsEmptyElement)
                reader.Read();
            else
            {
                reader.ReadStartElement();

                // Read child elements.
                Enzyme = reader.DeserializeElement<Enzyme>();
                DigestSettings = reader.DeserializeElement<DigestSettings>();
                BackgroundProteome = reader.DeserializeElement<BackgroundProteome>();
                Prediction = reader.DeserializeElement<PeptidePrediction>();
                Filter = reader.DeserializeElement<PeptideFilter>();
                Libraries = reader.DeserializeElement<PeptideLibraries>();
                Modifications = reader.DeserializeElement<PeptideModifications>();
                Integration = reader.DeserializeElement<PeptideIntegration>();
                Quantification = reader.DeserializeElement<QuantificationSettings>();
                reader.ReadEndElement();
            }

            Quantification = Quantification ?? QuantificationSettings.DEFAULT;
            // Defer validation to the SrmSettings object
        }
Example #2
0
        public override void ReadXml(XmlReader reader)
        {
            // Read tag attributes
            base.ReadXml(reader);
            reader.ReadStartElement();
            PeptideSettings = reader.DeserializeElement<PeptideSettings>();
            TransitionSettings = reader.DeserializeElement<TransitionSettings>();

            // 10.23.12 -- The order of <measured_results> and <data_settings> has been switched to enable parsing (in Panorama)
            // of all annotation definitions before reading any replicate annotations in <measured_results>.
            // We want Skyline to be able to read older documents where <measured_results> come before <data_settings>
            if (reader.IsStartElement(new XmlElementHelper<MeasuredResults>().ElementNames[0]))
            {
                MeasuredResults = reader.DeserializeElement<MeasuredResults>();
                DataSettings = reader.DeserializeElement<DataSettings>() ?? DataSettings.DEFAULT;
            }
            else
            {
                DataSettings = reader.DeserializeElement<DataSettings>() ?? DataSettings.DEFAULT;
                MeasuredResults = reader.DeserializeElement<MeasuredResults>();
            }

            DocumentRetentionTimes = reader.DeserializeElement<DocumentRetentionTimes>() ?? DocumentRetentionTimes.EMPTY;
            reader.ReadEndElement();
            ValidateLoad();
        }
Example #3
0
        public void ReadXml(XmlReader reader)
        {
            bool? useMeasuredRTs = reader.GetNullableBoolAttribute(ATTR.use_measured_rts);
            MeasuredRTWindow = reader.GetNullableDoubleAttribute(ATTR.measured_rt_window);
            bool? useLibraryDriftTimes = reader.GetNullableBoolAttribute(ATTR.use_spectral_library_drift_times);
            LibraryDriftTimesResolvingPower = reader.GetNullableDoubleAttribute(ATTR.spectral_library_drift_times_resolving_power);
            // Keep XML values, if written by v0.5 or later
            if (useMeasuredRTs.HasValue)
                UseMeasuredRTs = useMeasuredRTs.Value;
            // Use reasonable defaults for documents saved prior to v0.5
            else
            {
                UseMeasuredRTs = true;
                if (!MeasuredRTWindow.HasValue)
                    MeasuredRTWindow = DEFAULT_MEASURED_RT_WINDOW;
            }

            if (useLibraryDriftTimes.HasValue)
                UseLibraryDriftTimes = useLibraryDriftTimes.Value;
            else
            {
                UseLibraryDriftTimes = false;
                LibraryDriftTimesResolvingPower = null;
            }

            // Consume tag
            if (reader.IsEmptyElement)
                reader.Read();
            else
            {
                reader.ReadStartElement();
                // Read child elements
                RetentionTime = reader.DeserializeElement<RetentionTimeRegression>();
                DriftTimePredictor = reader.DeserializeElement<DriftTimePredictor>();
                reader.ReadEndElement();
            }

            DoValidate();
        }