Skip to content

Commit

Permalink
add TMT 18 and MGF levels functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishuges committed Feb 2, 2022
1 parent f2ee859 commit a3bf8e0
Show file tree
Hide file tree
Showing 20 changed files with 435 additions and 99 deletions.
7 changes: 2 additions & 5 deletions RawTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|Any CPU.ActiveCfg = Debug|x64
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|Any CPU.Build.0 = Debug|x64
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|x64.ActiveCfg = Debug|x64
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Debug|x64.Build.0 = Debug|x64
{A9BF3DB6-A6E6-4324-AA7A-625639C17E64}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -38,19 +38,16 @@ Global
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Debug|x64.ActiveCfg = Debug|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Debug|x64.Build.0 = Debug|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Release|Any CPU.Build.0 = Release|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Release|x64.ActiveCfg = Release|Any CPU
{BFF243DD-CEB4-489C-9726-9E5A6E9EB9AC}.Release|x64.Build.0 = Release|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Debug|x64.ActiveCfg = Debug|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Debug|x64.Build.0 = Debug|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Release|Any CPU.Build.0 = Release|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Release|x64.ActiveCfg = Release|Any CPU
{F399D28E-2751-4686-A61B-7710CDDB3114}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 5 additions & 1 deletion RawTools/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.AccessControl" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ThermoFisher.CommonCore.Data" publicKeyToken="1aef06afb5abd953" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.71" newVersion="5.0.0.71" />
</dependentAssembly>
</assemblyBinding>
<loadFromRemoteSources enabled="true" />
Expand Down
13 changes: 11 additions & 2 deletions RawTools/ArgumentParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static class ParserForRawTools
{
public static ClParser Create()
{
ClParser parser = new ClParser("Welcome to the main page for RawTools version 2.0.3a! RawTools is an " +
ClParser parser = new ClParser("Welcome to the main page for RawTools version 2.0.4! RawTools is an " +
"open-source and freely available package designed to perform scan data parsing and quantification, " +
"and quality control analysis of Thermo Orbitrap raw mass spectrometer files. RawTools uses the " +
"Thermo RawFileReader library (Copyright © 2016 by Thermo Fisher Scientific, Inc. All rights reserved). " +
Expand Down Expand Up @@ -64,7 +64,7 @@ public static ClParser Create()
parser.Add(new Argument(name: "LabelingReagent", shortArgument: "-r", longArgument: "-labellingreagent", required: false,
typeOf: typeof(string),
helpText: "Required for reporter ion quantification. Reagents used to label peptides, required if using quant option. " +
"Available options are: {TMT0, TMT2, TMT6, TMT10, TMT11, TMT16, iTRAQ4, iTRAQ8}."));
"Available options are: {TMT0, TMT2, TMT6, TMT10, TMT11, TMT16, TMT18, iTRAQ4, iTRAQ8}."));

parser.Add(new Argument(name: "UnlabeledQuant", shortArgument: "-u", longArgument: "-unlabeledquant", required: false,
typeOf: typeof(bool),
Expand All @@ -75,6 +75,12 @@ public static ClParser Create()
typeOf: typeof(bool),
helpText: "Writes a standard MGF file. To specify a mass cutoff use the -c argument."));

parser.Add(new Argument(name: "WriteMgfLevels", shortArgument: "-ml", longArgument: "-mgfLevels", required: false,
typeOf: typeof(string),
helpText: "Writes a standard MGF file for different scan levels. Should be in the format \"-mgfLevels [levels]\", " +
"where levels is the MS level (or a combination of levels). For example, to output MS2 and MS3 scans, you would " +
"invoke the command \"-mgfLevels 23\". Currently, only MS levels 1, 2, and 3 are supported."));

parser.Add(new Argument(name: "MgfMassCutoff", shortArgument: "-c", longArgument: "-masscutoff", required: false,
typeOf: typeof(float),
helpText: "Specify a mass cutoff to be applied when generating MGF files. " +
Expand Down Expand Up @@ -149,6 +155,9 @@ public static ClParser Create()
parser.Add(new Argument(name: "ExampleModifications", shortArgument: "-modifications", longArgument: "-examplemods", required: false, typeOf: typeof(bool),
helpText: "Displays example peptide modifications."));

parser.Add(new Argument(name: "VersionInfo", shortArgument: "-version", longArgument: "-version", required: false, typeOf: typeof(bool),
helpText: "Displays version details."));

parser.Add(new Argument(
name: "MaxProcesses",
shortArgument: "-k",
Expand Down
3 changes: 3 additions & 0 deletions RawTools/Data/Containers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ public LabelingReagents()
Reagents.Add("TMT16", (Labels: new string[] { "126", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N" },
Masses: new double[] { 126.127726, 127.124761, 127.131081, 128.128116, 128.134436, 129.131470, 129.137790, 130.134825, 130.141145, 131.138180, 131.144499, 132.141535, 132.147855, 133.14489, 133.15121, 134.148245 }));

Reagents.Add("TMT18", (Labels: new string[] { "126", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N", "134C", "135N" },
Masses: new double[] { 126.127726, 127.124761, 127.131081, 128.128116, 128.134436, 129.131470, 129.137790, 130.134825, 130.141145, 131.138180, 131.144499, 132.141535, 132.147855, 133.144890, 133.151210, 134.148245, 134.154565, 135.151600 }));

Reagents.Add("iTRAQ4", (Labels: new string[] { "114", "115", "116", "117" },
Masses: new double[] { 114.111228, 115.108263, 116.111618, 117.114973 }));

Expand Down
9 changes: 8 additions & 1 deletion RawTools/Examples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ namespace RawTools
{
class Examples
{
public static void VersionInfo()
{
StringBuilder examples = new StringBuilder();
examples.AppendLine("2.0.4");
Console.Write(examples);
}

public static void ExampleMods()
{
StringBuilder examples = new StringBuilder();
Expand All @@ -47,7 +54,7 @@ public static void ExampleMods()
examples.AppendFormat("\t{0,-40}{1,-10}\n", "TMT0 label at K or N-terminus:", "224.15247@K,224.15247@[");
examples.AppendFormat("\t{0,-40}{1,-10}\n", "TMT2 label at K or N-terminus:", "225.15583@K,225.15583@[");
examples.AppendFormat("\t{0,-40}{1,-10}\n", "TMT6+ label at K or N-terminus:", "229.16293@K,229.16293@[");
examples.AppendFormat("\t{0,-40}{1,-10}\n", "TMT16 label at K or N-terminus:", "304.2071@K,304.2071@[");
examples.AppendFormat("\t{0,-40}{1,-10}\n", "TMT16+ label at K or N-terminus:", "304.2071@K,304.2071@[");

examples.AppendLine("\nFor example, to specify fixed CamC, and variable oxidation of M and TMT10 quant labels, you would invoke the following arguments:");
examples.AppendLine("\t-fmods 57.02146@C -vmods 229.16293@[,229.16293@K,15.99491@M");
Expand Down
28 changes: 25 additions & 3 deletions RawTools/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ static void Main(string[] args)

var arguments = parser.Parse(args);

Run(arguments);
_ = Run(arguments);

Log.CloseAndFlush();
}

static int Run(Dictionary<string, object> opts)
{
if ((bool)opts["VersionInfo"] == true)
{
Examples.VersionInfo();
Environment.Exit(0);
}

if ((bool)opts["ExampleCommands"] == true)
{
Examples.CommandLineUsage();
Expand Down Expand Up @@ -173,10 +179,10 @@ static int Run(Dictionary<string, object> opts)

if (parameters.ParseParams.Quant)
{
List<string> possible = new List<string>() { "TMT0", "TMT2", "TMT6", "TMT10", "TMT11", "TMT16", "iTRAQ4", "iTRAQ8" };
List<string> possible = new List<string>() { "TMT0", "TMT2", "TMT6", "TMT10", "TMT11", "TMT16", "TMT18", "iTRAQ4", "iTRAQ8" };
if (!possible.Contains(parameters.ParseParams.LabelingReagents))
{
Console.WriteLine("ERROR: For quantification, the labeling reagent must be one of {TMT0, TMT2, TMT6, TMT10, TMT11, TMT16, iTRAQ4, iTRAQ8}");
Console.WriteLine("ERROR: For quantification, the labeling reagent must be one of {TMT0, TMT2, TMT6, TMT10, TMT11, TMT16, TMT18, iTRAQ4, iTRAQ8}");
Log.Error("Invalid labeling reagent provided: {0}", parameters.ParseParams.LabelingReagents);
//Console.Write("Press any key to exit...");
//Console.ReadKey();
Expand All @@ -200,6 +206,22 @@ static int Run(Dictionary<string, object> opts)
}
}

if (parameters.ParseParams.WriteMgfLevels != null)
{
List<string> possible = new List<string>() { "1", "2", "3" };
foreach (var x in parameters.ParseParams.WriteMgfLevels)
{
if (!possible.Contains(x.ToString()))
{
Console.WriteLine("ERROR: Incorrect format for -ml. See help.");
Log.Error("Invalid mgf levels argument provided: {WriteMgfLevels}", parameters.ParseParams.WriteMgfLevels);
//Console.Write("Press any key to exit...");
//Console.ReadKey();
return 1;
}
}
}

System.Diagnostics.Stopwatch singleFileTime = new System.Diagnostics.Stopwatch();
System.Diagnostics.Stopwatch totalTime = new System.Diagnostics.Stopwatch();
totalTime.Start();
Expand Down
2 changes: 1 addition & 1 deletion RawTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("15.1.2019.0")]

[assembly: AssemblyInformationalVersion("2.0.3a")]
[assembly: AssemblyInformationalVersion("2.0.4")]
45 changes: 26 additions & 19 deletions RawTools/RawTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,26 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CLParserForNetFramework">
<HintPath>..\..\..\softwareRepository\CLParser\CLParserForNetFramework\CLParserForNetFramework\bin\Release\CLParserForNetFramework.dll</HintPath>
<HintPath>..\..\rawtoolsDevPackages\CLParserForNetFramework\CLParserForNetFramework\bin\Release\CLParserForNetFramework.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="OxyPlot, Version=2.0.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.Core.2.0.0\lib\net45\OxyPlot.dll</HintPath>
<Reference Include="OpenMcdf, Version=2.2.1.9, Culture=neutral, PublicKeyToken=fdbb1629d7c00800, processorArchitecture=MSIL">
<HintPath>..\packages\OpenMcdf.2.2.1.9\lib\net40\OpenMcdf.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.WindowsForms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=245eacd6b5d2d338, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.WindowsForms.2.0.0\lib\net45\OxyPlot.WindowsForms.dll</HintPath>
<Reference Include="OpenMcdf.Extensions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=fdbb1629d7c00800, processorArchitecture=MSIL">
<HintPath>..\packages\OpenMcdf.Extensions.2.2.1.4\lib\net40\OpenMcdf.Extensions.dll</HintPath>
</Reference>
<Reference Include="OxyPlot, Version=2.1.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.Core.2.1.0\lib\net45\OxyPlot.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.WindowsForms, Version=2.1.0.0, Culture=neutral, PublicKeyToken=245eacd6b5d2d338, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.WindowsForms.2.1.0\lib\net45\OxyPlot.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.2.10.0\lib\net46\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.File, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.Sinks.File.4.1.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
<Reference Include="Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.Sinks.File.5.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
Expand All @@ -109,32 +115,33 @@
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
<Reference Include="System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\rawtoolsDevPackages\CLParserForNetFramework\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="ThermoFisher.CommonCore.BackgroundSubtraction, Version=5.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.BackgroundSubtraction.5.0.0.7\lib\netstandard2.0\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.BackgroundSubtraction, Version=5.0.0.71, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.BackgroundSubtraction.5.0.0.71\lib\netstandard2.0\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.7\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.71, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.71\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator, Version=5.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.MassPrecisionEstimator.5.0.0.7\lib\netstandard2.0\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator, Version=5.0.0.71, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.MassPrecisionEstimator.5.0.0.71\lib\netstandard2.0\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.0, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.7\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.71, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.71\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions RawTools/WorkFlows/DDA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ public static void UniversalDDA(IRawFileThreadManager rawFileThreadManager, Work
MgfWriter.WriteMGF(staticRawFile.FileName, centroidStreams, segmentScans, parameters, retentionTimes, precursorMasses, precursorScans, trailerExtras, methodData, Index);
}

if (parameters.ParseParams.WriteMgfLevels != null)
{
MgfLevelsWriter.WriteLevelsMgf(staticRawFile.FileName, centroidStreams, segmentScans, parameters, retentionTimes, precursorMasses, precursorScans, trailerExtras, methodData, Index);
}

if (parameters.ParseParams.Chromatogram != null)
{
ChromatogramWriter.WriteChromatogram(centroidStreams, segmentScans, retentionTimes, methodData, Index, parameters, staticRawFile.FileName);
Expand Down
Loading

0 comments on commit a3bf8e0

Please sign in to comment.