Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyte type #2434

Merged
merged 37 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8be2574
Updated to MzLib 1.0.548 and fixed custom ions in search tasks
nbollis May 21, 2024
a00af8a
reverted calibration task change
nbollis May 21, 2024
22c60ba
merged in master
nbollis May 30, 2024
f4695bb
merged in master bbbyy
nbollis Jun 10, 2024
d4f8b9d
Merge branch 'smith-chem-wisc:master' into master
nbollis Jun 19, 2024
1f0dc48
merged in master
nbollis Jun 21, 2024
5c0268b
idkman
nbollis Jul 3, 2024
b7e6a0f
merged in master
nbollis Jul 16, 2024
6446d89
Merge remote-tracking branch 'upstream/master'
nbollis Jul 24, 2024
322235d
Spectral Library from Command Line (#2386)
nbollis Jul 23, 2024
8b48c95
merged in master
nbollis Aug 6, 2024
2ef973f
Merge branch 'master' of https://github.com/nbollis/MetaMorpheus
nbollis Aug 6, 2024
0abcd9b
Merge branch 'master' of https://github.com/nbollis/MetaMorpheus
nbollis Aug 7, 2024
f9030f9
merged in master
nbollis Sep 4, 2024
046067e
merged in master
nbollis Sep 17, 2024
c38f081
Merge remote-tracking branch 'upstream/master'
nbollis Oct 3, 2024
0c04007
Merge remote-tracking branch 'upstream/master'
nbollis Oct 10, 2024
d66bf7b
Merge remote-tracking branch 'upstream/master'
Oct 18, 2024
0a34ddf
Started Analyte Type Basics
Oct 18, 2024
95ccaf7
replaced all strings in PostSearchAnalysisTask with analyte type refe…
Oct 18, 2024
4b121f5
Started Analyte Type Basics
Oct 18, 2024
d2d7cfd
replaced all strings in PostSearchAnalysisTask with analyte type refe…
Oct 18, 2024
a68a906
Update ResultsDictionary keys and status messages
nbollis Nov 7, 2024
325f643
Started Analyte Type Basics
Oct 18, 2024
4be1f56
replaced all strings in PostSearchAnalysisTask with analyte type refe…
Oct 18, 2024
683f8d0
Update ResultsDictionary keys and status messages
nbollis Nov 7, 2024
7b234da
Converted the AnalyteType to an enum
nbollis Nov 13, 2024
4240c90
Merged in master
nbollis Nov 13, 2024
b6b9ffb
Merged in master
nbollis Nov 13, 2024
268744d
merge?
nbollis Nov 13, 2024
1550098
Merge branch 'master' into AnalyteType
nbollis Nov 13, 2024
ce58c66
Added tests for the analyte type extensions
nbollis Nov 13, 2024
ddf8912
Merge branch 'AnalyteType' of https://github.com/nbollis/MetaMorpheus…
nbollis Nov 13, 2024
ff507be
Added test case for the tostring
nbollis Nov 13, 2024
36cb4e3
merge
Nov 14, 2024
135d908
Removed ToString() from analyte type as it was never used
Nov 14, 2024
3f499cf
Merge branch 'master' into AnalyteType
trishorts Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions MetaMorpheus/EngineLayer/AnalyteType.cs
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;
}
}

4 changes: 2 additions & 2 deletions MetaMorpheus/EngineLayer/GlobalVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static class GlobalVariables
private static char[] _InvalidAminoAcids;

// this affects output labels, etc. and can be changed to "Proteoform" for top-down searches
public static string AnalyteType;
public static AnalyteType AnalyteType;

public static List<string> ErrorsReadingMods;

Expand Down Expand Up @@ -65,7 +65,7 @@ public static void SetUpGlobalVariables()
Loaders.LoadElements();
AcceptedDatabaseFormats = new List<string> { ".fasta", ".fa", ".xml", ".msp" };
AcceptedSpectraFormats = new List<string> { ".raw", ".mzml", ".mgf" };
AnalyteType = "Peptide";
AnalyteType = AnalyteType.Peptide;
_InvalidAminoAcids = new char[] { 'X', 'B', 'J', 'Z', ':', '|', ';', '[', ']', '{', '}', '(', ')', '+', '-' };
ExperimentalDesignFileName = "ExperimentalDesign.tsv";
SeparationTypes = new List<string> { { "HPLC" }, { "CZE" } };
Expand Down
3 changes: 3 additions & 0 deletions MetaMorpheus/MetaMorpheus.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Analyte/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Calib/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=coisolation/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=crosslinked/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -20,9 +21,11 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nterm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ogly/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=oglyco/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Oligo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phospho/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=prot/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=proteingroup/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Proteoform/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=psmtsv/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pwsm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Silac/@EntryIndexedValue">True</s:Boolean>
Expand Down
4 changes: 2 additions & 2 deletions MetaMorpheus/TaskLayer/MetaMorpheusTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,11 +1143,11 @@ public static void DetermineAnalyteType(CommonParameters commonParameters)
&& commonParameters.DigestionParams.Protease != null
&& commonParameters.DigestionParams.Protease.Name == "top-down")
{
GlobalVariables.AnalyteType = "Proteoform";
GlobalVariables.AnalyteType = AnalyteType.Proteoform;
}
else
{
GlobalVariables.AnalyteType = "Peptide";
GlobalVariables.AnalyteType = AnalyteType.Peptide;
}
}

Expand Down
Loading
Loading