``` r
# extract normalized counts
# (normalization is automatically performed by deseq2)
Ptuh_counts_lncRNA_norm <- counts(dds_Ptuh_lncRNA, normalized=TRUE) %>% data.frame()

write.table(Ptuh_counts_lncRNA_norm, file = "../output/03.2-Ptuh-lncRNA-summary/Ptuh_counts_lncRNA_normalized.txt", sep = "\t", row.names = TRUE, col.names = TRUE, quote = FALSE)


# variance stabilized data
vsd_Ptuh_lncRNA <- varianceStabilizingTransformation(dds_Ptuh_lncRNA, blind=TRUE)
wpn_vsd_Ptuh_lncRNA <- getVarianceStabilizedData(dds_Ptuh_lncRNA)
rv_wpn_Ptuh_lncRNA <- rowVars(wpn_vsd_Ptuh_lncRNA, useNames=TRUE)

Ptuh_counts_lncRNA_vsd <- data.frame(wpn_vsd_Ptuh_lncRNA)
write.table(Ptuh_counts_lncRNA_vsd, file = "../output/03.2-Ptuh-lncRNA-summary/Ptuh_counts_lncRNA_variancestabilized.txt", sep = "\t", row.names = TRUE, col.names = TRUE,quote = FALSE)

q75_wpn_Ptuh_lncRNA <- quantile(rowVars(wpn_vsd_Ptuh_lncRNA, useNames=TRUE), .75)  # 75th quantile variability
Ptuh_counts_lncRNA_vsd_q75 <- wpn_vsd_Ptuh_lncRNA[ rv_wpn_Ptuh_lncRNA > q75_wpn_Ptuh_lncRNA, ] %>% data.frame # filter to retain only the most variable lncRNAs
write.table(Ptuh_counts_lncRNA_vsd_q75, file = "../output/03.2-Ptuh-lncRNA-summary/Ptuh_counts_lncRNA_variancestabilized_q75.txt", sep = "\t", row.names = TRUE, col.names = TRUE,quote = FALSE)

q95_wpn_Ptuh_lncRNA <- quantile(rowVars(wpn_vsd_Ptuh_lncRNA, useNames=TRUE), .95)  # 95th quantile variability
Ptuh_counts_lncRNA_vsd_q95 <- wpn_vsd_Ptuh_lncRNA[ rv_wpn_Ptuh_lncRNA > q95_wpn_Ptuh_lncRNA, ] %>% data.frame # filter to retain only the most variable lncRNAs
write.table(Ptuh_counts_lncRNA_vsd_q95, file = "../output/03.2-Ptuh-lncRNA-summary/Ptuh_counts_lncRNA_variancestabilized_q95.txt", sep = "\t", row.names = TRUE, col.names = TRUE,quote = FALSE)
```