Bug Update: The abolsute value function, abs(), worked with the code and counts genes with a -1 and 1 log2foldchange threshold.
Edits in markdown:
v = rs$padj<=Q & abs(rs$log2FoldChange)>=lfcThreshold
Checking the method code: To check if this method was working accurately, I made a separate script that grabbed just one group and performed the same strategy and saved the results as a csv and went through the file and saw that the statement was true and that the adjusted pvalues were all less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1.
res= read.csv('MvW-SL5.txt',sep = "\t",stringsAsFactors = F,
header=T)
V.34.75 <- res[res$group1 == 'V.34.75',]
V.34.75
V.34.75 <-data.frame(V.34.75)
final1 <- subset(V.34.75, padj<=0.01 & log2FoldChange>=1)
final2 <- subset(V.34.75, padj<=0.01 & log2FoldChange<=-1)
final <- rbind(final1, final2)
final <- data.frame(final)
nrow(final)
write.csv(final, "/Users/mollydavis333/Desktop/finalresults.csv", row.names=FALSE, quote=FALSE)
Note: There are more result conditions required in the markdown compared to my script so numbers my vary by small amounts but the statements are accurate and perform the required task of fixing the threshold bug in the markdown.
Bug Update: The abolsute value function, abs(), worked with the code and counts genes with a -1 and 1 log2foldchange threshold.
Edits in markdown:
Checking the method code: To check if this method was working accurately, I made a separate script that grabbed just one group and performed the same strategy and saved the results as a csv and went through the file and saw that the statement was true and that the adjusted pvalues were all less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1.
res= read.csv('MvW-SL5.txt',sep = "\t",stringsAsFactors = F, header=T) V.34.75 <- res[res$group1 == 'V.34.75',] V.34.75 V.34.75 <-data.frame(V.34.75) final1 <- subset(V.34.75, padj<=0.01 & log2FoldChange>=1) final2 <- subset(V.34.75, padj<=0.01 & log2FoldChange<=-1) final <- rbind(final1, final2) final <- data.frame(final) nrow(final) write.csv(final, "/Users/mollydavis333/Desktop/finalresults.csv", row.names=FALSE, quote=FALSE)Note: There are more result conditions required in the markdown compared to my script so numbers my vary by small amounts but the statements are accurate and perform the required task of fixing the threshold bug in the markdown.