private void AddButtonOnClick(object sender, EventArgs eventArgs)
        {
            DataRow2 row = table.NewRow();

            row["Internal label"]           = "";
            row["Terminal label"]           = "";
            row["Correction factor -2 [%]"] = 0d;
            row["Correction factor -1 [%]"] = 0d;
            row["Correction factor +1 [%]"] = 0d;
            row["Correction factor +2 [%]"] = 0d;
            row["TMT like"] = true;
            table.AddRow(row);
            tableView1.Invalidate(true);
        }
        private void AddFastaFile(string fileName, string identifierRule, string descriptionRule, string taxonomyRule,
                                  string taxonomyId, string variationRule, string modificationRule)
        {
            DataRow2 row = table.NewRow();

            row["Fasta file path"]  = fileName;
            row["Exists"]           = File.Exists(fileName).ToString();
            row["Identifier rule"]  = identifierRule;
            row["Description rule"] = descriptionRule;
            row["Taxonomy rule"]    = taxonomyRule;
            row["Taxonomy ID"]      = taxonomyId;
            row["Organism"]         = "";
            bool success = int.TryParse(taxonomyId, out int taxId);

            if (success && TaxonomyItems.taxId2Item.ContainsKey(taxId))
            {
                string n = TaxonomyItems.taxId2Item[taxId].GetScientificName();
                row["Organism"] = n;
            }
            if (hasVariationData)
            {
                row["Variation rule"] = variationRule;
            }
            if (hasModifications)
            {
                row["Modification rule"] = modificationRule;
            }
            table.AddRow(row);
        }
예제 #3
0
 private ITableModel CreateTable(string[] parseRules, string[] descriptions)
 {
     table = new DataTable2("parse rules");
     table.AddColumn("Parse rule", 90, ColumnType.Text);
     table.AddColumn("Description", 170, ColumnType.Text);
     for (int i = 0; i < parseRules.Length; i++)
     {
         DataRow2 row = table.NewRow();
         row[0] = parseRules[i];
         row[1] = descriptions[i];
         table.AddRow(row);
     }
     return(table);
 }
예제 #4
0
        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);
        }
예제 #5
0
        private ITableModel CreateSearchResultsTable(IList <int> searchInds, IList <int[]> matchingCols)
        {
            DataTable2 table = new DataTable2("Search results", "Search results");

            table.AddColumn("Row", 100, ColumnType.Integer, "");
            table.AddColumn("Column", 80, ColumnType.Text, "");
            for (int index = 0; index < searchInds.Count; index++)
            {
                int searchInd = searchInds[index];
                for (int i = 0; i < matchingCols[index].Length; i++)
                {
                    string   colName = tableModel.GetColumnName(matchingCols[index][i]);
                    DataRow2 row     = table.NewRow();
                    row["Row"]    = searchInd + 1;
                    row["Column"] = colName;
                    table.AddRow(row);
                }
            }
            return(table);
        }
예제 #6
0
        private ITableModel CreateTable(IList <int> searchInds, IList <int[]> matchingCols)
        {
            DataTable2 table = new DataTable2("Search results", "Search results");

            table.AddColumn("Row", 100, ColumnType.Integer, "");
            table.AddColumn("Columns", 80, ColumnType.Text, "");
            for (int index = 0; index < searchInds.Count; index++)
            {
                int      searchInd = searchInds[index];
                DataRow2 row       = table.NewRow();
                row["Row"] = searchInd + 1;
                string[] colNames = new string[matchingCols[index].Length];
                for (int i = 0; i < matchingCols[index].Length; i++)
                {
                    colNames[i] = tableModel.GetColumnName(matchingCols[index][i]);
                }
                row["Columns"] = StringUtils.Concat(";", colNames);
                table.AddRow(row);
            }
            return(table);
        }