为何要手绘堆叠图?
QIIME2虽然可以生成堆叠图,然而图片只能在网页上查看,无法下载。此外,QIIME2的图有几分丑,且不可个性化修改,因此,手绘最靠谱。手绘当然不是用手画,而是用手敲代码。
输入文件
- 各级别的物种分布文件,可以直接从QIIME2 生成的taxa_barplot.qzv文件提交至 https://view.qiime2.org ,随后从网页左上角“CSV”按钮处导出各分类级别的丰度表,但是要删除风度表最后几列的元数据信息,只保留丰度信息,各列之间以逗号分隔,内容如下所示,该文件是LEVEL-2(Phylum)水平的物种丰度分布:
1 | index,Bacteria;Chloroflexi,Bacteria;Planctomycetota,Archaea;Nanoarchaeota,Bacteria;Patescibacteria,Bacteria;Proteobacteria,Bacteria;Actinobacteriota,Archaea;Aenigmarchaeota,Bacteria;Acidobacteriota,Archaea;Altiarchaeota,Bacteria;Firmicutes,Bacteria;Bdellovibrionota,Bacteria;Dependentiae,Bacteria;Spirochaetota,Bacteria;Margulisbacteria,Bacteria;Myxococcota,Archaea;Halobacterota,Archaea;Crenarchaeota,Bacteria;Latescibacterota,Bacteria;NB1-j,Bacteria;Desulfobacterota,Bacteria;Verrucomicrobiota,Archaea;Iainarchaeota,Bacteria;DTB120,Bacteria;Elusimicrobiota,Eukaryota;SAR,Archaea;Asgardarchaeota,Archaea;Euryarchaeota,Bacteria;CK-2C2-2,Bacteria;Sva0485,Archaea;Thermoplasmatota,Bacteria;Bacteroidota,Bacteria;Marinimicrobia (SAR406 clade),Bacteria;MBNT15,Bacteria;Nitrospinota,Bacteria;Zixibacteria,Bacteria;Nitrospirota,Archaea;Micrarchaeota,Bacteria;LCP-89,Bacteria;Armatimonadota,Bacteria;WOR-1,Bacteria;Gemmatimonadota,Bacteria;Fibrobacterota,Bacteria;Calditrichota,Bacteria;Sumerlaeota,Bacteria;Aerophobota,Bacteria;WS1,Bacteria;NKB15,Bacteria;SAR324 clade(Marine group B),Bacteria;Dadabacteria,Bacteria;BHI80-139,Bacteria;Desantisbacteria,Bacteria;Schekmanbacteria,Archaea;Hadarchaeota,Archaea;Hydrothermarchaeota,Bacteria;Caldatribacteriota,Bacteria;TA06,Bacteria;WS2,Eukaryota;Amorphea,Bacteria;Cyanobacteria,Bacteria;Hydrogenedentes,Bacteria;Cloacimonadota,Bacteria;WPS-2,Bacteria;Modulibacteria,Eukaryota;Archaeplastida,Bacteria;10bav-F6,Bacteria;Methylomirabilota,Bacteria;Deferrisomatota,Bacteria;Fusobacteriota,Bacteria;Fermentibacterota,Bacteria;Entotheonellaeota,Eukaryota;Discoba,Bacteria;Campylobacterota,Bacteria;PAUC34f,Bacteria;Poribacteria,Bacteria;AncK6,Bacteria;GN01,Bacteria;Acetothermia,Bacteria;FCPU426 |
- 样本元数据,描述各样本特征的文件,以制表符分隔各列,内容如下:
1 | ID Samples Layer Depth Location Position Site |
代码
建议在Rstudio中运行。
1 | # 首先需要安装依赖包“amplicon”,如果没有安装“devtools”需要先安装,命令如下: |
最后的图可以在Rstudio中手动导出。
敬告:使用文中脚本请引用本文网址,请尊重本人的劳动成果,谢谢!