View source: R/utility_functions.R
SaveGeneLevelFiles | R Documentation |
Save a file for each gene containing all information necessary to run CompDTUReg
SaveGeneLevelFiles(
directory,
GeneLevelFilesSaveDir,
curr_part_num,
useInferentialReplicates = TRUE,
GibbsSamps,
CLE = TRUE,
CLEParam = 0.05
)
directory |
is the directory where previous datasets are saved by |
GeneLevelFilesSaveDir |
is the directory the gene level files will be saved to |
curr_part_num |
if the current part number to save results for. See |
useInferentialReplicates |
is set to TRUE if inferential replicates are to be used in the analysis and FALSE otherwise. If useInferentialReplicates if set to FALSE the gene-level files will only contain data corresponding to the point estimates (output as Y)
and if it is TRUE the gene-level files will also contain data corresponding to the inferential replicates (output as YInfRep) If FALSE the argument |
GibbsSamps |
is TRUE if the inferential replicates are Gibbs samples and FALSE if the replicates are bootstrap samples |
CLE |
is TRUE if the |
CLEParam |
is the parameter (betwen 0 and 1) that controls the correction threshold (see details of |
See the file (3)SaveNecessaryDatasetsForCompDTUReg.R in the package's SampleCode folder for example code.
The function saves gene-level .RData files within the subdirectory GeneLevelFilesSaveDir
of save_dir
that contain all necessary
information to run a CompDTUReg
analysis, including inferential replicates (if any). The name of each file is the name of the current gene. Specifically, these files contain:
(1) key, which contains the sample names (in the Sample column), condition information (in the Condition column), and an identifier in the form of Sample1, Sample2, Sample3, etc
(2) genename, the name of the current gene (that will be the name of the outputted file as well)
(3) Group, which is a factor of the condition information specified in the Condition column of key
(4) samps, the identifiers of the sample (Sample1, Sample2, Sample3, etc) contained within key$Sample
(5) Y, the ilr-transformed matrix of response values (ie the ilr coordinates) corresponding to the point estimates for all samples for the current gene for use with CompDTU.
(6) YInfRep, the ilr-transformed matrix of response values (ie the ilr coordinates) corresponding to all inferential replicates for all samples for the current gene for use with CompDTUme.
Will be in the order Sample1InfRep1, Sample2InfRep1, Sample3InfRep1, etc and will only be output if useInferentialReplicates is TRUE.
(7) mean.withinhat The overall within-sample covariance matrix (that is the mean of each sample's witin-subject covariance matrix) used to correct the total covariance in the CompDTUme method. Only output if useInferentialReplicates is TRUE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.