In Mediation Analysis to Identify Feed Forward Loop from Transcriptome Data (2020), we introduce a new methodology that applies mediation analysis to predict feed forward loops (FFLs) in one biological group (the one-group method) or to predict FFLs unique to one of two biological groups (the two-group method). The fflmediation package contains functions for the one-group and two-group methods.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = ""
)
library(fflmediation)

One-group method

The one-group method predicts FFLs in one biological group.

1. Format data

The one-group method requires paired miRNA and mRNA expression data for n samples in a single biological group in the following format:

#sample miRNA expression data: miRNAs x samples (in this example: 3 x 50)
sample_mirna_expr

#sample mRNA expression data: mRNAs x samples (in this example 5 x 50)
sample_mrna_expr
2. Obtain candidate FFLs

Candidate FFLs are assembled using databases of gene interactions (TargetScan v7.2, miRTarBase v7.0, miRDB v6.0, miRanda v3.0, TransmiR v2.0, TRRUST v2.0, and ENCODE). Integrating these databases generates a list of 25,240,974 candidate miRNA-FFLs (candidate_ffls_mirna_all dataframe, created by binding candidate_ffls_mirna_all_part1 and candidate_ffls_mirna_all_part2; 25,240,974 x 9) and a list of 178,872 candidate TF-FFLs (candidate_ffls_tf_all dataframe; 178872 x 10).

To obtain candidate miRNA-FFLs for analyses, subset the candidate_ffls_mirna_all dataframe, selecting for candidate miRNA-FFLs (rows) of interest. To obtain candidate TF-FFLs for analyses, subset the candidate_ffls_tf_all dataframe, selecting for candidate TF-FFLs (rows) of interest.

#candidate_ffls_mirna_all
candidate_ffls_mirna_all <- rbind(candidate_ffls_mirna_all_part1, candidate_ffls_mirna_all_part2)
head(candidate_ffls_mirna_all)

#candidate_ffls_tf_all
head(candidate_ffls_tf_all)

#sample candidate miRNA-FFLs for analyses (a subset of the rows in candidate_ffls_mirna_all): 3 x 9
sample_candidate_ffls_mirna
3. Apply one-group method

To apply the two-group method, use the predict_ffls_one_group function. Refer to the documentation of the predict_ffls_one_group function for the description and options of each argument.

The following is an example for miRNA-FFLs. For TF-FFLs, change the candidate_ffls argument from a dataframe of candidate miRNA-FFLs to a dataframe of candidate TF-FFLs and the ffl_type argument from "miRNA" to "TF".

#one-group method, miRNA-FFL example
sample_output_onegroup_mirna_ffls <- 
  predict_ffls_one_group(mirna_expr = sample_mirna_expr, 
                         mrna_expr = sample_mrna_expr,
                         ffl_type = "miRNA",
                         candidate_ffls = sample_candidate_ffls_mirna,
                         num_bootstrap_samples = 100, num_permutations = 100,
                         p_value_adjust_method = "fdr", 
                         seed = 12345, 
                         parallel = FALSE)

sample_output_onegroup_mirna_ffls

Two-group method

The two-group method predicts FFLs unique to one of two biological groups.

1. Format data

The two-group method requires paired miRNA and mRNA expression data for n samples in one biological group and m samples in another biological group in the following format:

#####group 1
#sample miRNA expression data: miRNAs x samples (in this example: 3 x 50)
sample_mirna_expr_g1

#sample mRNA expression data: mRNAs x samples (in this example 5 x 50)
sample_mrna_expr_g1

#####group 2
#sample miRNA expression data: miRNAs x samples (in this example: 3 x 50)
sample_mirna_expr_g2

#sample mRNA expression data: mRNAs x samples (in this example 5 x 50)
sample_mrna_expr_g2
2. Obtain candidate FFLs

Obtain candidate FFLs for the two-group method in the same way as for the one-group method detailed above.

3. Apply two-group method

To apply the two-group method, use the predict_ffls_two_group function. Refer to the documentation of the predict_ffls_two_group function for the description and options of each argument.

The following is an example for miRNA-FFLs. For TF-FFLs, change the candidate_ffls argument from a dataframe of candidate miRNA-FFLs to a dataframe of candidate TF-FFLs and the ffl_type argument from "miRNA" to "TF".

#two-group method, miRNA-FFL example
sample_output_twogroups_mirna_ffls <- 
  predict_ffls_two_groups(mirna_expr_g1 = sample_mirna_expr_g1, 
                          mrna_expr_g1 = sample_mrna_expr_g1,
                          mirna_expr_g2 = sample_mirna_expr_g2, 
                          mrna_expr_g2 = sample_mrna_expr_g2,
                          ffl_type = "miRNA",
                          candidate_ffls = sample_candidate_ffls_mirna,
                          num_bootstrap_samples = 100, 
                          num_permutations = 100,
                          p_value_adjust_method = "fdr", 
                          seed = 12345,
                          parallel = FALSE)
sample_output_twogroups_mirna_ffls


th789/fflmediation documentation built on June 13, 2022, 1:02 p.m.