Example program for retrieving search parameter data.
using System;
using matrix_science.msparser;
namespace MsParserExamples
{
public class resfile_params
{
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())
{
searchParameters(file);
}
else
{
Console.WriteLine("Error number: {0}", file.getLastError());
Console.WriteLine("Error string: {0}", file.getLastErrorString());
return;
}
}
private static void searchParameters(ms_mascotresfilebase file)
{
int i;
char ch;
ms_searchparams p = file._params();
Console.WriteLine("Search parameters from ms_searchparams");
Console.WriteLine("=========================================");
Console.WriteLine("License : {0}", p.getLICENSE());
Console.WriteLine("Search title : {0}", p.getCOM());
Console.WriteLine("SEG mass : {0}", p.getSEG());
Console.WriteLine("Peptide tol : {0}", p.getTOL());
Console.WriteLine("Peptide tol units : {0}", p.getTOLU());
Console.WriteLine("Fragment tol : {0}", p.getITOL());
Console.WriteLine("Fragment tol units : {0}", p.getITOLU());
Console.WriteLine("Missed cleavages : {0}", p.getPFA());
Console.WriteLine("Database : {0}", p.getDB());
Console.WriteLine("Static mods : {0}", p.getMODS());
Console.WriteLine("Average/monoisotopic: {0}", p.getMASS());
Console.WriteLine("Enzyme : {0}", p.getCLE());
Console.WriteLine("Raw data file name : {0}", p.getFILENAME());
Console.WriteLine("Input data : {0}", p.getQUE());
Console.WriteLine("Type of search : {0}", p.getSEARCH());
Console.WriteLine("User name : {0}", p.getUSERNAME());
Console.WriteLine("User email : {0}", p.getUSEREMAIL());
Console.WriteLine("Charge state : {0}", p.getCHARGE());
Console.WriteLine("Repeat searhc file : {0}", p.getINTERMEDIATE());
Console.WriteLine("Num hits to display : {0}", p.getREPORT());
Console.WriteLine("Show overview : {0}", ((p.getOVERVIEW()) ? 1 : 0));
Console.WriteLine("Data file format : {0}", p.getFORMAT());
Console.WriteLine("Form version : {0}", p.getFORMVER());
Console.WriteLine("Variable mods : {0}", p.getIT_MODS());
for (i = 0; i <= 12; i++)
{
Console.WriteLine("User{0} : {1}", "" + i.ToString("D2"), p.getUSERField(i));
}
Console.WriteLine("Precursor mass : {0:#}", p.getPRECURSOR());
Console.WriteLine("Taxonomy filter : {0}", p.getTAXONOMY());
Console.WriteLine("Type of report : {0}", p.getREPTYPE());
Console.WriteLine("Accessions to search: {0}", p.getACCESSION());
Console.WriteLine("Subcluster used : {0}", p.getSUBCLUSTER());
Console.WriteLine("ICAT search? : {0}", ((p.getICAT()) ? 1 : 0));
Console.WriteLine("Instrument type : {0}", p.getINSTRUMENT());
Console.WriteLine("Error tolerant? : {0}", ((p.getERRORTOLERANT()) ? 1 : 0));
Console.WriteLine("Rules (ions series) : {0}", p.getRULES());
Console.WriteLine("Quantitation method : {0}", p.getQUANTITATION());
Console.WriteLine("Peptide isotope err : {0}", p.getPEP_ISOTOPE_ERROR());
Console.WriteLine("Decoy database : {0}", p.getDECOY());
for (ch = 'A'; ch <= 'Z'; ch++)
{
Console.WriteLine("Residue {0} : {1:#}", ch, p.getResidueMass(ch));
}
Console.WriteLine("C terminus mass : {0:#}", p.getCTermMass());
Console.WriteLine("N terminus mass : {0:#}", p.getNTermMass());
Console.WriteLine("Mass of hydrogen : {0:#}", p.getHydrogenMass());
Console.WriteLine("Mass of oxygen : {0:#}", p.getOxygenMass());
Console.WriteLine("Mass of carbon : {0:#}", p.getCarbonMass());
Console.WriteLine("Mass of nitrogen : {0:#}", p.getNitrogenMass());
Console.WriteLine("Mass of electron : {0:#}", p.getElectronMass());
i = 1;
while (p.getVarModsName(i).Length > 0)
{
Console.WriteLine("Variable mod name : {0}", p.getVarModsName(i));
Console.WriteLine("Variable mod delta : {0:#}", p.getVarModsDelta(i));
Console.WriteLine("Variable mod neutral: {0:#}", p.getVarModsNeutralLoss(i));
i++;
}
Console.WriteLine();
}
}
}