Skip to contents

Merge stats data.frame rows from two sestats results, specifically when one object has "all rows" and is intended only to produce the non-P-value statistics such as group mean, max group mean (mgm), fold, and logFC.

Usage

merge_statdf_all_test(
  sestats_all,
  sestats_test,
  exclude_from_all = "P.val|^hit ",
  ...
)

Arguments

sestats_all

SEStats object or equivalent legacy list format, as returned by se_contrast_stats() when using argument define_hits=FALSE. These results should therefore only contain the group mean and log fold change values, for all rows in the input data, regardless if they were tested in sestts_test.

sestats_test

SEStats object or equivalent legacy list format, as returned by se_contrast_stats() when using argument define_hits=TRUE. These results should therefore contain the 'hit' column and with 'hit_array' data populated. It should only contain rows that were tested, which is assumed to be a subset of rows contained in sestats_all.

exclude_from_all

character pattern used with jamba::unvigrep() to exclude colnames from each data.frame in the 'stats_dfs' property of sestats_all. The default 'P.val|^hit ' will exclude P-value and adjusted P-value columns if they exist (they should not, but it can be tolerated).

...

additional arguments are ignored.

Value

list object in the same format as sestats_test, with only the elements 'stats_df' and 'stats_dfs' replaced with the expanded complete set of data.

Details

  • sestats_all should have all rows, not just those tested. It will specifically exclude stats columns with 'P.val' or '^hit ' in the name, using argument exclude_from_all.

  • sestats_test should have only the subset of rows tested.

This function may be used internally within jamses to automate the job of testing a subset of rows, but reporting summary values for all rows - including those rows not formally tested.