private void button1_Click(object sender, EventArgs e) { COL.MassLib.ThermoRawReader raw = new COL.MassLib.ThermoRawReader(@"E:\Dropbox\Chuan-Yih\PerMethQuant\RiboB_7plex_05302014.raw"); COL.MassLib.MSScan scan1 = raw.ReadScan(846); //COL.MassLib.MSScan scan2 = raw.ReadScan(415); GlycanCompound CP1 = new GlycanCompound(5, 6, 0, 2, false, false, false, false, true); CP1.isHuman = true; CP1.LabelingTag = enumLabelingTag.DRAG_Light; double a = COL.MassLib.MassUtility.GetMassPPM(CP1.MonoMass, 2748.063); }
public void SequenceCIDPeaks(ref Classes.MapRecord _glycoMap, ref Classes.Params _params, string sequencingFolder) { Classes.MapRecord _tempMap = new MapRecord(); _tempMap._AssociatedDatasetNames = _glycoMap._AssociatedDatasetNames; _tempMap._IsCID = _glycoMap._IsCID; _tempMap._IsETD = _glycoMap._IsETD; _tempMap._IsHCD = _glycoMap._IsHCD; Classes.FragEvents e = new FragEvents(); if (sequencingFolder == "") sequencingFolder = @"c:\sequencing\"; for (int i = 0; i < _glycoMap._AllMLNRecords.Count; i++) { MultiAlignRecord m = new MultiAlignRecord(); m = _glycoMap._AllMLNRecords[i]; int num_records = m._AssociatedUMCRecords.Count; if (m.ID == 2290) { bool test = true; } //for (int j = 0; j < num_records; j++) //{ // for (int k = 0; k < m._AssociatedUMCRecords[j]._AssociatedFragEvents.Count; k++) for (int k = 0; k < m._ClusterRepFragEvents.Count; k++) { e = new FragEvents(); e = m._ClusterRepFragEvents[k]; // m._AssociatedUMCRecords[j]._AssociatedFragEvents[k]; if (e.ETDScore > 0) { float PeptideMass = 0; float GlcNAcMass = 0; COL.MassLib.MSScan _msScan = new COL.MassLib.MSScan(e.CIDMzs, e.CIDIntensities, Convert.ToSingle(e.TransformResult.mdbl_mz), Convert.ToSingle(e.TransformResult.mdbl_mono_mw), Convert.ToSingle(e.TransformResult.mdbl_average_mw), Convert.ToInt32(e.TransformResult.mshort_cs)); if (e.TransformResult.mdbl_average_mw > 0) { PeptideMass = Convert.ToSingle(e.GP_Record.SequenceAverageMass); // this means proper deisotoping has occured so use average compostion GlcNAcMass = COL.GlycoLib.GlycanMass.GetGlycanAVGMass(COL.GlycoLib.Glycan.Type.HexNAc); } else { PeptideMass = Convert.ToSingle(e.GP_Record.SequenceMonoMass); // CS has been assigned, in which case both y1 and precursor should be just mono GlcNAcMass = COL.GlycoLib.GlycanMass.GetGlycanMass(COL.GlycoLib.Glycan.Type.HexNAc); } short y1cs = e.TransformResult.mshort_cs; y1cs--; while (y1cs > 0) { float y1Mz = ((PeptideMass + GlcNAcMass) + (float)_utils._CC_MASS * y1cs) / y1cs; COL.GlycoSequence.GlycanSequencing _Gs = new COL.GlycoSequence.GlycanSequencing(_msScan, y1Mz, y1cs, e.GP_Record.Glycan.numHex, e.GP_Record.Glycan.numHexNAc, e.GP_Record.Glycan.numDeHex, e.GP_Record.Glycan.numNeuAc, 0, sequencingFolder, true, 0.8f, 60); _Gs.NumbersOfPeaksForSequencing = 140; _Gs.CreatePrecursotMZ = true; _Gs.RewardForCompleteStructure = 3; if (e.TransformResult.mdbl_average_mw > 0) _Gs.UseAVGMass = true; else _Gs.UseAVGMass = false; int structure_count = _Gs.StartSequencing(); if (structure_count > 0) { List<COL.GlycoLib.GlycanStructure> topstructures = _Gs.GetTopRankScoreStructre(1); e.CIDSequencingScore = topstructures[0].Score; e.GP_Record.GlycanSequence = topstructures[0].IUPACString; // Printing out the sequences string opfile = sequencingFolder + m.ID.ToString() + "_" + e.CIDScan.ToString() + ".txt"; Utils.CSVFileHandler cidString = new CSVFileHandler(opfile, CSVFileHandler.WRITE_ONLY); cidString.openFile(); for (int zz = 0; zz < topstructures.Count; zz++) { cidString.writeLine(topstructures[zz].IUPACString); /*COL.GlycoLib.GlycansDrawer _gdraw = new COL.GlycoLib.GlycansDrawer(topstructures[zz].IUPACString, false); System.Drawing.Image img1 = _gdraw.GetImage();*/ } cidString.closeFile(); break; } y1cs--; } } } } }