Skip to content

Commit

Permalink
Change the figure size.
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiLiCn committed Dec 2, 2024
1 parent bfc3cfc commit 881f02e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Figure2.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,22 @@ 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")
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)

3 changes: 2 additions & 1 deletion Figure4.R
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
Expand Down
15 changes: 14 additions & 1 deletion Figure7.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#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)
library(psych)
library(plotly)
library(eulerr)
library(ggrepel)
library(reticulate)

read_maxlfq = function(file_path){
out_data = fread(file_path) %>%
Expand Down Expand Up @@ -281,14 +288,16 @@ 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)
}
fig4_lib_exp_over_anno = fread("./lowInputData/Direct_lib_result/experiment_annotation_over.tsv")

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")
Expand All @@ -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){
Expand Down

0 comments on commit 881f02e

Please sign in to comment.