Beispiel #1
0
 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);
 }
Beispiel #2
0
        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();
            }
        }