#script for the correlation plot grape-MGI ####libraries#### packages = c("readxl","stringr","ggpubr","argparser","smplot") invisible(lapply(packages, library, character.only = TRUE)) options(bitmapType="cairo") ####MGI input#### #raw input d_mel_F_MGI <- read.delim("/users/project/precisiontox_008279/prepilot_3_prime_mgi_03_10_2022/20220912_crosskit_comparision/gene_count_matrix_raw/DF1_DF3_raw_count_mtx_sampleID.tsv",header = TRUE) rownames(d_mel_F_MGI) <- d_mel_F_MGI$Gene d_mel_F_MGI <- d_mel_F_MGI[,-1] tmp <- as.data.frame(str_split_fixed(colnames(d_mel_F_MGI), "\\.", 2)) colnames(d_mel_F_MGI) <- tmp$V1 nms <- unique(names(d_mel_F_MGI)) d_mel_F_MGI <- sapply(nms, function(x) rowMeans(d_mel_F_MGI[names(d_mel_F_MGI) %in% x])) ####correlation plot#### corr_plot <- ggplot(d_mel_F_MGI,aes(x = log(DF1+1),y = log(DF2+1))) + geom_point(aes(x = log(DF1+1),y = log(DF2+1))) + xlab("log DF1 TPM") + ylab("log DF2 TPM") + sm_corr_theme() + sm_statCorr() + ggtitle("DF1/DF2 MGI correlation") ggsave(corr_plot,filename = "/users/project/precisiontox_008279/grape-MGI_comaprison/replicate_comparison/grape/results/DF4_DF5_comparison.png")