diff --git a/Figure2.R b/Figure2.R index d2f5c8d..523e04d 100644 --- a/Figure2.R +++ b/Figure2.R @@ -198,16 +198,16 @@ breast_cancer_num_pro_miss_plot = ggplot(breast_cancer_num_pro_miss, aes(x=metho ylab("# Proteins (x1000)") + xlab("Method") + theme_light() + - labs(fill= "Non-missing\nvalue filter") + + labs(fill= "Completeness") + theme(axis.text.x = element_text(angle = 0, vjust = 1, hjust=0.5, size = 5), axis.text.y = element_text(size = 5), axis.title = element_text(size = 5), panel.border = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), axis.line = element_line(colour = "black", size = 0.05), - legend.position = "right", + legend.position = "bottom", legend.title = element_text(size=5, face="bold"), legend.text = element_text(size = 5), - legend.key.size = unit(0.2, "cm"), + legend.key.size = unit(0.1, "cm"), strip.background =element_rect(fill="white"), strip.text = element_text(size=6, colour = 'black')) + facet_grid(~type, scales="free", space = "free") @@ -215,5 +215,5 @@ breast_cancer_num_pro_miss_plot breast_cancer_plot_all= ggarrange(breast_cancer_pg_dis_plot, breast_cancer_num_pro_miss_plot, ncol = 1, nrow = 2, align="v", labels = c("a", "b"), font.label = list(size = 10)) -ggsave("./figures/Figure2.pdf", breast_cancer_plot_all, width=4, height = 3, units = c("in"), dpi=400) +ggsave("./figures/Figure2.pdf", breast_cancer_plot_all, width=88, height = 100, units = c("mm"), dpi=400) diff --git a/Figure4.R b/Figure4.R index eea4b43..fae234a 100644 --- a/Figure4.R +++ b/Figure4.R @@ -198,7 +198,8 @@ plasma_feature_plot = ggplot(feature_data_all, aes(x=condition, y=quant_log, col geom_point(position=position_jitterdodge(0.1), size=0.1, alpha=0.6)+ scale_x_discrete(labels=c('NSCLC', 'Control')) + scale_color_manual(values = c("#E54D37", "#5CBED3")) + - stat_compare_means(label = "p.signif", method = "t.test", label.x = 1.5 , label.y = 13, size=2)+ + stat_compare_means(aes(label = paste0('p = ', after_stat(p.format), '\n', + after_stat(p.signif))), method = "t.test", label.x = 1.5 , label.y = 13, size=1.8)+ ylab("Protein Abundance (log2)") + xlab("Group") + theme_light() + diff --git a/Figure7.R b/Figure7.R index 604063c..6e3ed04 100644 --- a/Figure7.R +++ b/Figure7.R @@ -1,3 +1,9 @@ +#install.packages('reticulate') +#reticulate::install_miniconda() +#reticulate::conda_install('r-reticulate', 'python-kaleido') +#reticulate::conda_install('r-reticulate', 'plotly', channel = 'plotly') +#reticulate::use_miniconda('r-reticulate') + library(tidyverse) library(data.table) library(ComplexHeatmap) @@ -5,6 +11,7 @@ library(psych) library(plotly) library(eulerr) library(ggrepel) +library(reticulate) read_maxlfq = function(file_path){ out_data = fread(file_path) %>% @@ -281,7 +288,8 @@ plot_pca = function(imputed_data, annotation_data, padding){ yaxis = list(title = list(text=paste('PC2=', summary(pc_comp)$importance[2,][2][[1]]*100, "%", sep=""), font=list(size=15)), tickfont = list(size = 6)), zaxis = list(title = list(text=paste('PC3=', summary(pc_comp)$importance[2,][3][[1]]*100, "%", sep=""), font=list(size=15)), - tickfont = list(size = 6)))) + tickfont = list(size = 6)), + camera = list(eye = list(x = -1, y = -2.4, z = 1.5)))) return(fig) } @@ -289,6 +297,7 @@ fig4_lib_exp_over_anno = fread("./lowInputData/Direct_lib_result/experiment_anno fig3_lib_imputed_table = fread("./lowInputData/Tonsil_lib_result/fragpipe_analyst/Imputed_matrix.csv") fig3_lib_pca = plot_pca(fig3_lib_imputed_table, fig4_lib_exp_over_anno, "30") +fig3_lib_pca ### Imputed_matrix.csv download from FragPipe-analysist. fig4_lib_imputed_table = fread("./lowInputData/Direct_lib_result/fragpipe_analyst/Imputed_matrix.csv") @@ -299,6 +308,10 @@ fig4_lib_imputed_table_passed = fig4_lib_imputed_table %>% fig4_lib_pca = plot_pca(fig4_lib_imputed_table_passed, fig4_lib_exp_over_anno, "") fig4_lib_pca # PCA plot save manually since need to modify 3D position. +reticulate::import("sys") +reticulate::import("plotly") +save_image(fig4_lib_pca, "./figures/pca.pdf", scale=2) + # gene expression non_imputed get_expre_one_gene = function(report_data, class_file, gene_name_list){