Check compatibility of seed ID pairs in input rows
Source:R/RefactorPriorKnoweldge.R
seed_id_compatibility_check.RdCreates a long-format permutation table where each row represents one unique unordered pair of seed IDs from the same input row, then flags whether each pair is compatible via direct or secondary graph connections.
Arguments
- data
Data frame with zero or more of the columns
HMDB,KEGG,CHEBI, andPUBCHEM. Column names are matched case-insensitively against these exact names.- id_types
Character vector of ID types to use. Choose from
HMDB,KEGG,CHEBI, andPUBCHEM.- delimiter
Character string indicating whether multiple IDs within one cell are separated by semicolons or commas. Accepted values are
";",",","semicolon", or"comma".- verbose
Logical; if
TRUE, prints pairwise mapping and edge construction diagnostics to the console.- edge_table
Optional precomputed bidirectional edge table with columns
id1,type1,id2,type2. IfNULL, the table is built internally.
Value
Named list with two data frames:
- ID_pair_compatibility
Long-format table with one unique unordered seed-ID pair per input row. The first column
original_row_idstores the original input row name. The table also includespair_compatible,compatibility_path(direct,secondary,no_match), and groupedall_seed_ids_compatible.- data_with_compatibility
Original input data with appended
all_seed_ids_compatibleper input row (rows with fewer than two seed IDs areTRUE).