profile_mock_cluster2

==================================

P.copri abundance per cluster

==================================

clusters=read.table("microbiome_clustering/plots/MockData_species_PAM.txt",sep = "\t",header = T,stringsAsFactors = F)
clusters$sampleID=rownames(clusters)

> clusters #输出
          Cluster  sampleID
Sample1         1   Sample1
Sample2         1   Sample2
cluster_plot=merge(clusters,dag3_species[,"Prevotella_copri",drop=F],by.x="sampleID",by.y = "row.names",all=F)
#变为三列
> cluster_plot
      sampleID Cluster Prevotella_copri
1      Sample1       1         0.071806
2     Sample10       1         0.071623
cluster_plot=merge(clusters,dag3_species[,"Prevotella_copri",drop=F],by.x="sampleID",by.y = "row.names",all=F)
cluster_plot$Cluster=factor(cluster_plot$Cluster,levels = c("2","1"))
cluster_plot[cluster_plot==0]=NA
cluster_plot=na.omit(cluster_plot)
cluster_plot$Prevotella_copri=-log2(cluster_plot$Prevotella_copri)
cluster_plot[is.na(cluster_plot)]=0
g <- ggplot(cluster_plot, aes(x=Cluster, y=Prevotella_copri,fill=Cluster)) + 
  geom_violin()+
  geom_boxplot(width=0.1, fill="white")+scale_fill_npg()+theme_classic()+ylab("Prevotella Copri, Norm. Rel. Abundance (-log2)")
print(g)

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值