CSMSL.IO.PepXML.PepXmlReader.GetSampleProtease C# (CSharp) Method

GetSampleProtease() public method

public GetSampleProtease ( ) : Protease
return CSMSL.Proteomics.Protease
        public Protease GetSampleProtease()
        {
            var node = _root.SelectSingleNode("//pepxml:sample_enzyme", _nsmgr);
            var name = node.Attributes["name"].Value;
            Protease protease;

            var specificityNode = node.FirstChild;
            string sense = specificityNode.Attributes["sense"].Value;
            string cut = specificityNode.Attributes["cut"].Value;
            string nocut = specificityNode.Attributes["no_cut"].Value;
            protease = new Protease(name, (sense.Equals("C")) ? Terminus.C : Terminus.N, cut, nocut);

            //Protease protease = new Protease(name, (sense.Equals("C")) ? Terminus.C : Terminus.N, cut, nocut);

            return protease;
        }

Usage Example

Example #1
0
 public static void ReadPepXml()
 {
     WritePepXml();
     //string filePath = Path.Combine(Examples.BASE_DIRECTORY, "example.pepXML");
     string filePath = @"E:\Desktop\test\27Nov2013_CEM_WellsProtein_CAD_filter.pep.xml";
     Console.WriteLine("Reading from " + filePath);
     using (PepXmlReader reader = new PepXmlReader(filePath))
     {
         Protease protease = reader.GetSampleProtease();
         Console.WriteLine("Protease: " + protease);
         Console.WriteLine();
         List<Modification> fixedMods = reader.GetFixedModifications();
         Console.WriteLine("==Fixed Modifications==");
         foreach (Modification mod in fixedMods)
         {
             Console.WriteLine("\t" + mod);
         }
         Console.WriteLine();
         List<Modification> varMods = reader.GetVariableModifications();
         Console.WriteLine("==Variable Modifications==");
         foreach (Modification mod in varMods)
         {
             Console.WriteLine("\t" + mod);
         }
     }
 }