So I have tried creating a design matrix but I am not entirely sure I have designed correctly for the data I have:
time sample
day0.x time1 sample1
day2.x time2 sample2
day5.x time3 sample3
day14.x time4 sample4
day0.y time1 sample5
day2.y time2 sample6
day5.y time3 sample7
day15.y time4 sample8
day30.y time5 sample9
This is the script I used to create the design matrix:
count_table <-read.csv("merged_count.txt", header=TRUE,sep="\t")
count_table <- count_table[-1]
head(count_table)
expt_design1 <- data.frame(row.names = colnames(count_table), subject = c(rep("day0",1),rep("day2",2),rep("day5",3),rep("day14",4),rep("day0",1),rep("day2",2),rep("day5",3),rep("day15",4),rep("day30",5),time = c("t1","t2","t3","t4","t1","t2","t3","t4","t5"))
cds <- newCountDataSet(count_table, expt_design1)
head(counts(cds))
cds = estimateSizeFactors(cds)
This is the error that I am getting when trying to create the design matrix:
> expt_design1 <- data.frame(row.names = colnames(count_table), subject = c(rep("day0",1),rep("day2",2),rep("day5",3),rep("day14",4),rep("day0",1),rep("day2",2),rep("day5",3),rep("day15",4),rep("day30",5),time = c("t1","t2","t3","t4","t1","t2","t3","t4","t5"))
+ cds <- newCountDataSet(count_table, expt_design1)
Error: unexpected symbol in:
"sign1 <- data.frame(row.names = colnames(count_table), subject = c(rep("day0",1),rep("day2",2),rep("day5",3),rep("day14",4),rep("day0",1),rep("day2",2),rep("day5",3),rep("day15",4),rep("day30"
cds"
What am I doing wrong? I hope I have not misunderstood your advice nor how to create a proper matrix.