library('ggplot2')
setwd("C:/bin")
data <- read.table('result_pita_results.tab', sep="\t", header=TRUE)
ddG_counts <- as.data.frame(table(data$ddG))
colnames(ddG_counts) <- c("ddG", "Count")
# 使用 ggplot2 繪制圖表
p=ggplot(ddG_counts, aes(x = ddG, y = Count)) +
? geom_bar(stat = "identity", width = 0.5) +
? labs(x = "ddG 值", y = "UTR 的個數(shù)", title = "ddG 值與 UTR 的個數(shù)關(guān)系") +
? theme_minimal()
ddG_counts <- as.data.frame(table(data$ddG))
colnames(ddG_counts) <- c("ddG", "Count")
# 將 ddG 列轉(zhuǎn)換為數(shù)值類型
ddG_counts$ddG <- as.numeric(as.character(ddG_counts$ddG))
# 使用 ggplot2 繪制圖表
p1=ggplot(ddG_counts, aes(x = ddG, y = Count)) +
? geom_point(size = 3) +
? geom_line() +
? labs(x = "ddG 值", y = "UTR 的個數(shù)", title = "ddG 值與 UTR 的個數(shù)關(guān)系") +
? theme_minimal()
ddG_counts <- as.data.frame(table(data$ddG))
colnames(ddG_counts) <- c("ddG", "Count")
# 將 ddG 列轉(zhuǎn)換為數(shù)值類型
ddG_counts$ddG <- as.numeric(as.character(ddG_counts$ddG))
# 使用 ggplot2 繪制圖表
p3=ggplot(ddG_counts, aes(x = ddG, y = Count)) +
? geom_smooth(method = "loess", span = 0.25, se = FALSE) +
? labs(x = "ddG value", y = "miRNA and mRNA interactions number") +
? theme_minimal()
p3