SaveInfRepDataAsRData: Save the infRep data for all genes across each unique...

View source: R/utility_functions.R

SaveInfRepDataAsRDataR Documentation

Save the infRep data for all genes across each unique biological sample/replicate.

Description

Save the infRep data for all genes across each unique biological sample/replicate.

Usage

SaveInfRepDataAsRData(
  curr_samp,
  tx2gene,
  curr_file_loc,
  GibbsSamps = FALSE,
  countsFromAbundance = "no",
  direc_to_save_res = NULL
)

Arguments

curr_samp

Gives the current sample number in the form of "Sample1", "Sample2", etc. Used in conjunction with key$Identifier, so needs to be "Sample1", "Sample2", etc even if the observation does not correspond to a unique biological sample

tx2gene

is a dataframe that matches transcripts to genes. Can be created by maketx2gene.

curr_file_loc

Gives the location of the .sf file for the Salmon quantification of the current Sample specified by the curr_samp parameter

GibbsSamps

is TRUE if the inferential replicates are Gibbs samples and FALSE if the replicates are bootstrap samples

countsFromAbundance

character corresponding to the countsFromAbundance parameter used when importing the data with tximport. Possible values are "no", "scaledTPM", or "lengthScaledTPM".

direc_to_save_res

is an optional directory to save the sample specific dataset containing bootstrap or Gibbs replicates. If unspecifying it will be saved to the current working directory.

Details

The count values will be scaled by the TPM values if countsFromAbundance is scaledTPM or lengthScaledTPM See the file (2)SaveInfRepsAsRData.R in the package's SampleCode folder for example code.

Value

This function saves a file that contains all bootstrap or Gibbs samples for the given biological sample input by the curr_samp parameter. Data is saved in the subdirectory BootSamps or GibbsSamps off of the current working directory unless the parameter direc_to_save_res is specified.


skvanburen/CompDTUReg documentation built on Jan. 23, 2025, 9:01 a.m.