Skip to contents

Use DESeq2 to perform pairwise contrasts between each group of trained animals and the sex-matched control group for a single tissue. Analysis is performed separately for males and females.

Usage

transcript_timewise_da(
  tissue,
  covariates = c("pct_globin", "RIN", "pct_umi_dup", "median_5_3_bias"),
  outliers = na.omit(MotrpacRatTraining6moData::OUTLIERS$viallabel),
  add_shrunk_logfc = TRUE,
  rdata_outfile = NULL,
  overwrite = FALSE,
  verbose = FALSE
)

Arguments

tissue

character, tissue abbreviation, one of MotrpacRatTraining6moData::TISSUE_ABBREV

covariates

character vector of covariates that correspond to column names of MotrpacRatTraining6moData::TRNSCRPT_META. Defaults to covariates that were used for the manuscript.

outliers

vector of viallabels to exclude during differential analysis. Defaults to [MotrpacRatTraining6moData::OUTLIERS\$viallabel[[MotrpacRatTraining6moData::OUTLIERS]$assay == "TRNSCRPT"]

add_shrunk_logfc

boolean, whether to calculate shrunk log fold-changes in addition to standard log fold-changes

rdata_outfile

NULL or path in which to save DESeq2 objects in an RData file

overwrite

boolean, whether to overwrite the file if rdata_outfile exists

verbose

boolean, whether to print messages

Value

a data frame with one row per gene per contrast (usually 8 rows per gene):

feature_ID

character, MoTrPAC feature identifier

sex

character, one of 'male' or 'female'

comparison_group

character, time point of trained animals compared to the sex-matched sedentary control animals, one of '1w', '2w', '4w', '8w'

assay

character, assay abbreviation, one of MotrpacRatTraining6moData::ASSAY_ABBREV

assay_code

character, assay code used in data release. See MotrpacBicQC::assay_codes.

tissue

character, tissue abbreviation, one of MotrpacRatTraining6moData::TISSUE_ABBREV

tissue_code

character, tissue code used in data release. See MotrpacBicQC::bic_animal_tissue_code.

covariates

character, comma-separated list of adjustment variables

removed_samples

character, comma-separated list of outliers (vial labels) removed from differential analysis

logFC

double, log fold-change where the numerator is 'comparison_group', e.g., '1w', and the denominator is the group of sex-matched sedentary control animals

logFC_se

double, standard error of the log fold-change

shrunk_logFC

double, log fold-change shrunk with type = 'ashr' and optmethod = 'mixSQP', only if add_shrunk_logfc = TRUE

shrunk_logFC_se

double, standard error of shrunk_logFC, only if add_shrunk_logfc = TRUE

zscore

double, Wald statistic

p_value

double, unadjusted p-value for the difference between 'comparison_group' and the group of sex-matched sedentary control animals

comparison_average_intensity

double, average intensity among the replicates in 'comparison_group'

comparison_average_intensity_se

double, standard error of 'comparison_average_intensity'

reference_average_intensity

double, average intensity among the replicates in the group of sex-matched sedentary control animals

reference_average_intensity_se

double, standard error of 'reference_average_intensity'

Examples

if (FALSE) {
# Perform differential analysis for expressed genes in brown adipose tissue 
# with default parameters, i.e., outliers and covariates used for the manuscript; 
# calculate both standard and shrunk log fold-changes
da = transcript_timewise_da("BAT")

# Same as above but don't calculate shrunk log fold-changes
da = transcript_timewise_da("BAT", add_shrunk_logfc = FALSE)

# Same as the first example but save the [DESeq2::DESeq2()] DESeqResults objects in an RData file 
da = transcript_timewise_da("BAT", rdata_outfile = "~/test/BAT_RNA_DA.RData", overwrite = TRUE)
}