Read in the taxonomy file.
using System;
using matrix_science.msparser;
namespace MsParserExamples
{
public class config_taxonomy
{
public static void Main(string[] argv)
{
if (argv.Length < 1)
{
Console.WriteLine(@"The location of the taxonomy file has to be specified as a parameter
The location should either be the full path to the taxonomy file
or a URL to a Mascot server - e.g. http://mascot-server/mascot/cgi.
A Mascot security sessionID can optionally be passed as a second
parameter");
return;
}
ms_taxonomyfile file;
if (argv.Length > 1)
{
ms_connection_settings cs = new ms_connection_settings();
cs.setProxyServerType(ms_connection_settings.PROXY_TYPE.PROXY_TYPE_AUTO);
cs.setSessionID(argv[1]);
file = new ms_taxonomyfile(argv[0], cs);
}
else
{
file = new ms_taxonomyfile(argv[0]);
}
if (!file.isValid())
{
Console.WriteLine("There are errors. Cannot continue. The last error description:");
Console.WriteLine(file.getLastErrorString());
return;
}
int n = file.getNumberOfEntries();
Console.WriteLine("There are {0} taxonomy choice entries configured:", n);
for (int i = 0; i < n; i++)
{
Console.WriteLine(file.getEntryByNumber(i).getTitle());
Console.Write("Include: ");
for (int j = 0; j < file.getEntryByNumber(i).getNumberOfIncludeTaxonomies(); j++)
{
if (j > 0) Console.Write(",");
Console.Write(file.getEntryByNumber(i).getIncludeTaxonomy(j));
}
Console.WriteLine();
Console.Write("Exclude: ");
for (int j = 0; j < file.getEntryByNumber(i).getNumberOfExcludeTaxonomies(); j++)
{
if (j > 0) Console.Write(",");
Console.Write(file.getEntryByNumber(i).getExcludeTaxonomy(j));
}
Console.WriteLine();
}
}
}
}