public void LoadData(IMatrixData mdata, Parameters parameters, ref IMatrixData[] supplTables, ref IDocumentData[] documents, ProcessInfo processInfo) { PerseusLoadMatrixParam par = (PerseusLoadMatrixParam)parameters.GetParam("File"); string filename = par.Filename; if (string.IsNullOrEmpty(filename)) { processInfo.ErrString = "Please specify a filename"; return; } if (!File.Exists(filename)) { processInfo.ErrString = "File '" + filename + "' does not exist."; return; } string ftl = filename.ToLower(); bool csv = ftl.EndsWith(".csv") || ftl.EndsWith(".csv.gz"); char separator = csv ? ',' : '\t'; string[] colNames; Dictionary <string, string[]> annotationRows = new Dictionary <string, string[]>(); try{ colNames = TabSep.GetColumnNames(filename, PerseusUtils.commentPrefix, PerseusUtils.commentPrefixExceptions, annotationRows, separator); } catch (Exception) { processInfo.ErrString = "Could not open the file '" + filename + "'. It is probably opened in another program."; return; } string origin = filename; int[] eInds = par.MainColumnIndices; int[] nInds = par.NumericalColumnIndices; int[] cInds = par.CategoryColumnIndices; int[] tInds = par.TextColumnIndices; int[] mInds = par.MultiNumericalColumnIndices; List <Tuple <Relation[], int[], bool> > filters = new List <Tuple <Relation[], int[], bool> >(); string errString; foreach (Parameters p in par.MainFilterParameters) { PerseusUtils.AddFilter(filters, p, eInds, out errString); if (errString != null) { processInfo.ErrString = errString; return; } } foreach (Parameters p in par.NumericalFilterParameters) { PerseusUtils.AddFilter(filters, p, nInds, out errString); if (errString != null) { processInfo.ErrString = errString; return; } } int nrows = GetRowCount(filename, eInds, filters, separator); StreamReader reader = FileUtils.GetReader(filename); StreamReader auxReader = FileUtils.GetReader(filename); PerseusUtils.LoadMatrixData(annotationRows, eInds, cInds, nInds, tInds, mInds, processInfo, colNames, mdata, reader, auxReader, nrows, origin, separator, par.ShortenExpressionColumnNames, filters); reader.Close(); auxReader.Close(); GC.Collect(); }