diff --git a/ONATRY-CIT/app.R b/ONATRY-CIT/app.R index 666c855..c5fbac4 100644 --- a/ONATRY-CIT/app.R +++ b/ONATRY-CIT/app.R @@ -75,7 +75,7 @@ server <- function(input, output) { colnames(df)<-c(var.column, val.column) return(df) } - + Query_CU<-t(codonCounts(Query)) %>% as.data.frame() %>% setNames(names(txtQuery)) %>% @@ -85,7 +85,7 @@ server <- function(input, output) { group_by(AA) %>% mutate(across(all_of(names(txtQuery)), function(x) x=x/sum(x))) %>% ungroup() - + pca_ref<-read.table("../Scripts/pca_HAdV5_EGFP_MONO_EMM_BH_VCN_APIS_MOD_PDT_ADAPT_Tox.txt",sep="\t", dec = ",", header = T) pca_ref$codon<-gsub(" ","",pca_ref$codon) pca_tab<-merge(pca_ref, @@ -125,9 +125,9 @@ server <- function(input, output) { ) %>% group_by(AA) %>% mutate(Weight=Usage/max(Usage)) - - Query_codons<-sapply(txtQuery, function(x) substring(x,seq(1,(nchar(x)-2),3), seq(3,nchar(x),3))) - + + Query_codons<-lapply(txtQuery, function(x) substring(x,seq(1,(nchar(x)-2),3), seq(3,nchar(x),3))) + Query_CAI<-do.call(rbind, lapply(names(Query_codons), function(x){ merge( data.frame(Position=1:length(Query_codons[[x]]), @@ -136,7 +136,7 @@ server <- function(input, output) { w[,c("Codon","AA","Weight")] ) %>% arrange(Position) })) - + Query_CAI[Query_CAI$AA %in% c("Met","End","Trp"),"Weight"]<-0 #CAI @@ -157,7 +157,7 @@ server <- function(input, output) { ggtitle("CAI along sequence")+ theme_gray(base_size = 15) - AApos3<-sapply(txtQuery, function(x) strsplit(x, "")[[1]][seq(3, nchar(x), 3)]) + AApos3<-lapply(txtQuery, function(x) strsplit(x, "")[[1]][seq(3, nchar(x), 3)]) GC3<-sapply(AApos3, function(x) 100*length(x[x %in% c("G","C")])/length(x))