RNA-seq timewise differential analysis
Source:R/transcript_differential_analysis.R
transcript_timewise_da.RdUse 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.
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_outfileexists- verbose
boolean, whether to print messages
Value
a data frame with one row per gene per contrast (usually 8 rows per gene):
feature_IDcharacter, MoTrPAC feature identifier
sexcharacter, one of 'male' or 'female'
comparison_groupcharacter, time point of trained animals compared to the sex-matched sedentary control animals, one of '1w', '2w', '4w', '8w'
assaycharacter, assay abbreviation, one of MotrpacRatTraining6moData::ASSAY_ABBREV
assay_codecharacter, assay code used in data release. See MotrpacBicQC::assay_codes.
tissuecharacter, tissue abbreviation, one of MotrpacRatTraining6moData::TISSUE_ABBREV
tissue_codecharacter, tissue code used in data release. See MotrpacBicQC::bic_animal_tissue_code.
covariatescharacter, comma-separated list of adjustment variables
removed_samplescharacter, comma-separated list of outliers (vial labels) removed from differential analysis
logFCdouble, 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_sedouble, standard error of the log fold-change
shrunk_logFCdouble, log fold-change shrunk with
type = 'ashr'andoptmethod = 'mixSQP', only ifadd_shrunk_logfc = TRUEshrunk_logFC_sedouble, standard error of
shrunk_logFC, only ifadd_shrunk_logfc = TRUEzscoredouble, Wald statistic
p_valuedouble, unadjusted p-value for the difference between 'comparison_group' and the group of sex-matched sedentary control animals
comparison_average_intensitydouble, average intensity among the replicates in 'comparison_group'
comparison_average_intensity_sedouble, standard error of 'comparison_average_intensity'
reference_average_intensitydouble, average intensity among the replicates in the group of sex-matched sedentary control animals
reference_average_intensity_sedouble, standard error of 'reference_average_intensity'
Examples
if (FALSE) { # \dontrun{
# 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)
} # }