Learn R Programming

nichenetr (version 0.1.0)

add_new_datasource: Add a new data source to the model

Description

add_new_datasource adds a new data source to one of the ligand-receptor, signaling and gene regulatory data sources.

Usage

add_new_datasource(new_source, network, new_weight,source_weights_df)

Arguments

new_source

A data frame / tibble containing novel interactions of the ligand-receptor, signaling or gene regulatory layer (required columns: from, to, source)

network

NULL or a data frame / tibble containing the base network to which you want to add the new data source (required columns: from, to, source)

new_weight

a weight value between 0 and 1 to assign to your new data source

source_weights_df

A data frame / tibble containing the weights associated to each already included individual data source (required columns: source, weight).

Value

A list containing 2 elements (network and source_weights_df): the updated network containing your data source and the updated source_weights_df containing the weight of the newly added data source.

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
## Update the lr_network with a new ligand-receptor data source
library(dplyr)
lr_toy = tibble(from = "A", to = "B", source = "toy")
new_lr_network = add_new_datasource(lr_toy, lr_network,1,source_weights_df)
# }

Run the code above in your browser using DataLab