Exemple #1
0
 public void Save(XmlWriter w)
 {
     w.WriteStartElement("door");
     w.WriteAttribute("x", Position.X);
     w.WriteAttribute("y", Position.Y);
     w.WriteAttribute("kind", Kind);
     w.WriteAttribute("state", State);
     w.WriteEndElement();
 }
Exemple #2
0
 public void Save(XmlWriter w)
 {
     w.WriteStartElement("brush");
     w.WriteAttribute("left", Bounds.Left);
     w.WriteAttribute("top", Bounds.Top);
     w.WriteAttribute("right", Bounds.Right);
     w.WriteAttribute("bottom", Bounds.Bottom);
     w.WriteAttribute("content", Content);
     w.WriteEndElement();
 }
        public override void WriteXml(XmlWriter writer)
        {
            // Write tag attributes.
            base.WriteXml(writer);

            if (PrecursorRightFilter.HasValue)
            {
                writer.WriteAttributeNullable(ATTR.precursor_left_filter, PrecursorFilter);
                writer.WriteAttributeNullable(ATTR.precursor_right_filter, PrecursorRightFilter);
            }
            else
            {
                writer.WriteAttributeNullable(ATTR.precursor_filter, PrecursorFilter);
            }

            if (!Equals(SpecialHandling, SpecialHandlingType.NONE))
                writer.WriteAttribute(ATTR.special_handling, SpecialHandling);
            writer.WriteAttributeNullable(ATTR.windows_per_scan, WindowsPerScan);

            writer.WriteElements(_prespecifiedIsolationWindows);
        }
        public override void WriteXml(XmlWriter writer)
        {
            // Write tag attributes
            base.WriteXml(writer);

            if (IsTrained)
            {
                writer.WriteAttribute(ATTR.uses_decoys, UsesDecoys, true);
                writer.WriteAttribute(ATTR.uses_false_targets, UsesSecondBest);
                writer.WriteAttribute(ATTR.bias, Parameters.Bias);

                // Write calculators
                var calculators = new List<FeatureCalculator>(PeakFeatureCalculators.Count);
                for (int i = 0; i < PeakFeatureCalculators.Count; i++)
                    calculators.Add(new FeatureCalculator(PeakFeatureCalculators[i].GetType(), Parameters.Weights[i]));
                writer.WriteElements(calculators);
            }
        }
 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttribute(ATTR.symbol, IsotopeSymbol);
     // Write element string
     writer.WriteString(AtomPercentEnrichment.ToString(CultureInfo.InvariantCulture));
 }
Exemple #6
0
        public override void WriteXml(XmlWriter writer)
        {
            // Write tag attributes
            base.WriteXml(writer);
            writer.WriteAttribute(ATTR.use_for_retention_time_prediction, false);
            writer.WriteAttributeNullable(ATTR.analyte_concentration, AnalyteConcentration);
            if (null != SampleType && !Equals(SampleType, SampleType.DEFAULT))
            {
                writer.WriteAttribute(ATTR.sample_type, SampleType.Name);
            }

            // Write optimization element, if present
            if (OptimizationFunction != null)
            {
                IXmlElementHelper<OptimizableRegression> helper = XmlUtil.FindHelper(
                    OptimizationFunction, OPTIMIZATION_HELPERS);
                if (helper == null)
                    throw new InvalidOperationException(Resources.ChromatogramSet_WriteXml_Attempt_to_serialize_list_containing_invalid_type);
                writer.WriteElement(helper.ElementNames[0], OptimizationFunction);
            }

            int i = 0;
            foreach (var fileInfo in MSDataFileInfos)
            {
                writer.WriteStartElement(EL.sample_file);
                writer.WriteAttribute(ATTR.id, GetOrdinalSaveId(i++));
                writer.WriteAttribute(ATTR.file_path, fileInfo.FilePath);
                writer.WriteAttribute(ATTR.sample_name, fileInfo.FilePath.GetSampleOrFileName());
                if(fileInfo.RunStartTime != null)
                {
                    writer.WriteAttribute(ATTR.acquired_time, XmlConvert.ToString((DateTime) fileInfo.RunStartTime, "yyyy-MM-ddTHH:mm:ss")); // Not L10N
                }
                if(fileInfo.FileWriteTime != null)
                {
                    writer.WriteAttribute(ATTR.modified_time, XmlConvert.ToString((DateTime)fileInfo.FileWriteTime, "yyyy-MM-ddTHH:mm:ss")); // Not L10N
                }

                // instrument information
                WriteInstrumentConfigList(writer, fileInfo.InstrumentInfoList);

                writer.WriteEndElement();
            }
            SrmDocument.WriteAnnotations(writer, Annotations);
        }
Exemple #7
0
 protected virtual void SaveAttributes(XmlWriter w)
 {
     w.WriteAttribute("class", GetType().ToString());
     w.WriteAttribute("x", Position.X);
     w.WriteAttribute("y", Position.Y);
     w.WriteAttribute("dir", Direction);
     w.WriteAttribute("name", Name);
 }
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteAttribute(Attr.library, Library);
 }
 protected override void SaveAttributes(XmlWriter w)
 {
     base.SaveAttributes(w);
     w.WriteAttribute("numguards", NumGuards);
     w.WriteAttribute("maxguards", MaxGuards);
     w.WriteAttribute("respawnrate", RespawnRate);
 }
        public void WriteXml(XmlWriter writer)
        {
            // Write attibutes
            writer.WriteAttribute(ATTR.max_variable_mods, MaxVariableMods);
            writer.WriteAttribute(ATTR.max_neutral_losses, MaxNeutralLosses);
            if (InternalStandardTypes.Count == 0)
            {
                writer.WriteAttribute(ATTR.internal_standard, IsotopeLabelType.NONE_NAME);
            }
            if (InternalStandardTypes.Count == 1)
            {
                var internalStandardType = InternalStandardTypes[0];
                if (!ReferenceEquals(internalStandardType, IsotopeLabelType.heavy))
                    writer.WriteAttribute(ATTR.internal_standard, internalStandardType.Name);
            }
            else
            {
                foreach (var labelType in InternalStandardTypes)
                {
                    writer.WriteStartElement(EL.internal_standard);
                    writer.WriteAttribute(ATTR.name, labelType.Name);
                    writer.WriteEndElement();
                }
            }

            // Write child elements
            if (StaticModifications.Count > 0)
                writer.WriteElementList(EL.static_modifications, StaticModifications);
            foreach (var heavyMods in GetHeavyModifications())
            {
                writer.WriteStartElement(EL.heavy_modifications);
                if (!ReferenceEquals(heavyMods.LabelType, IsotopeLabelType.heavy))
                    writer.WriteAttribute(ATTR.isotope_label, heavyMods.LabelType);
                writer.WriteElements(heavyMods.Modifications);
                writer.WriteEndElement();
            }
        }
        public void WriteXml(XmlWriter writer)
        {
            // Write attributes
            writer.WriteAttribute(ATTR.pick, Pick);
            if (RankId != null || _rankIdName != null)
            {
                // If libraries were never connected properly, then _rankIdName may still contain
                // the rank ID.
                writer.WriteAttribute(ATTR.rank_type, RankId != null ? RankId.Value : _rankIdName);
                writer.WriteAttributeNullable(ATTR.peptide_count, PeptideCount);
            }
            writer.WriteAttribute(ATTR.document_library, HasDocumentLibrary);

            // Write child elements
            var libraries = (_libraries.Count > 0 || _disconnectedLibraries == null ?
                _libraries : _disconnectedLibraries);

            if (libraries.Count > 0)
            {
                // writer.WriteElements(_libraries, LIBRARY_HELPERS);
                for (int i = 0; i < libraries.Count; i++)
                {
                    // First make sure it's not the document library
                    var spec = (!ReferenceEquals(libraries, _disconnectedLibraries) ? _librarySpecs[i] : null);
                    if (spec == null || !spec.IsDocumentLibrary)
                    {
                        // If there is a library, write it.  Otherwise, write the
                        // library spec.
                        var item = libraries[i];
                        if (item == null)
                        {
                            if (spec != null && !spec.IsDocumentLocal)
                            {
                                IXmlElementHelper<LibrarySpec> helper = XmlUtil.FindHelper(spec, LIBRARY_SPEC_HELPERS);
                                if (helper == null)
                                    throw new InvalidOperationException(
                                        Resources.
                                            PeptideLibraries_WriteXml_Attempt_to_serialize_list_containing_invalid_type);
                                writer.WriteElement(helper.ElementNames[0], spec);
                            }
                        }
                        else
                        {
                            IXmlElementHelper<Library> helper = XmlUtil.FindHelper(item, LIBRARY_HELPERS);
                            if (helper == null)
                                throw new InvalidOperationException(
                                    Resources.
                                        PeptideLibraries_WriteXml_Attempt_to_serialize_list_containing_invalid_type);
                            writer.WriteElement(helper.ElementNames[0], item);
                        }
                    }
                }
            }
        }
 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttribute(ATTR2.type, Type);
     writer.WriteAttribute(ATTR2.weight, Weight);
 }
Exemple #13
0
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     if (IsFragment)
     {
         writer.WriteAttributeString(ATTR.cut, Fragment);
         writer.WriteAttributeIfString(ATTR.no_cut, Restrict);
         writer.WriteAttributeNullable(ATTR.sense, Terminus);
         writer.WriteAttributeNullable(ATTR.min_length, MinFragmentLength);
     }
     else
     {
         writer.WriteAttributeIfString(ATTR.ion_formula, SettingsCustomIon.Formula);
         // Masses are information only, if their is a formula, but Panorama may need these
         writer.WriteAttribute(ATTR.mass_monoisotopic, SettingsCustomIon.MonoisotopicMass);
         writer.WriteAttribute(ATTR.mass_average, SettingsCustomIon.AverageMass);
         writer.WriteAttributeString(ATTR.charge, Charge.ToString(CultureInfo.InvariantCulture));
         writer.WriteAttribute(ATTR.optional, IsOptional);
     }
 }
Exemple #14
0
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     writer.WriteAttribute(ATTR.count_measured, SpectrumCount);
 }
Exemple #15
0
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     writer.WriteAttribute(ATTR.revision, Revision);
 }
Exemple #16
0
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     writer.WriteAttributeString(ATTR.regex, Regex);
     writer.WriteAttribute(ATTR.include, IsIncludeMatch);
     writer.WriteAttribute(ATTR.match_mod_sequence, IsMatchMod);
 }
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteAttributeIfString(ATTR.control_annotation, ControlAnnotation);
     writer.WriteAttributeIfString(ATTR.control_value, ControlValue);
     writer.WriteAttributeIfString(ATTR.case_value, CaseValue);
     writer.WriteAttributeIfString(ATTR.identity_annotation, IdentityAnnotation);
     writer.WriteAttribute(ATTR.avg_tech_replicates, AverageTechnicalReplicates, true);
     writer.WriteAttribute(ATTR.sum_transitions, SumTransitions, true);
     writer.WriteAttributeIfString(ATTR.normalization_method, NormalizationMethod.Name);
     writer.WriteAttribute(ATTR.include_interaction_transitions, IncludeInteractionTransitions, false);
     writer.WriteAttribute(ATTR.summarization_method, SummarizationMethod.Name);
     writer.WriteAttribute(ATTR.confidence_level, ConfidenceLevelTimes100);
     writer.WriteAttribute(ATTR.per_protein, PerProtein, false);
 }
        public void WriteXml(XmlWriter writer)
        {
            // Write this bool whether it is true or false, to allow its absence
            // as a marker of needing default values.
            writer.WriteAttribute(ATTR.use_measured_rts, UseMeasuredRTs, !UseMeasuredRTs);
            writer.WriteAttributeNullable(ATTR.measured_rt_window, MeasuredRTWindow);

            writer.WriteAttribute(ATTR.use_spectral_library_drift_times, UseLibraryDriftTimes, !UseLibraryDriftTimes);
            writer.WriteAttributeNullable(ATTR.spectral_library_drift_times_resolving_power, LibraryDriftTimesResolvingPower);

            // Write child elements
            if (RetentionTime != null)
                writer.WriteElement(RetentionTime);
            if (DriftTimePredictor != null)
                writer.WriteElement(DriftTimePredictor);
        }
Exemple #19
0
 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttributeIfString(ATTR.formula, Formula);
     writer.WriteAttribute(ATTR.massdiff_monoisotopic, MonoisotopicMass);
     writer.WriteAttribute(ATTR.massdiff_average, AverageMass);
     writer.WriteAttribute(ATTR.inclusion, Inclusion, LossInclusion.Library);
 }
 public void WriteXml(XmlWriter writer)
 {
     // Write attributes
     writer.WriteAttribute(ATTR.start, ExcludeNTermAAs);
     writer.WriteAttribute(ATTR.min_length, MinPeptideLength);
     writer.WriteAttribute(ATTR.max_length, MaxPeptideLength);
     writer.WriteAttribute(ATTR.auto_select, AutoSelect);
     // Write child elements
     writer.WriteElementList(EL.peptide_exclusions, Exclusions);
 }
Exemple #21
0
        public override void WriteXml(XmlWriter writer)
        {
            // Write tag attributes
            base.WriteXml(writer);
            writer.WriteAttributeIfString(ATTR.aminoacid, AAs);
            writer.WriteAttributeNullable(ATTR.terminus, Terminus);
            writer.WriteAttribute(ATTR.variable, IsVariable);
            writer.WriteAttributeIfString(ATTR.formula, Formula);
            writer.WriteAttribute(ATTR.label_13C, Label13C);
            writer.WriteAttribute(ATTR.label_15N, Label15N);
            writer.WriteAttribute(ATTR.label_18O, Label18O);
            writer.WriteAttribute(ATTR.label_2H, Label2H);
            writer.WriteAttribute(ATTR.relative_rt, RelativeRT, RelativeRT.Matching);
            if (string.IsNullOrEmpty(Formula))
            {
                writer.WriteAttributeNullable(ATTR.massdiff_monoisotopic, MonoisotopicMass);
                writer.WriteAttributeNullable(ATTR.massdiff_average, AverageMass);
            }
            if (!IsVariable)
                writer.WriteAttribute(ATTR.explicit_decl, IsExplicit);

            writer.WriteAttributeNullable(ATTR.unimod_id, UnimodId);

            writer.WriteAttributeIfString(ATTR.short_name, ShortName);

            if (Losses != null)
                writer.WriteElements(Losses);
        }
Exemple #22
0
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     foreach (var column in Columns)
     {
         writer.WriteStartElement(El.grid_column);
         writer.WriteAttribute(Attr.name, column.Name);
         writer.WriteAttribute(Attr.visible, column.Visible);
         writer.WriteAttribute(Attr.width, column.Width);
         writer.WriteEndElement();
     }
 }
Exemple #23
0
 protected override void SaveAttributes(XmlWriter w)
 {
     base.SaveAttributes(w);
     w.WriteAttribute("target", Target);
 }
Exemple #24
0
 public void WriteXml(XmlWriter writer)
 {
     if (Formula != null)
     {
         writer.WriteAttribute(ATTR.ion_formula, Formula);
         writer.WriteAttributeNullable(ATTR.mass_average, AverageMass);
         writer.WriteAttributeNullable(ATTR.mass_monoisotopic, MonoisotopicMass);
     }
     else
     {
         // Without a formula we can't rederive masses, so write at higher precision
         writer.WriteAttributeNullableRoundTrip(ATTR.mass_average, AverageMass);
         writer.WriteAttributeNullableRoundTrip(ATTR.mass_monoisotopic, MonoisotopicMass);
     }
     if (Name != null)
         writer.WriteAttribute(ATTR.custom_ion_name, Name);
 }
Exemple #25
0
 public override void WriteXml(XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteAttribute(ATTR.database_path, DatabasePath);
 }
Exemple #26
0
 public void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     writer.WriteAttribute(ATTR.max_missed_cleavages, MaxMissedCleavages);
     writer.WriteAttribute(ATTR.exclude_ragged_ends, ExcludeRaggedEnds);
 }
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     writer.WriteAttribute(ATTR.peak_area, PeakArea);
 }
Exemple #28
0
 public override void WriteXml(XmlWriter writer)
 {
     // Write tag attributes
     base.WriteXml(writer);
     // If not cleavage both directions, then write the enzyme out the old way
     if (IsBothTerm)
     {
         writer.WriteAttributeString(ATTR.cut_c, CleavageC);
         writer.WriteAttributeString(ATTR.no_cut_c, RestrictC);
         writer.WriteAttributeString(ATTR.cut_n, CleavageN);
         writer.WriteAttributeString(ATTR.no_cut_n, RestrictN);
     }
     else if (IsCTerm)
     {
         writer.WriteAttributeString(ATTR.cut, CleavageC);
         writer.WriteAttributeString(ATTR.no_cut, RestrictC);
         writer.WriteAttribute(ATTR.sense, SequenceTerminus.C);
     }
     else
     {
         writer.WriteAttributeString(ATTR.cut, CleavageN);
         writer.WriteAttributeString(ATTR.no_cut, RestrictN);
         writer.WriteAttribute(ATTR.sense, SequenceTerminus.N);
     }
 }
Exemple #29
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteAttribute(Attr.revision, RevisionIndex);
     base.WriteXml(writer);
 }
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteAttribute(ATTR.start, Start);
     writer.WriteAttribute(ATTR.end, End);
     writer.WriteAttributeNullable(ATTR.target, Target);
     if (StartMargin != null)
     {
         if (EndMargin != null)
         {
             writer.WriteAttributeNullable(ATTR.margin_left, StartMargin);
             writer.WriteAttributeNullable(ATTR.margin_right, EndMargin);
         }
         else
         {
             writer.WriteAttributeNullable(ATTR.margin, StartMargin);
         }
     }
     writer.WriteAttributeNullable(ATTR.ce_range, CERange);
 }