-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated to MzLib 1.0.548 and fixed custom ions in search tasks * reverted calibration task change * merged in master bbbyy * Spectral Library from Command Line (#2386) * Updated to MzLib 1.0.548 and fixed custom ions in search tasks * reverted calibration task change * merged in master bbbyy * Enabled Library Loading from command line * Started Analyte Type Basics * replaced all strings in PostSearchAnalysisTask with analyte type references * Started Analyte Type Basics * replaced all strings in PostSearchAnalysisTask with analyte type references * Update ResultsDictionary keys and status messages Modified ResultsDictionary keys to use plural forms of analyte type labels by appending 's'. Updated status message for writing unique form results to use lowercase version of UniqueFormLabel. * Started Analyte Type Basics * replaced all strings in PostSearchAnalysisTask with analyte type references * Update ResultsDictionary keys and status messages Modified ResultsDictionary keys to use plural forms of analyte type labels by appending 's'. Updated status message for writing unique form results to use lowercase version of UniqueFormLabel. * Converted the AnalyteType to an enum * Added tests for the analyte type extensions * Added test case for the tostring * Removed ToString() from analyte type as it was never used --------- Co-authored-by: Nic Bollis <nbollis@wisc.edu> Co-authored-by: trishorts <mshort@chem.wisc.edu>
- Loading branch information
1 parent
b82cfaf
commit a06bc0d
Showing
8 changed files
with
137 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace EngineLayer | ||
{ | ||
public enum AnalyteType | ||
{ | ||
Peptide, | ||
Proteoform, | ||
Oligo | ||
} | ||
|
||
/// <summary> | ||
/// Accessor methods for specific information about certain analyte types | ||
/// </summary> | ||
public static class AnalyteTypeExtensions | ||
{ | ||
private static readonly Dictionary<AnalyteType, AnalyteTypeData> AnalyteTypes = new() | ||
{ | ||
{ AnalyteType.Peptide, new AnalyteTypeData("PSM", "Peptide", "Protein", "psmtsv") }, | ||
{ AnalyteType.Proteoform, new AnalyteTypeData("PSM", "Proteoform", "Protein", "psmtsv") }, | ||
{ AnalyteType.Oligo, new AnalyteTypeData("OSM", "Oligo", "Transcript", "osmtsv") }, | ||
}; | ||
|
||
public static string GetSpectralMatchLabel(this AnalyteType analyteType) => AnalyteTypes[analyteType].SpectralMatchLabel; | ||
public static string GetSpectralMatchExtension(this AnalyteType analyteType) => AnalyteTypes[analyteType].SpectralMatchExtension; | ||
public static string GetUniqueFormLabel(this AnalyteType analyteType) => AnalyteTypes[analyteType].UniqueFormLabel; | ||
public static string GetBioPolymerLabel(this AnalyteType analyteType) => AnalyteTypes[analyteType].BioPolymerLabel; | ||
} | ||
|
||
/// <summary> | ||
/// Represents an analyte type and is used to determine the output format of the analyte type. | ||
/// </summary> | ||
internal class AnalyteTypeData(string spectralMatchLabel, string uniqueFormLabel, string bioPolymerLabel, string spectralMatchExtension) | ||
{ | ||
/// <summary> | ||
/// Gets or sets the label for spectral matches (e.g. PSM). | ||
/// </summary> | ||
internal string SpectralMatchLabel { get; init; } = spectralMatchLabel; | ||
|
||
/// <summary> | ||
/// Extension for spectral matches (e.g. psmtsv). | ||
/// </summary> | ||
internal string SpectralMatchExtension { get; init; } = spectralMatchExtension; | ||
|
||
/// <summary> | ||
/// Gets or sets the label for unique forms (e.g. Peptide). | ||
/// </summary> | ||
internal string UniqueFormLabel { get; init; } = uniqueFormLabel; | ||
|
||
/// <summary> | ||
/// Gets or sets the label for grouped forms (e.g. Protein). | ||
/// </summary> | ||
internal string BioPolymerLabel { get; init; } = bioPolymerLabel; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.