Reporter score analysis by pairwise comparison in multi-group

RSA_by_mg(kodf, group, metadata = NULL, verbose = TRUE, method = "t.test", ...)

Arguments

kodf

KO_abundance table, rowname is ko id (e.g. K00001),colnames is samples.

group

The comparison groups (at least two categories) in your data, one column name of metadata when metadata exist or a vector whose length equal to columns number of kodf. And you can use factor levels to change order.

metadata

sample information data.frame contains group

verbose

verbose

method

method from reporter_score

...

additional arguments for reporter_score

Value

rs_by_mg

Examples

message("The following example require some time to run:")
#> The following example require some time to run:
# \donttest{
data("KO_abundance_test")
rsa_mg_res <- RSA_by_mg(KO_abundance, "Group2", metadata,
  method = "pearson", perm = 199
)
#> =================================Checking group=================================
#> 30 samples are matched for next step.
#> ========================Get ReporterScore for each group========================
#> ==================================For group G1==================================
#> ================================Use feature: ko=================================
#> ===============================Checking rownames================================
#> Some of your ko_stat are not KO id, check the format! (e.g. K00001)
#> 52.7% of your kos in the modulelist!
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ===================================1.KO test====================================
#> =================================Checking group=================================
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ==============================Calculating each KO===============================
#> =============================Using method: pearson==============================
#> Using correlation analysis: pearson, the groups will be transform to numeric, note the factor feature of group.
#> 1000 features done.
#> 2000 features done.
#> 3000 features done.
#> 4000 features done.
#> 
#> Compared groups: _Others, G1
#> Total KO number: 4535
#> Compare method: pearson
#> Time use: 0.661
#> =========================2.Transfer p.value to Z-score==========================
#> ==========================3.Calculating reporter score==========================
#> ==================================load KOlist===================================
#> ================KOlist download time: 2023-07-28 06:07:08.466916================
#> If you want to update KOlist, use `update_KO_file()`
#> ============================Calculating each pathway============================
#> 100 pathways done.
#> 400 pathways done.
#> ID number: 481
#> Time use: 0.951
#> ====================================All done====================================
#> ==================================For group G2==================================
#> ================================Use feature: ko=================================
#> ===============================Checking rownames================================
#> Some of your ko_stat are not KO id, check the format! (e.g. K00001)
#> 52.7% of your kos in the modulelist!
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ===================================1.KO test====================================
#> =================================Checking group=================================
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ==============================Calculating each KO===============================
#> =============================Using method: pearson==============================
#> Using correlation analysis: pearson, the groups will be transform to numeric, note the factor feature of group.
#> 1000 features done.
#> 2000 features done.
#> 3000 features done.
#> 4000 features done.
#> 
#> Compared groups: _Others, G2
#> Total KO number: 4535
#> Compare method: pearson
#> Time use: 0.688
#> =========================2.Transfer p.value to Z-score==========================
#> ==========================3.Calculating reporter score==========================
#> ==================================load KOlist===================================
#> ================KOlist download time: 2023-07-28 06:07:08.466916================
#> If you want to update KOlist, use `update_KO_file()`
#> ============================Calculating each pathway============================
#> 100 pathways done.
#> 400 pathways done.
#> ID number: 481
#> Time use: 0.898
#> ====================================All done====================================
#> ==================================For group G3==================================
#> ================================Use feature: ko=================================
#> ===============================Checking rownames================================
#> Some of your ko_stat are not KO id, check the format! (e.g. K00001)
#> 52.7% of your kos in the modulelist!
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ===================================1.KO test====================================
#> =================================Checking group=================================
#> 30 samples are matched for next step.
#> ===========================Removing all-zero rows: 0============================
#> ==============================Calculating each KO===============================
#> =============================Using method: pearson==============================
#> Using correlation analysis: pearson, the groups will be transform to numeric, note the factor feature of group.
#> 1000 features done.
#> 2000 features done.
#> 3000 features done.
#> 4000 features done.
#> 
#> Compared groups: _Others, G3
#> Total KO number: 4535
#> Compare method: pearson
#> Time use: 0.676
#> =========================2.Transfer p.value to Z-score==========================
#> ==========================3.Calculating reporter score==========================
#> ==================================load KOlist===================================
#> ================KOlist download time: 2023-07-28 06:07:08.466916================
#> If you want to update KOlist, use `update_KO_file()`
#> ============================Calculating each pathway============================
#> 100 pathways done.
#> 400 pathways done.
#> ID number: 481
#> Time use: 0.909
#> ====================================All done====================================
# }