一千零一技|相关性分析及其可视化:copy&paste,搞定
.libPaths(c("/bioinfo/home/software/miniconda3/envs/R4.0/lib/R/library"))
#data("mtcars")
library("PerformanceAnalytics")
# pdf("test.pdf")
# my_data <- mtcars[, c(1,3,4,5,6,7)]
# print (head(my_data))
# chart.Correlation(my_data, histogram=TRUE, pch=19)
# dev.off()args <- commandArgs(trailingOnly = TRUE)
infile <- args[1]
outdir <- args[2]
names<-basename(infile)
df <- read.delim(infile, header = T, stringsAsFactors = F,row.names = NULL)
#df <- df[,-ncol(df)]
print (df)
index <- row.names(df)
print(index)
# q()
# data_T=as.data.frame((data))
# df1 = anno_col[,"types",drop=FALSE]
pdf(paste0(outdir,"/",names,".correlation_chart.pdf"))
chart.Correlation(df, histogram=TRUE, pch=19,method='spearman')
dev.off()
输入:
输出: