Function which performs the differential gene expression experiment using DESeq2
The function subsets the DESeq2_obj if necessary and adjust the condition in the event of a temporal differential gene expression analysis.
The function then runs through the standard DESeq2 pipeline. It saves the raw differential expression results, and the significant differential expression results.
DE_using_DESeq2(
time_object,
groups,
samples_to_use,
exp_name,
main_key,
condition_factor = NULL
)
A timeseries object
The groups being used (varies from conditional to temporal)
Samples to use in the comparisons
The name of the experiment, it will be use to store the results
Either conditional or temporal to indicate which type of differential gene expression experiment is being performed
A factor containing the new condition used for the differeital gene expression analysis
The timeseries object updated with the results from the experiment
TS_object<-create_example_object_for_R()
TS_object <- normalize_timeSeries_with_deseq2(time_object=TS_object)
#> converting counts to integer mode
#DE for a single timepoint
group_names<-slot(TS_object,'group_names')
tp<-'1'
exp_name<-paste0(group_names[1],'_vs_',group_names[2],'_TP_',tp)
sample_data<-exp_sample_data(TS_object)
samps_interest<-sample_data$sample[sample_data$timepoint==tp]
TS_object<-DE_using_DESeq2(TS_object,group_names,samps_interest,exp_name,main_key='conditional')
#> using pre-existing size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing