Hi, I used the following code to 1) get the significant genes that change based on time of day using LRT, 2) vst transform the data and find clusters based on their expression pattern across the four timepoints (the ZTs). What I found confusing was that there were a few genes (not sure how many in total, but so far I noticed some) that did not exist in objects "dds_Time.lrt" or "cluster_rld", but showed up in "clusters_Time" after degPatterns. The total number of genes/observations in these objects remained the same. Some examples of these genes are mt.Co1, mt.Nd4... I was hoping to know if any one has ever encountered similar issue or has any idea why there would be gene-level changes post degPatterns. Thank you very much.
res_Time <- results(dds_Time.lrt)
res_Time_df_sig <- as.data.frame(res_Time) %>% dplyr::filter(padj < 0.05)
clustering_sig_genes <- res_Time_df_sig
rld_Time <- vst(dds_Time.lrt, blind = TRUE, fitType = 'parametric')
rld_Time_mat <- assay(rld_Time)
cluster_rld <- subset(rld_Time_mat, rownames(rld_Time_mat) %in% res_Time_df_sig_genes)
ZT.order <- c("ZT3", "ZT9", "ZT15", "ZT21")
colData(dds_Time.lrt)$Time <- factor(colData(dds_Time.lrt)$Time, levels = ZT.order)
clusters_Time <- degPatterns(cluster_rld, metadata=colData(dds_Time.lrt),
time="Time", col=NULL, plot = FALSE, minc = 5)