#read in counts from htseq, may need to remove last 5 rows of extra info htseq gives you 
1wh <- read.table("1whcounts.txt")
1wko <- read.table("1wkocounts.txt")
3wh <- read.table("3whcounts.txt")
3wko <- read.table("3whkocounts.txt")
12wh <- read.table("12whcounts.txt")
12wko <- read.table("12wkocounts.txt")

#Create count table:
counts <- data.frame("1wh" = 1wh$V2, "1wko" = 1wko$V2, "3wh" = 3wh$V2, "3wko" = 3wko$V2, "12wh" = 12wh$V2, "12wko" = 12wko$V2, row.names = 1wh$V1)

#run DEseq
library(DESeq)
condition = factor(c("1wh" , "1wko", "3wh", "3wko", "12wh", "12wko"))
cds <- newCountDataSet(c2, conditions = condition)
cds <- estimateSizeFactors(cds)
cds <- estimateDispersions(cds)
normalized_counts <- counts(cds, normalized=TRUE)

#set 50 count cutoff:
count_cutoff <- normalized_counts[normalized_counts$1wh >= 50 | normalized_counts$1wko >= 50 | normalized_counts$3wh >= 50 | normalized_counts$3wko >= 50 | normalized_counts$12wh >= 50 | normalized_counts$12wko >= 50,]
