Guest User

Untitled

a guest
Nov 18th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.42 KB | None | 0 0
  1. setwd("/home/shobe/RibosomeProfilingFall2019/output/Degron")
  2.  
  3. data_prefix = "/home/shobe/RibosomeProfilingFall2019/Data/Degron/"
  4.  
  5. TEM <- read.delim(paste0(data_prefix, "mutant_TE_with_wildtype.txt"))
  6. TEW <- read.delim(paste0(data_prefix, "wildtype_TE_with_mutant.txt"))
  7. TEC <- read.delim(paste0(data_prefix, "TE_change_mutant_vs_wildtype.txt"))
  8.  
  9.  
  10. r <- data.frame(TEM = TEM$log2FoldChange, TEW = TEW$log2FoldChange, TEC = TEC$log2FoldChange, padj=TEC$padj)
  11. r$red <- abs(r$TEC) >= 1 & r$padj < 0.01
  12. r$red <- factor(r$red)
  13. print(summary(r))
  14. #r <- r[r$TEW > 0 & r$TEM > 0,]
  15.  
  16. library(ggplot2)
  17. tplot <- ggplot(r, aes(y=TEM, x=TEW,col=red)) + geom_point()
  18. tplot <- tplot + labs(title="TEC MT vs WT", subtitle=paste0("l2fc >= 1, padj < 0.01 ", "n=", summary(r$red)[[2]] + summary(r$red)[[1]], " pink=",summary(r$red)[[2]]))
  19.  
  20. tplot <- tplot + scale_color_manual(labels=c("below threshold", "above threshold"), values=c("darkgray", "#FF66B2"))
  21. tplot <- tplot + ylab(expression(paste(italic("tif32-td prt1-td"), " log2(TE)"))) +
  22.   xlab("WT log2(TE)")
  23. tplot <- tplot + theme_light() + theme(legend.title = element_blank(), legend.position = "bottom",
  24.                                        plot.title = element_text(hjust = 0.5),
  25.                                        plot.subtitle = element_text(hjust=0.5))#+ theme_linedraw()
  26.  
  27. #ggsave("Degron vs WT TEC.pdf",tplot, device=pdf)
  28. tplot + coord_fixed()
  29.  
  30. # italic("tif32-td prt1-td")
Advertisement
Add Comment
Please, Sign In to add comment