diff --git a/man/DL_fisher_test.Rd b/man/DL_fisher_test.Rd new file mode 100644 index 0000000..f95720a --- /dev/null +++ b/man/DL_fisher_test.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/differential_fxns.R +\name{DL_fisher_test} +\alias{DL_fisher_test} +\title{Differential Linkage test using Fisher's Exact Test} +\usage{ +DL_fisher_test(act_df, group.by) +} +\arguments{ +\item{act_df}{data frame specifying to what level of the group.by variable each subject belongs and the activity state of the linkage being tested} + +\item{group.by}{the name of the column by which to group subjects for counting.} +} +\value{ +named vector of odds.ratio estimate and p-value obtained from Fisher's Exact Test as implemented in \code{\link[=fisher.test]{fisher.test()}} +} +\description{ +Differential Linkage test using Fisher's Exact Test +} diff --git a/man/DL_logistic_regression.Rd b/man/DL_logistic_regression.Rd new file mode 100644 index 0000000..1512b4f --- /dev/null +++ b/man/DL_logistic_regression.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/differential_fxns.R +\name{DL_logistic_regression} +\alias{DL_logistic_regression} +\title{Differential Linkage test using Logistic Regression} +\usage{ +DL_logistic_regression(act_df, group.by, model.formula) +} +\arguments{ +\item{act_df}{data frame specifying to what level of the group.by variable each subject belongs and the activity state of the linkage being tested} + +\item{group.by}{the name of the column by which to group subjects for counting.} + +\item{model.formula}{model formula passed to \code{\link[=glm]{glm()}} when using test methods that accept linear models.} +} +\value{ +named vector of log odds ratio, log odds ratio standard error, odds ratio, odds ratio standard error, and p-value calculated for each variable in the model by Logistic Regression result as implemented in \code{\link[=glm]{glm()}} +} +\description{ +Differential Linkage test using Logistic Regression +} diff --git a/man/count_linkage_activity.Rd b/man/count_linkage_activity.Rd new file mode 100644 index 0000000..a269a37 --- /dev/null +++ b/man/count_linkage_activity.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/differential_fxns.R +\name{count_linkage_activity} +\alias{count_linkage_activity} +\title{Count occurrence of a linkage's activity among subjects} +\usage{ +count_linkage_activity(linkage_summary, cluster, linkage, feature) +} +\arguments{ +\item{linkage_summary}{a \code{\link[=linkage_summary]{linkage_summary()}} object} + +\item{cluster}{the name of the cell cluster being compared across multiple domino results} + +\item{linkage}{a stored linkage type from the inferred network.} + +\item{feature}{the name of the specific linkage feature to be counted} +} +\value{ +a data frame including the linkage summary's subject meta table appended to the activation state of the specified linkage in each subject. +} +\description{ +Count the occurrence of subjects with an active inferred linkage in a specified cell type +} diff --git a/man/create_activity_list.Rd b/man/create_activity_list.Rd new file mode 100644 index 0000000..44ae53c --- /dev/null +++ b/man/create_activity_list.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/differential_fxns.R +\name{create_activity_list} +\alias{create_activity_list} +\title{Count occurrences of linkages across multiple inferred network results from a linkage summary} +\usage{ +create_activity_list( + linkage_summary, + cluster, + linkage = "rec_lig", + subject_names = NULL +) +} +\arguments{ +\item{linkage_summary}{a \code{\link[=linkage_summary]{linkage_summary()}} object} + +\item{cluster}{the name of the cell cluster being compared across multiple domino results} + +\item{linkage}{a stored linkage type from the inferred network.} + +\item{subject_names}{a vector of subject_names from the linkage_summary to be compared. If NULL, all subject_names in the linkage summary are included in counting.} +} +\value{ +a list of data frames with one data frame per linkage feature. Each data frame lists whether the linkage was inferred as active (1) or inactive (0) in the surveyed subjects +} +\description{ +Counts the number of subjects with active linkage for all linkage features of a linkage type +} diff --git a/man/summarize_activity_list.Rd b/man/summarize_activity_list.Rd new file mode 100644 index 0000000..5de7f09 --- /dev/null +++ b/man/summarize_activity_list.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/differential_fxns.R +\name{summarize_activity_list} +\alias{summarize_activity_list} +\title{Summarize the proportion of subjects with active linkage} +\usage{ +summarize_activity_list(activity_list, group.by = NULL) +} +\arguments{ +\item{activity_list}{list of data frames listing whether a linkage was inferred as active (1) or inactive (0) in the surveyed subjects} + +\item{group.by}{the name of the column in by which to group subjects for counting. If NULL, only total counts of linkages for linkages in the cluster across all subjects is given.} +} +\value{ +A data frame with columns for the unique linkage features and the counts of how many times the linkage occured across the compared domino results. If group.by is used, counts of the linkages are also provided as columns named by the unique values of the group.by parameter. +} +\description{ +Summarizes an activity list as a data frame where each row is an assessed linkage of the selected linkage type. If a group.by parameter is applied, the proportion of subjects in each level of the group.by variable will be returned. +} diff --git a/man/test_differential_linkages.Rd b/man/test_differential_linkages.Rd index 93766ca..3264c82 100644 --- a/man/test_differential_linkages.Rd +++ b/man/test_differential_linkages.Rd @@ -10,7 +10,8 @@ test_differential_linkages( group.by, linkage = "rec_lig", subject_names = NULL, - test_name = "fishers.exact" + method = "fishers.exact", + model.formula = paste0("feature_activity~", group.by) ) } \arguments{ @@ -24,10 +25,13 @@ test_differential_linkages( \item{subject_names}{a vector of subject_names from the linkage_summary to be compared. If NULL, all subject_names in the linkage summary are included in counting.} -\item{test_name}{the statistical test used for comparison. +\item{method}{the statistical test used for comparison. \itemize{ \item{'fishers.exact'} : Fisher's exact test for the dependence of the proportion of subjects with an active linkage in the cluster on which group the subject belongs to in the group.by variable. Provides an odds ratio, p-value, and a Benjamini-Hochberg FDR-adjusted p-value (p.adj) for each linkage tested. +\item{'logistic.regression'} : Logistic regression test for the effect of the group.by variable on the probability of a subject having an active linkage. If using this method, a model.formula must be provided following formatting for models tested by the glm() function with "feature_activity" as the dependent variable. For each variable in the model, provides effect estimate as log-odds ratio, standard error of the estimate, odds ratio, standard error of the odds ratio, and p-value derived from tow-tailed z-test that the effect size = 0. }} + +\item{model.formula}{model formula passed to \code{\link[=glm]{glm()}} when using test methods that accept linear models.} } \value{ A data frame of results from the test of the differential linkages. Rows correspond to each linkage tested. Columns correspond to: @@ -50,7 +54,11 @@ Statistical test for differential linkages across multiple domino results \examples{ tiny_differential_linkage_c1 <- test_differential_linkages( linkage_summary = mock_linkage_summary(), cluster = "C1", group.by = "group", - linkage = "rec", test_name = "fishers.exact" + linkage = "rec", method = "fishers.exact" +) +tiny_differential_linkage_c2 <- test_differential_linkages( + linkage_summary = mock_linkage_summary(), cluster = "C1", group.by = "group", + linkage = "rec", method = "logistic.regression", model.formula = "feature_activity ~ group" ) }