public static void GlyTest_GlyGetTheoreticalFragments() { Protein pep = new Protein("TKPREEQYNSTYR", "accession"); DigestionParams digestionParams = new DigestionParams(minPeptideLength: 7); var aPeptideWithSetModifications = pep.Digest(digestionParams, new List <Modification>(), new List <Modification>()); string[] motifs = new string[] { "Nxs", "Nxt" }; var sites = GlycoSpectralMatch.GetPossibleModSites(aPeptideWithSetModifications.Last(), motifs); Glycan glycan = Glycan.Struct2Glycan("(N(F)(N(H(H(N))(H(N)))))", 0); //using (StreamWriter output = new StreamWriter(Path.Combine(TestContext.CurrentContext.TestDirectory, "GlycanFragmentions.txt"))) //{ // foreach (var product in fragmentIons) // { // foreach (var ion in product.Item2) // { // output.WriteLine(ion.Annotation + "\t" + ion.NeutralLoss.ToString() + "\t" + ion.NeutralMass.ToString()); // } // } //} CommonParameters commonParameters = new CommonParameters(deconvolutionMassTolerance: new PpmTolerance(20), trimMsMsPeaks: false); string filePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"GlycoTestData/Glyco_3383.mgf"); //"25170.mgf" MyFileManager myFileManager = new MyFileManager(true); var msDataFile = myFileManager.LoadFile(filePath, commonParameters); var listOfSortedms2Scans = MetaMorpheusTask.GetMs2Scans(msDataFile, filePath, commonParameters).ToArray(); var glycanMod = Glycan.NGlycanToModification(glycan); var glycopep = GlycoPeptides.GenerateGlycopeptide(sites[0], aPeptideWithSetModifications.Last(), glycan); List <Product> fragmentIons = new List <Product>(); glycopep.Fragment(DissociationType.HCD, FragmentationTerminus.Both, fragmentIons); var glycanYIons = GlycoPeptides.GetGlycanYIons(listOfSortedms2Scans[0].PrecursorMass, glycan); var matchedGlycanYIons = MetaMorpheusEngine.MatchFragmentIons(listOfSortedms2Scans[0], glycanYIons, commonParameters); Assert.AreEqual(matchedGlycanYIons.Count, 14); //TO DO: The neutroloss is not annotated well. var matchedFragmentIons = MetaMorpheusEngine.MatchFragmentIons(listOfSortedms2Scans[0], fragmentIons, commonParameters); var coreIons = GlycoPeptides.ScanGetTrimannosylCore(matchedFragmentIons, glycan); Assert.AreEqual(coreIons.Count, 6); var filter = GlycoPeptides.ScanTrimannosylCoreFilter(matchedFragmentIons, glycan); Assert.AreEqual(filter, true); var NGlycans = GlycanDatabase.LoadGlycan(GlobalVariables.NGlycanLocations[0], true, false); var bestGlycans = GlycoPeptides.MatchBestGlycan(listOfSortedms2Scans[0], NGlycans.ToArray(), commonParameters).Where(p => p != null && p.Item2 >= 2).OrderByDescending(p => p.Item2).Take(100).OrderBy(p => p.Item3).ToArray();; }
public static void Setup() { GlycanBox.GlobalOGlycans = GlycanDatabase.LoadGlycan(GlobalVariables.OGlycanLocations.Where(p => p.Contains("OGlycan.gdb")).First(), true, true).ToArray(); GlycanBox.GlobalOGlycanModifications = GlycanBox.BuildGlobalOGlycanModifications(GlycanBox.GlobalOGlycans); OGlycanBoxes = GlycanBox.BuildOGlycanBoxes(3).OrderBy(p => p.Mass).ToArray(); }