Skip to contents

Pure, and it exists because of a real and quiet failure.

Usage

string_reconcile_edges(edges, id_map)

Arguments

edges

An edge tibble from string_parse_network().

id_map

An identifier map from string_parse_ids(), or NULL.

Value

The edge tibble, with endpoints translated where a mapping existed.

Details

STRING's canonical preferredName lags HGNC. Query SEPTIN9 and the edges come back naming SEPT9, and the network endpoint does not echo the query term. A caller matching edges against the symbols it asked about therefore finds nothing for that gene and records it as having no partners, which is indistinguishable from a real isolate.

Passing the map from string_map_ids() through here translates the endpoints back. An endpoint with no mapping is left alone, and an empty map leaves the edges untouched, so reconciliation can never turn a good answer into a worse one.

Examples

edges <- tibble::tibble(gene_a = "SEPT9", gene_b = "TP53", score = 0.9)
map <- tibble::tibble(
  query = "SEPTIN9", preferred = "SEPT9", string_id = "9606.ENSP00000329125"
)
string_reconcile_edges(edges, map)
#> # A tibble: 1 × 3
#>   gene_a  gene_b score
#>   <chr>   <chr>  <dbl>
#> 1 SEPTIN9 TP53     0.9