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.- handle_partially_compatible
Logical; if
TRUE, partially compatible features are cleaned by retaining only IDs from compatible pairs.- handle_completely_incompatible
Logical; if
TRUE, completely incompatible features are cleaned by retaining a single ID according tocompletely_incompatible_priority.- completely_incompatible_priority
Character vector defining the namespace priority for resolving completely incompatible features. Supported values are
HMDB,KEGG,CHEBI, andPUBCHEM. The default priority isc("HMDB", "CHEBI", "PUBCHEM", "KEGG").
Value
Named list with at least five 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).- feature_compatibility_summary
One row per input feature summarizing compatibility counts and assigning
fully_compatible,partially_compatible, orcompletely_incompatible.- data_after_handling
Feature-level table after optional automatic handling. If no handling is enabled, this matches the raw feature-level output aside from added summary columns.
- ID_pair_compatibility_after_handling
Pair-level compatibility table recomputed from
data_after_handling.
If either handling option is enabled, the return object also includes handling_summary_text and handling_summary_metrics.