/// <summary> /// Get the spectra from the new quantification. /// </summary> /// <param name="result">The quantification result.</param> private void GetSpectra(QuantResult result) { // Get the cit spectrum ID int citSpectrumId = result.CitSpectrumID; // From the validation type, get the spectra information if (result.ValidationBy == "Cit-paired") { // Loop through all of the cit spectra to get the spectra foreach (var item in Quantification.citSpecSpecDict) { if (item.Key.ID == citSpectrumId) { citSpectrum = item.Key; argSpectrum = item.Value; } } } else { // Loop through all of the arg spectra to get the spectra foreach (var item in Quantification.argSpecScanDict) { if (item.Value.ScanNumber == citSpectrumId) { citSpectrum = item.Value; argSpectrum = item.Key; } } } }
/// <summary> /// Get the spectra from the new quantification. /// </summary> /// <param name="result">The quantification result.</param> private void GetSpectra(QuantResult result) { // Get the cit spectrum ID int citSpectrumId = result.CitSpectrumID; foreach (var item in Quantification.loneCitSpecList) { if (item.ID == citSpectrumId) { citSpectrum = item; } } }
/// <summary> /// Quantification of citrullinations. /// </summary> /// <param name="resultsQuant">The list of quantification results.</param> private static void CitrullinationQuantification(List <QuantResult> resultsQuant) { // Loop through each of the citrullinted spectra foreach (KeyValuePair <XTSpectrum, XTSpectrum> kvp in citSpecSpecDict) { // Create an empty instance of quantification result QuantResult result = new QuantResult(); // Create two temporary variables for holding the extracted ion count for both citrulline and arginine double citXIC = 0; double argXIC = 0; // Loop through the input files and find the one that have the same input filename foreach (Input input in FileReader.inputFiles) { string inputFileName = input.FilePath.Split('\\').Last(); if (inputFileName == kvp.Key.OriginalFileName) { citXIC = CalculateExtractedIonCount(kvp.Key, citXIC, input); } if (inputFileName == kvp.Value.OriginalFileName) { argXIC = CalculateExtractedIonCount(kvp.Value, argXIC, input); } } // Add the data to the quantification result result.Protein = RemoveProteinDbPrefix(kvp.Key.Proteins[0].ProtLabel); result.Sequence = kvp.Key.Proteins[0].DoaminSeq; result.CitrullinatedExtractedIonCount = citXIC; result.ArginineExtractedIonCount = argXIC; result.CitPercent = citXIC / (citXIC + argXIC) * 100; result.ValidationBy = "Cit-paired"; result.CitFileName = kvp.Key.OriginalFileName; result.ArgFileName = kvp.Value.OriginalFileName; result.CitRetentionTime = kvp.Key.RetentionTime; result.ArgRetentionTime = kvp.Value.RetentionTime; result.CitCharge = kvp.Key.Charge; result.ArgCharge = kvp.Value.Charge; result.CitSpectrumID = kvp.Key.ID; result.ArgSpectrumID = kvp.Value.ID; result.Score = kvp.Key.CitScore; result.MatchScore = kvp.Value.MatchScore; // Add the result to the result list resultsQuant.Add(result); } }
/// <summary> /// Update the window /// </summary> /// <param name="result"></param> internal void UpdateWindow(QuantResult result) { _result = result; GetSpectra(_result); SetCitInfo(); ValidationUIUtilities.ClearChart(chartMS1); ValidationUIUtilities.ClearChart(chartMS2); ValidationUIUtilities.CreateMS1Chart(chartMS1, citSpectrum); ValidationUIUtilities.CreateLoneCitMs2Chart(chartMS2, citSpectrum); ValidationUIUtilities.FillIonGridGeneral(metroGridCitIons, citSpectrum, HelperUtilities.CreateAAArray(_result.Sequence)); if (Quantification.QuantificationResults.Contains(result)) { metroButtonAddQuant.Enabled = false; metroButtonRemoveQuant.Enabled = true; } else { metroButtonAddQuant.Enabled = true; metroButtonRemoveQuant.Enabled = false; } }
/// <summary> /// Quantification of lonely citrullinations. /// </summary> /// <param name="resultsQuant">The list of quantification results.</param> private static void LoneCitrullinationQunatification(List <QuantResult> resultsQuant) { // Loop through all of the lonely citrullination spectra foreach (XTSpectrum spectrum in loneCitSpecList) { // Create an empty instance of quantification result QuantResult result = new QuantResult(); // Calculate the extracted ion count for the spectrum // Create a placeholder variable for the extracted ion count double citXIC = 0; // Loop through the input files and find the one that have the same input filename foreach (Input input in FileReader.inputFiles) { string inputFileName = input.FilePath.Split('\\').Last(); if (inputFileName == spectrum.OriginalFileName) { citXIC = CalculateExtractedIonCount(spectrum, citXIC, input); } } // Add the data to the quantification result result.Protein = RemoveProteinDbPrefix(spectrum.Proteins[0].ProtLabel); result.Sequence = spectrum.Proteins[0].DoaminSeq; result.CitrullinatedExtractedIonCount = citXIC; result.ArginineExtractedIonCount = 0; result.CitPercent = 100; result.ValidationBy = "Lone"; result.CitFileName = spectrum.OriginalFileName; result.CitRetentionTime = spectrum.RetentionTime; result.ArgFileName = "NaN"; result.ArgRetentionTime = 0; result.CitCharge = spectrum.Charge; result.ArgCharge = 0; result.ArgSpectrumID = 0; result.CitSpectrumID = spectrum.ID; result.Score = spectrum.CitScore; result.MatchScore = 0; // Add the result to the result list resultsQuant.Add(result); } }
/// <summary> /// Update the quantification window. /// </summary> /// <param name="result">The quantification result.</param> internal void UpdateWindow(QuantResult result) { // Set the result _result = result; // Get the spectra GetSpectra(_result); // Add the info SetCitInfo(); SetArgInfo(); // Clear the charts ValidationUIUtilities.ClearChart(chartArgMS1); ValidationUIUtilities.ClearChart(chartCitMS1); ValidationUIUtilities.ClearChart(chartMS2); // Create the charts ValidationUIUtilities.CreateMS1Chart(chartArgMS1, argSpectrum); ValidationUIUtilities.CreateMS1Chart(chartCitMS1, citSpectrum); ValidationUIUtilities.CreatePairedMs2Chart(chartMS2, citSpectrum, argSpectrum); // Create the ion grid ValidationUIUtilities.FillIonGridGeneral(metroGridArgIons, argSpectrum, HelperUtilities.CreateAAArray(_result.Sequence)); ValidationUIUtilities.FillIonGridGeneral(metroGridCitIons, citSpectrum, HelperUtilities.CreateAAArray(_result.Sequence)); // Set the title and spectrum ID labelTitel.Text = string.Format("Quantification - Paired (By {0})", _result.ValidationBy); metroLabelCitSpectrumID.Text = _result.CitSpectrumID.ToString(); metroLabelArgSpectrumID.Text = _result.ArgSpectrumID.ToString(); if (Quantification.QuantificationResults.Contains(result)) { metroButtonAddQuant.Enabled = false; metroButtonRemoveQuant.Enabled = true; } else { metroButtonAddQuant.Enabled = true; metroButtonRemoveQuant.Enabled = false; } }
/// <summary> /// Create a new instance of <see cref="QuantificationLone"/>. /// </summary> /// <param name="result">The quantification result.</param> internal QuantificationLone(QuantResult result) { InitializeComponent(); UpdateWindow(result); }