private void SetDefaults(IsobaricLabelingDefault def) { table.Clear(); for (int i = 0; i < def.Count; i++) { DataRow2 row = table.NewRow(); row[0] = def.GetInternalLabel(i); row[1] = def.GetTerminalLabel(i); row[2] = 0d; row[3] = 0d; row[4] = 0d; row[5] = 0d; row[6] = def.IsLikelyTmtLike(i); table.AddRow(row); } tableView1.Invalidate(true); }
private void TestFile(int minEntry, int maxEntry) { Regex nameRegex = !string.IsNullOrEmpty(identifierParseRule) ? new Regex(identifierParseRule) : null; Regex descriptionRegex = !string.IsNullOrEmpty(descriptionParseRule) ? new Regex(descriptionParseRule) : null; Regex taxonomyRegex = !string.IsNullOrEmpty(taxonomyParseRule) ? new Regex(taxonomyParseRule) : null; Regex variationRegex = !string.IsNullOrEmpty(variationParseRule) ? new Regex(variationParseRule) : null; Regex modificationRegex = !string.IsNullOrEmpty(modificationParseRule) ? new Regex(modificationParseRule) : null; string[] headers; string[] sequences; GetDataFromFile(filePath, minEntry, maxEntry, out headers, out sequences); tableModel.Clear(); for (int i = 0; i < headers.Length; i++) { DataRow2 r = tableModel.NewRow(); string header = headers[i]; r["Sequence"] = sequences[i]; r["Header"] = header; if (nameRegex != null) { r["Identifier"] = nameRegex.Match(header).Groups[1].ToString(); } if (descriptionRegex != null) { r["Description"] = descriptionRegex.Match(header).Groups[1].ToString(); } if (taxonomyRegex != null) { r["Taxonomy ID"] = taxonomyRegex.Match(header).Groups[1].ToString(); } if (variationRegex != null) { r["Variation"] = variationRegex.Match(header).Groups[1].ToString(); } if (modificationRegex != null) { r["Modification"] = modificationRegex.Match(header).Groups[1].ToString(); } tableModel.AddRow(r); } mainTable.Invalidate(true); }