欢迎关注bioinfor 生信云!有一起想做公众号的朋友欢迎联系我!
读取三张表
library(tidyverse)
library(readr)
gene_info <- read_delim("MM_6js01hvu.emapper.annotations.tsv",
delim = "\t", escape_double = FALSE,
col_names = FALSE, comment = "#", trim_ws = TRUE,row.names = 1) %>%
select(ID = X1,
GO = X10,
Ko = X12,
pathway = X13,
Gene_name = X9)
gene_exp <- read.table('genes.TMM.EXPR.matrix', header=T, row.names = 1)
sample_info <- read.table(file = 'sample.txt', sep = "\t", header=T, row.names = 1)
样本相关性
相关性分析correlation
R语言的cor函数,可以计算变量之间的相关系数
# 计算距离
sample_cor <- cor(gene_exp)
sample_cor1 <- round(sample_cor, di