This function replaces new values with previous values of competing or miRNA counts.

update_variables(input_graph, current_counts)

Arguments

input_graph

The processed graph object.

current_counts

The additional df that provided by user.

Value

the graph object.

Details

update_variables function provides updating edge variables to current values. If the microRNA or competing expression (or both) change (decreasing or increasing), this function switches the values that are found in a new dataset provided by user. But the current value dataset must be equal with initial dataset in terms of node name.

Examples

data('minsamp') data('new_counts') minsamp%>% priming_graph(Competing_expression, miRNA_expression, aff_factor = c(seed_type,energy), deg_factor = region)%>% update_variables(new_counts)
#> Warning: First column is processed as competing and the second as miRNA.
#> # A tbl_graph: 8 nodes and 7 edges #> # #> # A rooted tree #> # #> # Node Data: 8 x 7 (active) #> name type node_id initial_count count_pre count_current changes_variable #> <chr> <chr> <int> <dbl> <dbl> <dbl> <chr> #> 1 Gene1 Competing 1 10000 10000 10000 Competing #> 2 Gene2 Competing 2 10000 10000 20000 Up #> 3 Gene3 Competing 3 5000 5000 5000 Competing #> 4 Gene4 Competing 4 10000 10000 10000 Competing #> 5 Gene5 Competing 5 5000 5000 5000 Competing #> 6 Gene6 Competing 6 10000 10000 10000 Competing #> # … with 2 more rows #> # #> # Edge Data: 7 x 22 #> from to Competing_name miRNA_name Competing_expre… miRNA_expression #> <int> <int> <chr> <chr> <dbl> <dbl> #> 1 1 7 Gene1 Mir1 10000 1000 #> 2 2 7 Gene2 Mir1 10000 1000 #> 3 3 7 Gene3 Mir1 5000 1000 #> # … with 4 more rows, and 16 more variables: seed_type <dbl>, energy <dbl>, #> # region <dbl>, dummy <dbl>, afff_factor <dbl>, degg_factor <dbl>, #> # comp_count_list <list>, comp_count_pre <dbl>, comp_count_current <dbl>, #> # mirna_count_list <list>, mirna_count_pre <dbl>, mirna_count_current <dbl>, #> # mirna_count_per_dep <dbl>, effect_current <dbl>, effect_pre <dbl>, #> # effect_list <list>
#new_counts includes the current counts of nodes.