public static void LoadOmssaModifications(Stream stream, bool userMod = true)
{
XmlDocument mods_xml = new XmlDocument();
mods_xml.Load(stream);
XmlNamespaceManager mods_xml_ns = new XmlNamespaceManager(mods_xml.NameTable);
mods_xml_ns.AddNamespace("omssa", mods_xml.ChildNodes[1].Attributes["xmlns"].Value);
foreach (XmlNode mod_node in mods_xml.SelectNodes("/omssa:MSModSpecSet/omssa:MSModSpec", mods_xml_ns))
{
string name = mod_node.SelectSingleNode("./omssa:MSModSpec_name", mods_xml_ns).FirstChild.Value;
int id = int.Parse(mod_node.SelectSingleNode("./omssa:MSModSpec_mod/omssa:MSMod", mods_xml_ns).FirstChild.Value);
double mono = double.Parse(mod_node.SelectSingleNode("./omssa:MSModSpec_monomass", mods_xml_ns).FirstChild.Value);
double average = double.Parse(mod_node.SelectSingleNode("./omssa:MSModSpec_averagemass", mods_xml_ns).FirstChild.Value);
ModificationSites sites = ModificationSites.None;
foreach (
XmlNode node in
mod_node.SelectNodes("./omssa:MSModSpec_residues/omssa:MSModSpec_residues_E", mods_xml_ns))
{
string aa = node.FirstChild.Value;
sites = sites.Set(aa[0]);
}
OmssaModification mod = new OmssaModification(name, id, mono, average, userMod, sites);
Modifications.Add(name, mod);
_modificationKeyDicitonary[id] = name;
}
}