当前位置:网站首页>Microbial ecological sequencing analysis -- CCA analysis
Microbial ecological sequencing analysis -- CCA analysis
2022-06-21 06:02:00 【Silent voice】
Microbial ecological sequencing analysis ——CCA analysis
library(vegan)
library(ggplot2)
library(permute)
library(lattice)
sa4=read.table("spes.csv",header=T,row.names=1,sep=",")
S8.p=read.table("S8.p.csv",header=T,sep=",",row.names=1)# Select physical and chemical factors with significant correlation
group <- read.table("name.csv", header=F,sep=",",colClasses=c("character","character"))# Used to generate legend , Classify the samples
cca<-cca(sa4,S8.p, scale=T)
sam <- data.frame(cca$CCA$u[,c(1,2)], group$V2) # Extract sample scores
colnames(sam) <- c("CCA1","CCA2","group")
spec <- cca$CCA$v[,c(1,2)] # Species score
spec <- as.data.frame(spec)
# It can be used to display species data in the figure
#spec<-data.frame(spece=row.names(cca$CCA$v),RDA1=cca$CCA$v[,1],RDA2=cca$CCA$v[,2])
env <- cca$CCA$biplot[,c(1,2)] # Environmental factor score
env <- as.data.frame(env)
cca1 =round(cca$CCA$eig[1]/sum(cca$CCA$eig)*100,2) # First axis label
cca2 =round(cca$CCA$eig[2]/sum(cca$CCA$eig)*100,2) # Second axis label
# Creation of drawing objects
p <- ggplot(data=sam,aes(CCA1,CCA2))
# Geometry object
p <- p + geom_point(aes(colour=group,shape=group),size=5) +
# Show the species in the figure
#geom_point(data=spec,aes(shape=spece),size=2) + scale_shape_manual(values=seq(0,20))+
# Add sample label
#geom_text(aes(label=rownames(sam)),
# size=4,hjust=0.5,vjust=-0.7,position = "jitter") +
scale_shape_manual(values=c(19,19,19,19,19)) +
labs(title="CCA Plot",x=paste("CCA1 ",cca1," %"),y=paste("CCA2 ",cca2," %")) +
theme(text=element_text(family="serif"))
# Remove background and gridlines
p=p+theme_bw() + theme(panel.grid=element_blank())
p=p + geom_segment(data = env,aes(x=0,y=0,xend = env[,1], yend = env[,2]), colour="purple", size=1.5, arrow=arrow(angle=35, length=unit(0.3, "cm"))) +
geom_text(data=env, aes(x=env[,1], y=env[,2], label=rownames(env)),
size=5, colour="purple",hjust = (1 - 2 * sign(env[ ,1])) / 3,
angle = (180/pi) * atan(env[ ,2]/env[ ,1]))
I see that many students ask questions about the imported data format , I wrote a detailed ranking analysis article again , It was posted on the official account “ When scientific research is in progress ” On , Article title :R mapping -RDA Sorting analysis , There are screenshots of data format , You can scan the QR code and pay attention to view .
边栏推荐
- C language course design (detailed explanation of clothing management system)
- The database is 8.0 students. In this place, add this paragraph? useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf8
- Research and Analysis on the current situation of wireless Internet of things sensor market in China and forecast report on its development prospect (2022)
- Django database and module models (4)
- 二叉排序树的基本操作
- Transformer模型实现与解析
- 微生物生态数据分析——冗余分析
- Two ways to get rid of the setback of the new retail brand "three squirrels"
- El table remove the scroll bar and Zebra Stripe color modification
- tf.Operation
猜你喜欢

sqli-labs23

Improve the determination of the required items of business details. When the error information is echoed according to the returned status code, the echoed information is inconsistent with the expecta

Excel列数字索引转字符索引

Emotron Elton soft starter maintenance msf370/msf450

Discussion on the American ess audio DAC decoder chip es9023

进程间通信(IPC):信号量

Two ways to get rid of the setback of the new retail brand "three squirrels"

After the code is generated by the code generator, the copy is completed, and the module is not displayed on the web page

图片隐写术:方法1

kali快捷键和设置方式
随机推荐
[Prometheus] an optimization record of Prometheus Federation
The usage of Roca data visualization API 2.0 of Gaode map
simple_ JS attack and defense world
数据接口请求异常,you have an error in your SQL syntax;check the manual that corresponds to your MYSQL server
数据库是8.0的同学,在这个地方,加这一段?useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf8
el-table去掉滚动条和斑马纹颜色修改
Laravel
萤石云应用
代码生成器文件运行出错:The server time zone value ‘�й���ʱ��‘ is unrecognized or represents more than one time
Ironocr 2022.1.0 supports 127 national languages
Splunk Enterprise 8.2.5
SSH copy ID batch - free script
Research and Analysis on the current situation of China's video conference transcription market and forecast report on its development prospects (2022)
Globally in top15, fintech recruitment go
完善业务细节
浅谈美国ESS音频DAC解码芯片ES9023
Get string byte size
kali快捷键和设置方式
Research and Analysis on the current situation of wireless Internet of things sensor market in China and forecast report on its development prospect (2022)
C#常用Chart组件