Skip to content

Commit

Permalink
json pretty print and other small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nielshulstaert committed Feb 6, 2020
1 parent 89136bd commit a6f8e37
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 314 deletions.
29 changes: 14 additions & 15 deletions MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private static void XicParametersParsing(string[] args)

if (parameters.help)
{
ShowHelp("usage is (use -option=value for the optional arguments):", null,
ShowHelp("usage is:", null,
optionSet);
return;
}
Expand Down Expand Up @@ -184,19 +184,19 @@ private static void XicParametersParsing(string[] args)
}
catch (OptionException optionException)
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", optionException,
ShowHelp("Error - usage is:", optionException,
optionSet);
}
catch (ArgumentNullException)
{
if (parameters.help)
{
ShowHelp("usage is (use -option=value for the optional arguments):", null,
ShowHelp("usage is:", null,
optionSet);
}
else
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", null,
ShowHelp("Error - usage is:", null,
optionSet);
}
}
Expand Down Expand Up @@ -274,7 +274,7 @@ private static void SpectrumQueryParametersParsing(string[] args)

if (parameters.help)
{
ShowHelp("usage is (use -option=value for the optional arguments):", null,
ShowHelp("usage is:", null,
optionSet);
return;
}
Expand Down Expand Up @@ -302,19 +302,19 @@ private static void SpectrumQueryParametersParsing(string[] args)
}
catch (OptionException optionException)
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", optionException,
ShowHelp("Error - usage is:", optionException,
optionSet);
}
catch (ArgumentNullException)
{
if (parameters.help)
{
ShowHelp("usage is (use -option=value for the optional arguments):", null,
ShowHelp("usage is:", null,
optionSet);
}
else
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", null,
ShowHelp("Error - usage is:", null,
optionSet);
}
}
Expand Down Expand Up @@ -451,10 +451,9 @@ private static void RegularParametersParsing(string[] args)

if (help)
{
string helpmessage = String.Format("usage is {0} [subcommand] [options]\nsubcommand is xic|query\n",
Assembly.GetExecutingAssembly().GetName().Name);
ShowHelp(helpmessage +
"(use -option=value for the optional arguments):", null,
var helpMessage =
$"usage is {Assembly.GetExecutingAssembly().GetName().Name}.exe [subcommand] [options]\noptional subcommands are xic|query (use [subcommand] -h for more info]):";
ShowHelp(helpMessage, null,
optionSet);
return;
}
Expand Down Expand Up @@ -660,19 +659,19 @@ private static void RegularParametersParsing(string[] args)
}
catch (OptionException optionException)
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", optionException,
ShowHelp("Error - usage is:", optionException,
optionSet);
}
catch (ArgumentNullException)
{
if (help)
{
ShowHelp("usage is (use -option=value for the optional arguments):", null,
ShowHelp("usage is:", null,
optionSet);
}
else
{
ShowHelp("Error - usage is (use -option=value for the optional arguments):", null,
ShowHelp("Error - usage is:", null,
optionSet);
}
}
Expand Down
10 changes: 5 additions & 5 deletions Query/PROXISpectrum.cs → Query/ProxiSpectrum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@

namespace ThermoRawFileParser.Query
{
public class PROXISpectrum
public class ProxiSpectrum
{
public List<double> mzs { get; set; }
public List<double> intensities { get; set; }
public List<PROXICVTerm> attributes { get; set; }
public List<ProxiCvTerm> attributes { get; set; }

public PROXISpectrum()
public ProxiSpectrum()
{
mzs = new List<double>();
intensities = new List<double>();
attributes = new List<PROXICVTerm>();
attributes = new List<ProxiCvTerm>();
}

public void AddAttribute(string accession=null, string cvGroup=null, string name=null, string value=null, string valueAccession=null)
{
attributes.Add(new PROXICVTerm(accession, cvGroup, name, value, valueAccession));
attributes.Add(new ProxiCvTerm(accession, cvGroup, name, value, valueAccession));
}

public void AddMz(IList<double> mzList)
Expand Down
Loading

0 comments on commit a6f8e37

Please sign in to comment.