Пример #1
0
        private void btnBrowseRaw_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter   = "RAW Files (*.raw; *.mzXML)|*.raw;*.mzxml";
            openFileDialog1.Filter   = "RAW Files (*.raw)|*.raw";
            openFileDialog1.FileName = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtRawFile.Text = openFileDialog1.FileName;

                if (Path.GetExtension(openFileDialog1.FileName) == ".raw")
                {
                    raw      = new COL.MassLib.ThermoRawReader(txtRawFile.Text);
                    _endScan = raw.NumberOfScans;
                }
                //else
                //{
                //    COL.MassLib.RawReader raw = new COL.MassLib.RawReader(txtRawFile.Text,"mzxml");
                //    _endScan = raw.NumberOfScans;
                //}

                lblLastScanTime.Text = "Last Scan Time:" + raw.ReadScan(raw.NumberOfScans).Time.ToString();
                txtEndScan.Text      = _endScan.ToString();
                txtLCTime.Text       = raw.ReadScan(raw.NumberOfScans).Time.ToString("0");
            }
        }
Пример #2
0
        private void btnLoadRawCSMSL_Click(object sender, EventArgs e)
        {
            if(openFileDialog1.ShowDialog () == System.Windows.Forms.DialogResult.OK)
            {
                COL.MassLib.ThermoRawReader raw = new ThermoRawReader(openFileDialog1.FileName);

            }
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();
            //StreamReader SR = new StreamReader(@"D:\Data\Jacobson Tang Meeting\bkdsub_smooth_centroid RNASE5.txt");
            //List<double> mzs = new List<double>();
            //List<double> intensities = new List<double>();
            //do
            //{
            //    string tmp = SR.ReadLine();
            //    mzs.Add(Convert.ToDouble(tmp.Split('\t')[0]));
            //    intensities.Add(Convert.ToDouble(tmp.Split('\t')[1]));
            //} while (!SR.EndOfStream);
            //SR.Close();
            //GraphPane gp = zedGraphControl1.GraphPane;
            //PointPairList ppl = new PointPairList(mzs.ToArray(), intensities.ToArray());
            //gp.AddBar("X-Y", ppl, Color.Black);
            //gp.AxisChange();
            //zedGraphControl1.Refresh();
            //List<Protease.Type> proteasList = new List<Protease.Type>();
            //proteasList.Add(Protease.Type.Trypsin);
            //List<ProteinInfo> PInfos = FastaReader.ReadFasta(@"E:\Dropbox\@Paper\MyPaper\GlycanSeq_AC\Data\H1N1\H1N1.fasta");

            //List<string> Peptides = PInfos[0].NGlycopeptide(0, proteasList, enumPeptideMutation.NoMutation);
            //List<string> MutaPeptides = PInfos[0].NGlycopeptide(0, proteasList,enumPeptideMutation.DtoN);
            //Console.WriteLine(Peptides.Count);
            //Console.WriteLine(MutaPeptides.Count);
            COL.GlycoLib.ReadGlycanListFromFile.ReadGlycanList(@"D:\!Git\MultiGlycan\lib\Default_Combination.csv", true,
                false, false, true, true);
            COL.MassLib.ThermoRawReader Raw = new ThermoRawReader(@"E:\Dropbox\@Paper\MyPaper\GlycanSeq_AC\Data\H1N1\P-Glu-C_IU_090710_HCD.RAW");
            List<MSScan> Scan = Raw.ReadScanWMSLevel(13107, 13127, 1);
            Console.WriteLine(Raw.NumberOfScans.ToString());
            List<MSScan> MS1 = Raw.ReadScanWMSLevel(1,Raw.NumberOfScans,1);
            List<MSScan> MS2 = Raw.ReadScanWMSLevel(1, Raw.NumberOfScans, 2);
            int CIDCount = 0;
            int HCDCount = 0;
            foreach (var m in MS2)
            {
                if (m.IsCIDScan)
                {
                    CIDCount++;
                }
                if (m.IsHCDScan)
                {
                    HCDCount++;
                }
            }
            Console.WriteLine(CIDCount.ToString());
        }
Пример #4
0
 private void button3_Click(object sender, EventArgs e)
 {
     MassLib.ThermoRawReader Raw = new ThermoRawReader(@"E:\Dropbox\Chuan-Yih\PerMethQuant\RiboB_7plex_05302014.raw");
     List<MSScan> scans = Raw.ReadScans(766, 1066);
     List<MSPeak> Peaks = new List<MSPeak>();
     foreach (MSScan s in scans)
     {
         foreach (MSPeak p in s.MSPeaks)
         {
             if (p.ChargeState == 2)
             {
                 Peaks.Add(p);
                 ;
             }
             //if (p.MonoisotopicMZ >= 834.62 && p.MonoisotopicMZ <= 834.65)
             //{
             //    Peaks.Add(p);
             //}
         }
     }
 }
Пример #5
0
        private void btnBrowseRaw_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "RAW Files (*.raw; *.mzXML)|*.raw;*.mzxml";
            openFileDialog1.Filter = "RAW Files (*.raw)|*.raw";
            openFileDialog1.FileName = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtRawFile.Text = openFileDialog1.FileName;

                if (Path.GetExtension(openFileDialog1.FileName) == ".raw")
                {
                    raw = new COL.MassLib.ThermoRawReader(txtRawFile.Text);
                    _endScan = raw.NumberOfScans;
                }
                //else
                //{
                //    COL.MassLib.RawReader raw = new COL.MassLib.RawReader(txtRawFile.Text,"mzxml");
                //    _endScan = raw.NumberOfScans;
                //}

                lblLastScanTime.Text = "Last Scan Time:" + raw.ReadScan(raw.NumberOfScans).Time.ToString() ;
                txtEndScan.Text = _endScan.ToString();
                txtLCTime.Text = raw.ReadScan(raw.NumberOfScans).Time.ToString("0");
            }
        }
Пример #6
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter           = "Raw files (*.RAW,*.mzXML)|*.RAW;*.mzXML";
            openFileDialog1.RestoreDirectory = true;
            if (txtScanNo.Text == "" || txtPeptideSeq.Text == "")
            {
                MessageBox.Show("Please fill the information");
                return;
            }
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                _torelance          = Convert.ToSingle(txtPeaKTol.Text);
                _precursorTorelance = Convert.ToSingle(txtPrecusorTol.Text);
                dtTrees.Rows.Clear();
                int ScanNo = 0;
                if (Int32.TryParse(txtScanNo.Text, out ScanNo) == false)
                {
                    MessageBox.Show("Input Scan Number Error");
                    return;
                }

                if (Path.GetExtension(openFileDialog1.FileName).ToLower() == ".raw")
                {
                    ThermoRawReader RawReader = new COL.MassLib.ThermoRawReader(openFileDialog1.FileName);

                    /*GlypID.Peaks.clsPeakProcessorParameters clsParameters = new GlypID.Peaks.clsPeakProcessorParameters();
                     * clsParameters.SignalToNoiseThreshold = 0.0f;
                     * clsParameters.PeakBackgroundRatio = 0.01f;*/
                    //RawReader.SetPeakProcessorParameter(2, 2);
                    scan = RawReader.ReadScan(ScanNo);
                }
                else
                {
                    //scan = new mzXMLReader(openFileDialog1.FileName).ReadScan(ScanNo);
                }


                int NoNeuAc = 0;
                int NoNeuGc = 0;
                if (rdoNeuAc.Checked)
                {
                    NoNeuAc = Convert.ToInt32(txtSia.Text);
                }
                else
                {
                    NoNeuGc = Convert.ToInt32(txtSia.Text);
                }


                List <int> SequenceParameters = new List <int>();
                SequenceParameters.Add(Convert.ToInt32(txtTopPeaks_i.Text));
                SequenceParameters.Add(Convert.ToInt32(txtTopDiagPeaks_j.Text));
                SequenceParameters.Add(Convert.ToInt32(txtTopCorePeaks_k.Text));
                SequenceParameters.Add(Convert.ToInt32(txtTopBrancingPeaks_l.Text));
                SequenceParameters.Add(Convert.ToInt32(txtMaxGlycansToCompleteStruct_m.Text));


                GS = new GlycanSequencing_MultipleScoring(scan, scan.ParentCharge, Convert.ToInt32(txtHex.Text), Convert.ToInt32(txtHexNAc.Text), Convert.ToInt32(txtdeHex.Text), NoNeuAc, NoNeuGc, @"D:\tmp", true, 0.8f, 10, SequenceParameters, Peptides.ReadFastaFile(txtPeptideSeq.Text));
                GS.NumbersOfPeaksForSequencing = 140;
                GS.UseAVGMass = true;
                //GS.DebugMode(@"E:\temp\SeqTmp\");
                GS.CreatePrecursotMZ          = true;
                GS.RewardForCompleteStructure = 3;
                GS.StartSequencing();
                GS.GetTopRankScoreStructre(1);



                //lstPeak.Items.Add("Top " + GS.FilteredPeaks.Count.ToString() + "  peaks");
                //lstPeak.Items.Add("m/z / normailzed intensity ");
                //foreach (MSPoint p in GS.FilteredPeaks)
                //{
                //    lstPeak.Items.Add(p.Mass.ToString("0.0000") +"/" + p.Intensity.ToString("0.0000"));
                //}

                bool isFullSeq = false;
                ReportStructure = GS.SequencedStructures;
                if (ReportStructure.Count == 0)
                {
                    MessageBox.Show("No Structure Found");
                    return;
                }
                if (GS.FullSequencedStructures.Count != 0)
                {
                    ReportStructure = GS.FullSequencedStructures;
                    isFullSeq       = true;
                }
                AminoAcidMass AA = new AminoAcidMass();
                for (int i = 0; i < ReportStructure.Count; i++)
                {
                    GlycanStructure gt  = ReportStructure[i];
                    DataRow         row = dtTrees.NewRow();
                    //row.Add(new Object[] (gt.Mass.ToString("0.0000"), gt.Score.ToString("0.0000"),gt.GetIUPACString()));
                    row["ID"]                  = i.ToString();
                    row["Glycan Mass"]         = gt.GlycanAVGMonoMass.ToString("0.0000");
                    row["Y1"]                  = gt.Y1.Mass.ToString("0.0000");;
                    row["Core Score"]          = Convert.ToSingle((gt.CoreScore).ToString("0.00"));
                    row["Branch Score"]        = Convert.ToSingle((gt.BranchScore).ToString("0.00"));
                    row["Append Glycan Score"] = Convert.ToSingle((gt.InCompleteScore).ToString("0.00"));
                    if (gt.IsCompleteByPrecursorDifference)
                    {
                        row["PPM"] =
                            Convert.ToSingle(
                                MassUtility.GetMassPPM(
                                    gt.GlycanMonoMass + AA.GetMonoMW(gt.PeptideSequence, true) +
                                    GetGlycanMassByGlycanString(gt.RestGlycanString), GS.PrecusorMonoMass)
                                .ToString("0.00"));
                    }
                    else
                    {
                        row["PPM"] =
                            Convert.ToSingle(
                                MassUtility.GetMassPPM(
                                    gt.GlycanMonoMass + AA.GetMonoMW(gt.PeptideSequence, true), GS.PrecusorMonoMass).ToString("0.00"));
                    }
                    row["Peptide"]       = gt.PeptideSequence;
                    row["Append Glycan"] = gt.RestGlycanString;
                    row["IUPAC"]         = gt.IUPACString;

                    GlycansDrawer GDRaw  = new GlycansDrawer(gt.IUPACString, false);
                    Image         tmpImg = GDRaw.GetImage();
                    row["Structure"] = tmpImg;
                    dtTrees.Rows.Add(row);
                }
                ////GS.SequencStructures[0].TheoreticalFragment
                dtTrees.DefaultView.Sort = "Glycan Mass DESC";


                for (int i = 0; i < dgView.Rows.Count; i++)
                {
                    this.dgView.AutoResizeRow(i);
                    if (Convert.ToSingle(dgView.Rows[i].Cells["PPM"].Value) <= Convert.ToSingle(txtPrecusorTol.Text))
                    {
                        dgView.Rows[i].DefaultCellStyle.BackColor = Color.Red;
                    }
                }
            }
        }