Example program for retrieving input spectrum data.
using System;
using matrix_science.msparser;
namespace MsParserExamples
{
public class resfile_input
{
public static void Main(string[] argv)
{
if (argv.Length < 1)
{
Console.WriteLine("Must specify results filename as parameter");
return;
}
ms_mascotresfilebase file = ms_mascotresfilebase.createResfile(argv[0], 0, "");
if (file.isValid())
{
inputData(file);
}
else
{
Console.WriteLine("Error number: {0}", file.getLastError());
Console.WriteLine("Error string: {0}", file.getLastErrorString());
return;
}
}
private static void inputData(ms_mascotresfilebase file)
{
int i, j, num_peaks;
for (i = 1; i <= 1; i++)
{
Console.WriteLine("Input data for query number {0}", i);
Console.WriteLine("=========================================");
ms_inputquery q = new ms_inputquery(file, i);
Console.WriteLine(" title : {0}", q.getStringTitle(true));
Console.WriteLine(" mass_min : {0}", q.getMassMin());
Console.WriteLine(" mass_max : {0}", q.getMassMax());
Console.WriteLine(" int_min : {0}", q.getIntMin());
Console.WriteLine(" int_max : {0}", q.getIntMax());
Console.WriteLine(" num_vals : {0}", q.getNumVals());
Console.WriteLine(" num_used1 : {0}", q.getNumUsed());
Console.WriteLine(" ions1 : {0}", q.getStringIons1());
Console.WriteLine(" ions2 : {0}", q.getStringIons2());
Console.WriteLine(" ions3 : {0}", q.getStringIons3());
Console.WriteLine(" peptol : {0}", q.getPepTol());
Console.WriteLine(" peptol units: {0}", q.getPepTolUnits());
Console.WriteLine(" peptol str : {0}", q.getPepTolString());
Console.WriteLine(" INSTRUMENT : {0}", q.getINSTRUMENT());
Console.WriteLine(" RULES : {0}", q.getRULES());
Console.WriteLine(" IT_MODS : {0}", q.getIT_MODS());
Console.WriteLine(" repeat srch : {0}", file.getRepeatSearchString(i));
num_peaks = q.getNumberOfPeaks(1);
for (j = 1; j <= num_peaks; j++)
{
Console.WriteLine("{0:#}, {1:#}",q.getPeakMass(1,j), q.getPeakIntensity(1,j));
}
}
}
}
}