Author Archives: gene_x

How to install DAMIAN?

https://sourceforge.net/projects/damian-pd/

1, install PostgreSQL and gem on 18.04

sudo apt-get update
sudo apt install ruby-dev libffi-dev build-essential
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install libpq-dev
sudo apt install default-jre
sudo apt install hmmer
#sudo apt-get install pgadmin3

sudo gem install pg -v 0.19
sudo gem install axlsx
sudo gem install amatch

#interactive: sudo -u postgres createuser --interactive
#not_interactive: https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e
#sudo -u postgres psql
#postgres=# create database mydb;
#postgres=# create user myuser with encrypted password 'mypass';
#postgres=# grant all privileges on database mydb to myuser;

sudo -u postgres psql
CREATE USER damian_user WITH PASSWORD 'hamburg_uke';
CREATE DATABASE damian_db WITH OWNER damian_user;
postgre=# \q

2, install blast, tax and pfam

cd databases;
./get_all.sh;
cd tax; ./get_tax.sh;
cd pfam; ./get_pfam.sh;

#Taxonomy
#The following taxonomy files are required:
#ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdump.tar.gz (the downloaded file must unpacked using tar as well as decompressed.)
#http://s3.amazonaws.com/matrixsciencemisc/prot.av2taxid.gz
#
#curl ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz -O
#curl "ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/Pfam-A.hmm.gz" | gunzip > Pfam-A.hmm.txt
#curl "ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/database_files/pfamA_tax_depth.txt.gz" | gunzip > pfamA_tax_depth.txt

#change settings in config.rb
DB_NAME = 'damian_db'
DB_USER = 'damian_user'
DB_PASS = 'hamburg_uke'
./damian_database.rb  --erase_and_rebuild --names databases/tax/names.dmp --nodes databases/tax/nodes.dmp --hmm databases/pfam/Pfam-A.hmm.txt --taxdepth databases/pfam/pfamA_tax_depth.txt

#### download and update the blast-database ####
cd /mnt/nvme0n1p1/REFs/blast/
#wget ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/nt.gz
#wget ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/nr.gz
#perl update_blastdb.pl --decompress nt
#perl update_blastdb.pl --decompress nr
##https://www.ncbi.nlm.nih.gov/books/NBK569850/
#update_blastdb.pl --decompress nt
#update_blastdb.pl --decompress nr
#curl ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/nr.gz -O
#curl ftp://ftp.ncbi.nlm.nih.gov/blast/db/FASTA/nt.gz -O
##makeblastdb -in exons_for_blastall.fasta -input_type fasta -dbtype nucl -title exons_for_blastall -parse_seqids -out exons_for_blastall
#makeblastdb -in nt -out nt -parse_seqids -dbtype nucl
#makeblastdb -in nr -out nr -parse_seqids -dbtype prot
##curl ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz -O
##curl "ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/Pfam-A.hmm.gz" | gunzip > Pfam-A.hmm.txt
##curl "ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/database_files/pfamA_tax_depth.txt.gz" | gunzip > pfamA_tax_depth.txt
##or:
##NO_THIS_SCRIPT: ./get_blast.sh

#Standard databases (nr etc.): rRNA/ITS databases Genomic + transcript databases Betacoronavirus
#curl ftp://ftp.ncbi.nlm.nih.gov/blast/db/Betacoronavirus.tar.gz -O
#The contents are the same between https://ftp.ncbi.nlm.nih.gov/blast/db/ and https://ftp.ncbi.nlm.nih.gov/blast/db/v5/ since v5 is the default!
#https://ftp.ncbi.nlm.nih.gov/blast/db/nt-nucl-metadata.json    #158
for no in 000 001 002 003 004 005 006 007 008 009  010 011 012 013 014 015 016 017 018 019  020 021 022 023 024 025 026 027 028 029  030 031 032 033 034 035 036 037 038 039  040 041 042 043 044 045 046 047 048 049  050 051 052 053 054 055 056 057 058 059  060 061 062 063 064 065 066 067 068 069  070 071 072 073 074 075 076 077 078 079  080 081 082 083 084 085 086 087 088 089  090 091 092 093 094 095 096 097 098 099  100 101 102 103 104 105 106 107 108 109  110 111 112 113 114 115 116 117 118 119  120 121 122 123 124 125 126 127 128 129  130 131 132 133 134 135 136 137 138 139  140 141 142 143 144 145 146 147 148 149  150 151 152 153 154 155 156 157; do
  curl ftp://ftp.ncbi.nlm.nih.gov/blast/db/nt.${no}.tar.gz -O
done
#https://ftp.ncbi.nlm.nih.gov/blast/db/nr-prot-metadata.json    #103
for no in 00 01 02 03 04 05 06 07 08 09  10 11 12 13 14 15 16 17 18 19  20 21 22 23 24 25 26 27 28 29  30 31 32 33 34 35 36 37 38 39  40 41 42 43 44 45 46 47 48 49  50 51 52 53 54 55 56 57 58 59  60 61 62 63 64 65 66 67 68 69  70 71 72 73 74 75 76 77 78 79  80 81 82 83 84 85 86 87 88 89  90 91 92 93 94 95 96 97 98 99  100 101 102; do
  curl ftp://ftp.ncbi.nlm.nih.gov/blast/db/nr.${no}.tar.gz -O
done
tar xzf *tar.gz
##Sind die RNA-data (Transcriptome)? by default is RNA-data
#damian_database.rb  --erase_and_rebuild --names blast_2020_install/taxdump/names.dmp --nodes blast_2020_install/taxdump/nodes.dmp --hmm pfam/Pfam-A.hmm.txt --taxdepth pfam/#pfamA_tax_depth.txt #pfam annotation cannot be updated!!

3, create .ncbirc and setting

#in the file /home/jhuang/.ncbirc
BLASTDB=/mnt/nvme0n1p1/REFs/blast/
#echo "[BLAST]" > /home/jhuang/.ncbirc
#echo "BLASTDB=/media/jhuang/Elements1/BLAST_db_v5/nt_v5/" >> /home/jhuang/.ncbirc

#mv damian_release damian
# add damian into PATH
DAMIAN_LOCATION='/home/jhuang/Tools/damian'
export PATH=$PATH:$DAMIAN_LOCATION

4, generate bowtie2 index and set damian_reference

##human
##Using existing index /ref/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.
#
##Horse (equCab2)
#rsync -a -P rsync://hgdownload.soe.ucsc.edu/goldenPath/equCab2/bigZips/chromFa.tar.gz ./
##Cattle  NCBI Genome ID: 82 (Bos taurus)
#rsync -a -P rsync://hgdownload.soe.ucsc.edu/goldenPath/bosTau8/bigZips/bosTau8.fa.gz ./
##ftp://ftp.ensembl.org/pub/release-95/fasta/bos_taurus/dna/
#
##Sheep NCBI Genome ID: 83 (Ovis aries)
#rsync -a -P rsync://hgdownload.soe.ucsc.edu/goldenPath/oviAri4/bigZips/oviAri4.fa.gz ./
#
##Wild boar  NCBI Genome ID: 84 (Sus scrofa)
#rsync -a -P rsync://hgdownload.soe.ucsc.edu/goldenPath/susScr11/bigZips/susScr11.fa.gz ./
#
##salmon salar
#https://www.ncbi.nlm.nih.gov/genome/369?genome_assembly_id=248466
#https://www.ncbi.nlm.nih.gov/genome/?term=salmo%20salar
#https://www.ncbi.nlm.nih.gov/assembly/?term=salmon+salar
#rsync -avz /ref/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa jhuang@10.162.6.119:/home/jhuang/DATA/
#rsync -a -P salmon_salar_assemblies.tar jhuang@10.162.6.119:/home/jhuang/REFs
#
##Mosquitoes/culex pipiens
#https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?lvl=0&id=233155
#https://www.biorxiv.org/content/10.1101/240747v1.full
#aedes mascarensis
#Aedes albopictus
#
#Taxonomy ID: 7176 (Culex quinquefasciatus (southern house mosquito))
#https://www.ncbi.nlm.nih.gov/nuccore/?term=C.+pipiens
#https://www.ncbi.nlm.nih.gov/assembly?LinkName=bioproject_assembly_all&from_uid=18751
#https://www.ncbi.nlm.nih.gov/genome/?term=txid7176[orgn]
#https://www.ncbi.nlm.nih.gov/assembly/GCF_000208785.1/
#https://www.ncbi.nlm.nih.gov/genome/?term=txid263438[orgn]
#
#Taxonomy ID: 7175 (C. pipiens) --> no genome
#https://www.ncbi.nlm.nih.gov/genome/?term=txid7175[orgn]
#https://www.ncbi.nlm.nih.gov/assembly/GCF_000209185.1
#rsync -a -P GCF_000209185_1_CulPip1_0_genomic.fna.gz jhuang@10.162.6.119:/home/jhuang/REFs

rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Ovis_aries.Oar_v3.1.dna.toplevel.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Ovis_aries.Oar_v3.1.cdna.all.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Ovis_aries.Oar_v3.1.ncrna.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Sus_scrofa.Sscrofa11.1.dna.toplevel.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Sus_scrofa.Sscrofa11.1.cdna.all.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Sus_scrofa.Sscrofa11.1.ncrna.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Bos_taurus.ARS-UCD1.2.dna.toplevel.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Bos_taurus.ARS-UCD1.2.cdna.all.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Bos_taurus.ARS-UCD1.2.ncrna.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Equus_caballus.EquCab3.0.dna.toplevel.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Equus_caballus.EquCab3.0.cdna.all.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Equus_caballus.EquCab3.0.ncrna.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Salmo_salar.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/GCF_000209185_1_CulPip1_0_genomic.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Macaca_mulatta.Mmul_8.0.1.dna.toplevel.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Macaca_mulatta.Mmul_8.0.1.cdna.all.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Macaca_mulatta.Mmul_8.0.1.ncrna.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Ovis_aries_musimon.fa .
rsync -a -P jhuang@10.162.6.119:/home/jhuang/REFs/Cervus_elaphus_hippelaphus.fa  .

#damian_reference.rb --add --host hg38 --type both --fasta /mnt/h/jhuang/ref/Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa --primary --description 'Homo_sapiens_UCSC_hg38 (dna)'
#damian_reference.rb --add --host wildboar --type both --fasta /home/jhuang/REFs/susScr11.fa --primary --description 'Wild boar  NCBI Genome ID: 84 (Sus scrofa) (dna)'
#damian_reference.rb --add --host horse --type both --fasta /home/jhuang/REFs/equCab2.fa --primary --description 'Horse equCab2 (dna)'
#damian_reference.rb --add --host salmon --type both --fasta /home/jhuang/REFs/salmon_salar.fa --primary --description 'Salmon salar RefSeq assembly accession: GCF_000233375.1 (dna)'
##damian_reference.rb --add --host sheep --type both --fasta /home/jhuang/REFs/oviAri4.fa --primary --description 'Sheep NCBI Genome ID: 83 (Ovis aries) (dna)'
##damian_reference.rb --add --host cattle --type both --fasta /home/jhuang/REFs/bosTau8.fa --primary --description 'Cattle  NCBI Genome ID: 82 (Bos taurus) (dna)'
##damian_reference.rb --add --host mosquito --type both --fasta /home/jhuang/REFs/GCF_000209185_1_CulPip1_0_genomic.fa --primary --description 'Culex pipiens quinquefasciatus (dna)'

# -- host index anlegen with ensemble-files --
ftp://ftp.ensembl.org/pub/release-95/fasta/ovis_aries/dna/
#human and human3
damian_reference.rb --add  --host human --type both --fasta ./Homo_sapiens.GRCh38.dna.toplevel.fa --primary --description 'Homo sapiens (dna)'
damian_reference.rb --add  --host human --type rna --fasta ./Homo_sapiens.GRCh38.cdna.all.fa --description 'Homo sapiens (cdna)'
damian_reference.rb --add  --host human --type rna --fasta ./Homo_sapiens.GRCh38.ncrna.fa --description 'Homo sapiens (ncrna)'
#human3 (since for some fastqs, human delete too much and too strictly, therefore we genertate human3 for loose filtering of human reads.
damian_reference.rb --add  --host human3 --type both --fasta ./genome.fa --primary --description 'Homo_sapiens_UCSC_hg38 (dna)'
damian_reference.rb --add  --host human3 --type rna --fasta ./Homo_sapiens.GRCh38.cdna.all.fa --description 'Homo sapiens (cdna)'
damian_reference.rb --add  --host human3 --type rna --fasta ./Homo_sapiens.GRCh38.ncrna.fa --description 'Homo sapiens (ncrna)'

#sheep
damian_reference.rb --add  --host sheep --type both --fasta Ovis_aries.Oar_v3.1.dna.toplevel.fa --primary --description 'Ovis aries (dna)'
damian_reference.rb --add  --host sheep --type rna --fasta Ovis_aries.Oar_v3.1.cdna.all.fa --description 'Ovis aries (cdna)'
damian_reference.rb --add  --host sheep --type rna --fasta Ovis_aries.Oar_v3.1.ncrna.fa --description 'Ovis aries (ncrna)'
#pig
damian_reference.rb --add  --host pig --type both --fasta Sus_scrofa.Sscrofa11.1.dna.toplevel.fa --primary --description 'Sus scrofa (dna)'
damian_reference.rb --add  --host pig --type rna --fasta Sus_scrofa.Sscrofa11.1.cdna.all.fa --description 'Sus scrofa (cdna)'
damian_reference.rb --add  --host pig --type rna --fasta Sus_scrofa.Sscrofa11.1.ncrna.fa --description 'Sus scrofa (ncrna)'
#cow
damian_reference.rb --add  --host cow --type both --fasta Bos_taurus.ARS-UCD1.2.dna.toplevel.fa --primary --description 'Bos taurus (dna)'
damian_reference.rb --add  --host cow --type rna --fasta Bos_taurus.ARS-UCD1.2.cdna.all.fa --description 'Bos taurus (cdna)'
damian_reference.rb --add  --host cow --type rna --fasta Bos_taurus.ARS-UCD1.2.ncrna.fa --description 'Bos taurus (ncrna)'

#horse
damian_reference.rb --add  --host horse --type both --fasta ./Equus_caballus.EquCab3.0.dna.toplevel.fa --primary --description 'Equus caballus (dna)'
damian_reference.rb --add  --host horse --type rna --fasta ./Equus_caballus.EquCab3.0.cdna.all.fa --description 'Equus caballus (cdna)'
damian_reference.rb --add  --host horse --type rna --fasta ./Equus_caballus.EquCab3.0.ncrna.fa --description 'Equus caballus (ncrna)'
#salmo
damian_reference.rb --add  --host Salmo_salar --type both --fasta Salmo_salar.fa --primary --description 'Salmo salar (dna)'
#mosquito
damian_reference.rb --add  --host Culex_pipiens --type both --fasta GCF_000209185_1_CulPip1_0_genomic.fa --primary --description 'Culex pipiens (dna)'
#macaque
damian_reference.rb --add  --host macaque --type both --fasta ./Macaca_mulatta.Mmul_8.0.1.dna.toplevel.fa --primary --description 'Macaca mulatta (dna)'
damian_reference.rb --add  --host macaque --type rna --fasta ./Macaca_mulatta.Mmul_8.0.1.cdna.all.fa --description 'Macaca mulatta (cdna)'
damian_reference.rb --add  --host macaque --type rna --fasta ./Macaca_mulatta.Mmul_8.0.1.ncrna.fa --description 'Macaca mulatta (ncrna)'

#mouflon
damian_reference.rb --add  --host mouflon --type both --fasta ./Ovis_aries_musimon.fa --primary --description 'Ovis aries musimon (dna)'

#reddeer
damian_reference.rb --add  --host reddeer --type both --fasta ./Cervus_elaphus_hippelaphus.fa --primary --description 'Cervus elaphus hippelaphus (dna)'

##icebear
#damian_reference.rb --add  --host polarbear --type both --fasta ./Ursus_maritimus.UrsMar_1.0.dna.toplevel.fa --primary --description 'Ursus_maritimus (dna)'

##Der Graue Mausmaki (Microcebus murinus) ist eine Primatenart aus der Gattung der Mausmakis innerhalb der Gruppe der Lemuren.
#damian_reference.rb --add  --host lemur --type both --fasta ./Mmur3.0.fa --primary --description 'Microcebus murinus (dna)'

5, install and configure mutt

sudo apt install mutt

#in ~/.muttrc
set imap_user = 'xxx@yyy.com'
set imap_pass = 'xxxx'
set from= $imap_user
set use_from=yes
set realname='XXX YYY'
set folder = imaps://imap-mail.outlook.com:993
set spoolfile = "+INBOX"
set postponed="+[hotmail]/Drafts"
set mail_check = 100
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set smtp_url = "smtp://$imap_user@smtp-mail.outlook.com:587"
set smtp_pass = $imap_pass
set move = no
set imap_keepalive = 900
set record="+Sent"

Test: echo -e "Hi XXX,\n\nPlease find attached the latest results from our DAMIAN analysis.\n\nBest,\nYYY" | mutt -s "New results from DAMIAN" -- "xxx@googlemail.com"

6, intermediate commands

--1-- hmmsearch --domE 0.00001 -o /dev/null --domtblout /home/jhuang/rtpd_files/HD04_cons/idba_ud_assembly/domain.table --noali --cpu 10 /home/jhuang/Tools/damian/databases/pfam/Pfam-A.hmm.txt /home/jhuang/rtpd_files/HD04_cons/idba_ud_assembly/orfs.fasta
--2-- megablast
--3-- blastn or blastp
/home/jhuang/Tools/damian/3rd_party/ncbi-blast/bin/blastp -task blastp -evalue 10E-2 -num_threads 26 -query /tmp/rtpd__565_20190514-28525-1cqkejq -db nr -outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore staxids qcovs qcovhsp
/home/jhuang/Tools/damian/3rd_party/ncbi-blast/bin/blastp -task blastp -evalue 10E-2 -num_threads 10 -query /tmp/rtpd__584_20190515-11072-i8ct4h -db nr -outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore staxids qcovs qcovhsp
/home/jhuang/Tools/damian/3rd_party/ncbi-blast/bin/blastn -task blastn -evalue 10E-2 -num_threads 10 -query /tmp/rtpd__586_20190515-6605-1wfobqe -db nt -outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore staxids qcovs qcovhsp

7, Verifying the installation

#damian.rb --left selftest/r1.fastq.gz --right selftest/r2.fastq.gz --sample testrun --threads 12

seqtk sample -s100 ./240621_M03701_0312_000000000-GHL9N/p20534/7448_7501_S0_R1_001.fastq.gz 0.1 > R1_0.1.fastq
seqtk sample -s100 ./240621_M03701_0312_000000000-GHL9N/p20534/7448_7501_S0_R2_001.fastq.gz 0.1 > R2_0.1.fastq

cd /mnt/nvme0n1p1/REFs/blast
damian.rb --host human3 --type rna -1 R1_0.1.fastq -2 R2_0.1.fastq --sample p20534_7448_7501_S0_megablast --blastn never --blastp never --min_contiglength 500 --threads 64 --force
damian_report.rb
zip -r p20534_7448_7501_S0_megablast.zip p20534_7448_7501_S0_megablast/
echo -e "Hi XXX,\n\nPlease find attached the latest results from our DAMIAN analysis.\n\nBest,\nYYY" | mutt -a "./p20534_7448_7501_S0_megablast.zip" -s "New results from DAMIAN" -- "xxx@googlemail.com"
damian.rb --host human3 --type rna -1 R1_0.1.fastq -2 R2_0.1.fastq --sample p20534_7448_7501_S0_blastn --blastn progressive --blastp never --min_contiglength 500 --threads 64 --force
damian_report.rb
zip -r p20534_7448_7501_S0_blastn.zip p20534_7448_7501_S0_blastn/
echo -e "Hi XXX,\n\nPlease find attached the latest results from our DAMIAN analysis.\n\nBest,\nYYY" | mutt -a "./p20534_7448_7501_S0_blastn.zip" -s "New results from DAMIAN" -- "xxx@googlemail.com"
damian.rb --host human3 --type rna -1 R1_0.1.fastq -2 R2_0.1.fastq --sample p20534_7448_7501_S0_blastp --blastn never --blastp progressive --min_contiglength 500 --threads 64 --force
damian_report.rb
zip -r p20534_7448_7501_S0_blastp.zip p20534_7448_7501_S0_blastp/
echo -e "Hi XXX,\n\nPlease find attached the latest results from our DAMIAN analysis.\n\nBest,\nYYY" | mutt -a "./p20534_7448_7501_S0_blastp.zip" -s "New results from DAMIAN" -- "xxx@googlemail.com"

How to run PICRUSt2 (v2)?

https://github.com/picrust/picrust2/wiki/Infer-pathway-abundances

  1. Difference between unstratified and stratified

    In the context of PICRUSt2 (Phylogenetic Investigation of Communities by Reconstruction of Unobserved States), unstratified and stratified outputs refer to different ways of presenting the predicted functional profiles of microbial communities.
    
    1. Unstratified Output:
    
        Definition: Unstratified output provides the overall predicted abundance of each function (e.g., gene families, metabolic pathways) across the entire microbial community.
        Characteristics:
            Summarized Data: It aggregates the functional predictions for all taxa in a sample, giving a single abundance value for each function.
            No Taxonomic Information: Does not break down the contribution of each specific taxon to the predicted function. It only provides the total abundance of each function without detailing which taxa are contributing to those functions.
            Use Case: Useful when the overall functional potential of a microbial community is of interest without needing to know the contribution of individual taxa. It simplifies the data and reduces complexity.
        Example: If you are interested in the total predicted abundance of a specific gene across all microbes in a sample, you would use the unstratified output.
    
    2. Stratified Output:
    
        Definition: Stratified output provides the predicted abundance of each function, but also stratifies (or breaks down) this data by the taxonomic origin of the microbes contributing to each function.
        Characteristics:
            Detailed Data: It provides more granular information by showing the predicted abundance of each function for each taxon in the community.
            Taxonomic Breakdown: This output allows you to see how much each taxon (e.g., a specific species or genus) contributes to the predicted abundance of each function.
            Use Case: Useful for understanding the functional contributions of specific taxa within a microbial community. It provides insight into which organisms are potentially driving certain functions within a community.
        Example: If you want to know which specific microbes are contributing to the abundance of a certain gene, the stratified output will give you this information by listing the abundance of that gene for each taxon.
    
    Key Differences:
    
        Level of Detail: Unstratified output provides a high-level summary, whereas stratified output offers a detailed breakdown by taxon.
        Data Granularity: Stratified output is more granular and complex, while unstratified output is simpler and more straightforward.
        Purpose: The choice between unstratified and stratified depends on whether you are interested in the total functional potential of the community (unstratified) or in understanding the functional roles of specific taxa (stratified).
    
    Summary:
    
        Unstratified: Overall predicted functional abundance without taxonomic breakdown.
        Stratified: Predicted functional abundance with detailed taxonomic breakdown for each function.
    
    在PICRUSt2(通过重建未观测状态进行群落的系统发育调查)的背景下,**未分层(unstratified)和分层(stratified)**输出是指呈现微生物群落的预测功能特征的不同方式。
    1. 未分层(Unstratified)输出:
    
        定义:未分层输出提供了整个微生物群落中每个功能(例如,基因家族、代谢途径)的总体预测丰度。
        特点:
            汇总数据:它汇总了样本中所有分类单元的功能预测,为每个功能提供一个总的丰度值。
            无分类信息:不显示每个具体分类单元对预测功能的贡献,仅提供每个功能的总丰度,而不细分哪些分类单元在贡献这些功能。
            适用场景:当对微生物群落的总体功能潜力感兴趣,而不需要知道单个分类单元的贡献时,未分层输出是有用的。它简化了数据,减少了复杂性。
        示例:如果你感兴趣的是一个样本中所有微生物的特定基因的总预测丰度,你可以使用未分层输出。
    
    2. 分层(Stratified)输出:
    
        定义:分层输出提供了每个功能的预测丰度,同时按贡献这些功能的微生物的分类来源进行了分层。
        特点:
            详细数据:通过显示群落中每个分类单元的每个功能的预测丰度,提供了更详细的信息。
            分类细分:这种输出方式可以让你看到每个分类单元(例如,具体的物种或属)对每个功能的预测丰度的贡献。
            适用场景:当需要了解特定分类单元在微生物群落中的功能贡献时,分层输出是有用的。它提供了哪些微生物可能在群落中驱动特定功能的见解。
        示例:如果你想知道哪些具体的微生物在贡献某个基因的丰度,分层输出将提供此信息,列出每个分类单元的该基因丰度。
    
    关键区别:
    
        细节层次:未分层输出提供的是一个高级概述,而分层输出则提供按分类单元的详细细分。
        数据粒度:分层输出更为细化和复杂,而未分层输出更为简单和直接。
        用途:选择未分层还是分层,取决于你是对群落的总体功能潜力感兴趣(未分层),还是希望了解特定分类单元的功能作用(分层)。
    
    总结:
    
        未分层(Unstratified):总体的预测功能丰度,不包含分类细分。
        分层(Stratified):包含详细分类细分的预测功能丰度。
    
    For analyzing differential pathways expressed between two sample groups, you should use the unstratified input in PICRUSt2.
    Reason for Choosing Unstratified Input:
    
        Focus on Overall Functional Differences: When comparing the functional profiles of two groups of samples, the primary interest is often in identifying which pathways are differentially abundant overall between the groups, regardless of which specific taxa are contributing to these differences. Unstratified input provides a summary of the total abundance of each function or pathway across the entire microbial community in each sample group, making it easier to compare the overall functional profiles.
    
        Simpler and More Direct Comparison: Unstratified data aggregates the functional predictions for all taxa within each sample. This aggregation simplifies the comparison between groups because it provides a single value per function or pathway for each sample, allowing for straightforward statistical testing of differential abundance.
    
        Reduces Complexity: Stratified input, which breaks down functional contributions by taxa, adds a layer of complexity that is not necessary for identifying overall differential pathways between groups. The unstratified output eliminates this complexity and focuses purely on the functions themselves, rather than on which specific taxa are contributing to these functions.
    
    When to Use Stratified Input:
    
        If you are interested in which specific taxa are responsible for the differences in pathway abundances between the two groups, then stratified input would be useful. It allows you to see not only which pathways are differentially expressed but also how the contribution of these pathways varies across different taxa.
    
    Summary:
    
        For identifying differential pathways expressed between two sample groups, use unstratified input to focus on the overall differences in functional profiles without considering the taxonomic breakdown.
        Use stratified input if you need to understand the taxonomic origins of these functional differences.
  2. Pathway inference

    Input files:
        *_metagenome_out/*unstrat.tsv.gz
    
    Mapfiles:
        KEGG_pathways_to_KO.tsv
        KEGG_modules_to_KO.tsv
        * ec_level4_to_metacyc_rxn.tsv
        * metacyc_path2rxn_struc_filt_pro.txt
        metacyc_path2rxn_struc_filt_euk.txt
        metacyc_pathways_structured_filtered
        metacyc_path2rxn_struc_filt_fungi.txt
        metacyc_path2rxn_struc_filt_fungi_present.txt
        metacyc_rxn_to_level4ec.tsv
    
    Output files:
        ./MetaCyc_pathways_out/path_abun_unstrat.tsv
        ./KEGG_pathways_out/path_abun_unstrat.tsv
    
    #The default is to map the EC numbers to Metacyc reactions and then to Metacyc Pathways. ERROR: runtime is too long!
    #pathway_pipeline.py -i EC_metagenome_out/pred_metagenome_contrib.tsv.gz -o pathways_out -p 80
    
    #FILE_GENERATED_FOR_DOWNSTREAM: Map EC numbers to MetaCyc pathways and get stratified output corresponding to contribution of predicted gene family abundances within each predicted genome:
    pathway_pipeline.py -i EC_metagenome_out/pred_metagenome_unstrat.tsv.gz -o MetaCyc_pathways_out_per_seq_contrib -p 80 --per_sequence_contrib --per_sequence_abun EC_metagenome_out/seqtab_norm.tsv.gz --per_sequence_function EC_predicted.tsv.gz
    
    ##ERROR: pred_metagenome_strat.tsv.gz does not exist. Mapping predicted KO abundances to legacy KEGG pathways (with stratified output that represents contributions to community-wide abundances):
    ##Why use '--no_gregroup'? no rows remain after regrouping input table. The default pathway and regroup mapfiles are meant for EC numbers. Note that KEGG pathways are not supported since KEGG is a closed-source database, but you can input custom pathway mapfiles if you have access. If you are using a custom function database did you mean to set the --no-regroup flag and/or change the default pathways mapfile used?
    
    #pathway_pipeline.py -i KO_metagenome_out/pred_metagenome_strat.tsv.gz -o KEGG_pathways_out -p 80  --no_regroup --map /home/jhuang/Tools/picrust2/picrust2/default_files/pathway_mapfiles/KEGG_pathways_to_KO.tsv
    
    #FILE_GENERATED_FOR_DOWNSTREAM
    pathway_pipeline.py -i KO_metagenome_out/pred_metagenome_unstrat.tsv.gz -o KEGG_pathways_out -p 80  --no_regroup --map /home/jhuang/Tools/picrust2/picrust2/default_files/pathway_mapfiles/KEGG_pathways_to_KO.tsv
    pathway_pipeline.py -i KO_metagenome_out/pred_metagenome_unstrat.tsv.gz -o KEGG_pathways_out_per_seq_contrib -p 80  --per_sequence_contrib --per_sequence_abun KO_metagenome_out/seqtab_norm.tsv.gz --per_sequence_function KO_predicted.tsv.gz  --no_regroup --map /home/jhuang/Tools/picrust2/picrust2/default_files/pathway_mapfiles/KEGG_pathways_to_KO.tsv
    
    #Note that the path of map files is under /home/jhuang/Tools/picrust2/picrust2/default_files/pathway_mapfiles
    #ERROR: COG does not fit the pathway_mapfiles KEGG_pathways_to_KO.tsv??
    #pathway_pipeline.py -i COG_metagenome_out/pred_metagenome_contrib.tsv.gz -o COG_pathways_out -p 80 --no_regroup --map /home/jhuang/Tools/picrust2/picrust2/default_files/pathway_mapfiles/KEGG_pathways_to_KO.tsv
    
    # The files KEGG_pathways_out/path_abun_unstrat.tsv KEGG_pathways_out_per_seq_contrib/path_abun_unstrat.tsv are the same!!!!!!!
    diff KEGG_pathways_out/path_abun_unstrat.tsv KEGG_pathways_out_per_seq_contrib/path_abun_unstrat.tsv
  3. Add descriptions to 5(gene_family)+2(pathway) tables

    #description_mapfiles
        KEGG_pathways_info.tsv.gz
        KEGG_modules_info.tsv.gz
        metacyc_pathways_info.txt.gz
        ec_level4_info.tsv.gz
        cog_info.tsv.gz
        tigrfam_info.tsv.gz
        pfam_info.tsv.gz
        ko_info.tsv.gz
    
    #--6.1. Add descriptions in gene family tables
    # EC and METACYC is a pair, EC for gene_annotation and METACYC for pathway_annotation, therefore we have 5 m-options for gene family tables, 1 m-option for pathway abundance table, for KEGG a custom description_mapfile is needed.
    add_descriptions.py -i COG_metagenome_out/pred_metagenome_unstrat.tsv.gz -m COG -o COG_metagenome_out/pred_metagenome_unstrat_descrip.tsv.gz
    add_descriptions.py -i EC_metagenome_out/pred_metagenome_unstrat.tsv.gz -m EC -o EC_metagenome_out/pred_metagenome_unstrat_descrip.tsv.gz
    add_descriptions.py -i KO_metagenome_out/pred_metagenome_unstrat.tsv.gz -m KO -o KO_metagenome_out/pred_metagenome_unstrat_descrip.tsv.gz
    add_descriptions.py -i PFAM_metagenome_out/pred_metagenome_unstrat.tsv.gz -m PFAM -o PFAM_metagenome_out/pred_metagenome_unstrat_descrip.tsv.gz
    add_descriptions.py -i TIGRFAM_metagenome_out/pred_metagenome_unstrat.tsv.gz -m TIGRFAM -o TIGRFAM_metagenome_out/pred_metagenome_unstrat_descrip.tsv.gz
    
    #--6.2. Add descriptions in pathway abundance tables -m {METACYC,COG,EC,KO,PFAM,TIGRFAM}
    cd MetaCyc_pathways_out_per_seq_contrib
    add_descriptions.py -i path_abun_unstrat.tsv.gz -m METACYC -o path_abun_unstrat_descrip.tsv.gz
    gunzip path_abun_unstrat_descrip.tsv.gz
    cd ..
    cd KEGG_pathways_out_per_seq_contrib
    add_descriptions.py -i path_abun_unstrat.tsv.gz -o path_abun_unstrat_descrip.tsv.gz --custom_map_table /home/jhuang/Tools/picrust2/picrust2/default_files/description_mapfiles/KEGG_pathways_info.tsv.gz
    gunzip path_abun_unstrat_descrip.tsv.gz
    cd ..
  4. Difference between Kxxxxxxx (gene or protein) and koxxxxxxx (pathway)

    The terms "ORTHOLOGY: K10989" and "ko00001" refer to different concepts and components within the KEGG (Kyoto Encyclopedia of Genes and Genomes) database, which is used for understanding high-level functions and utilities of biological systems.
    1. ORTHOLOGY: K10989
        Definition: K10989 refers to a specific KEGG Orthology (KO) identifier.
        What It Represents: This identifier is assigned to a specific group of orthologous genes or proteins that perform the same function across different species. For example, K10989 might correspond to a particular enzyme or protein that is conserved across multiple organisms.
        Usage: K10989 is used to refer to a specific function at the gene/protein level. When you see "ORTHOLOGY: K10989," it indicates that this specific gene or protein in a genome has been classified under this orthology group.
    2. ko00001
        Definition: ko00001 refers to a specific KEGG pathway map identifier.
        What It Represents: This identifier is associated with a KEGG pathway, which is a collection of manually drawn pathway maps representing molecular interaction and reaction networks, such as metabolic pathways, signaling pathways, and more.
        Usage: ko00001 typically refers to a high-level map, like the KEGG pathway overview, which includes an entire collection of pathways or a very broad view of metabolism or other cellular processes. The "ko" prefix indicates that it is a KEGG Orthology-based pathway map.
    Summary of Differences:
        Scope:
            K10989 is specific to a particular orthologous group of genes/proteins.
            ko00001 refers to a broad KEGG pathway or map.
        Focus:
            K10989 focuses on the function of specific genes/proteins across species.
            ko00001 provides a visual representation of biological processes or pathways.
        Level of Detail:
            K10989 is detailed at the molecular or functional level of specific proteins/genes.
            ko00001 covers a broader, more comprehensive overview of biological systems or networks.
    These identifiers help researchers navigate between specific gene functions and broader biological processes within the KEGG database.
  5. Preparing the input files for STAMP, e.g. path_abun_unstrat_descrip.tsv.gz and metadata.tsv

    Input files needed for STAMP are:
        * pred_metagenome_unstrat_descrip.tsv.gz / path_abun_unstrat_descrip.tsv.gz (from STEP 3)
        * metadata.tsv (see below)
    
    cut -d$'\t' -f1 map_corrected.txt > 1
    cut -d$'\t' -f5 map_corrected.txt > 5
    cut -d$'\t' -f6 map_corrected.txt > 6
    paste -d$'\t' 1 5 > 1_5
    paste -d$'\t' 1_5 6 > metadata.tsv
    
    # NOTE_1: Modify '#SampleID' to 'SampleID' !!
        SampleID        Group   Sex_age
        1       Group1  f.aged
        2       Group1  f.aged
        5       Group1  f.aged
        ...
    
    # NOTE_2: for loading of EC[COG|KO|PFAM|TIGRFAM]_metagenome_out/pred_metagenome_unstrat_descrip.tsv, it doesn't work since 'Data does not form a strict hierarchy. Child FAD binding domain has multiple parents (e.g., PF00667, PF00890)'.
    
    # NOTE_3: for each pathway type (e.g. KEGG or MetaCyc), we need to restart the program. An example setting see STAMP_Screenshot.png.

    STAMP_Screenshot

  6. Install STAMP

    #https://github.com/picrust/picrust2/wiki/STAMP-example
    conda activate base
    conda install mamba
    
    # -- Install method 1 (Failed) --
    #https://beikolab.cs.dal.ca/software/Quick_installation_instructions_for_STAMP
    mamba create -n stamp_py2 python=2 pyqt=4 numpy scipy matplotlib biom-format stamp
    #pip install matplotlib
    pip install STAMP
    #Alternative: mamba create -n stamp bioconda::stamp
    
    # -- Install method 2 (Failed) --
    cd ~/Tools/STAMP-2.1.3
    python setup.py install
    #byte-compiling /home/jhuang/miniconda3/envs/stamp_py2/lib/python2.7/site-packages/stamp/metagenomics/StringHelper.py to StringHelper.pyc
    #running install_scripts
    #copying build/scripts-2.7/checkHierarchy.py -> /home/jhuang/miniconda3/envs/stamp_py2/bin
    #copying build/scripts-2.7/STAMP -> /home/jhuang/miniconda3/envs/stamp_py2/bin
    #changing mode of /home/jhuang/miniconda3/envs/stamp_py2/bin/checkHierarchy.py to 775
    #changing mode of /home/jhuang/miniconda3/envs/stamp_py2/bin/STAMP to 775
    #running install_data
    #copying LICENSE.txt -> /home/jhuang/miniconda3/envs/stamp_py2/.
    #creating /home/jhuang/miniconda3/envs/stamp_py2/manual
    #copying ./manual/STAMP_Users_Guide.pdf -> /home/jhuang/miniconda3/envs/stamp_py2/./manual
    #copying README.md -> /home/jhuang/miniconda3/envs/stamp_py2/.
    #running install_egg_info
    #Writing /home/jhuang/miniconda3/envs/stamp_py2/lib/python2.7/site-packages/STAMP-2.1.3-py2.7.egg-info
    python STAMP_test.py -v
    python STAMP.py
    #BUG: The two methods above could successfully install STAMP successfully, however, it stalls if starts? Try to install it on notebook!
    curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
    bash Miniforge3-$(uname)-$(uname -m).sh
    mamba install bioconda::stamp pyqt=4
    
    # -- Install method 3 (Failed) --
    #--Quick installation instructions for STAMP--
    #SUCCESSFUL install on Virtualbox 14 or 16
    sudo apt-get install libblas-dev liblapack-dev gfortran
    sudo apt-get install freetype* python-pip python-dev python-numpy python-scipy python-matplotlib
    sudo pip install STAMP  #pip could not find, manually download the pip-package and install with the following command
    sudo python setup.py install #in the STAMP-pip-library.
    #ImportError: No module named biom.parse
    sudo pip install --upgrade biom-format
    
    conda remove -n stamp --all
    #conda create -n stamp pyqt=4
    #conda activate stamp
    #conda install -c bioconda stamp
    conda config --show channels
    
    mamba create -n stamp_py2 pip python=2 pyqt=4 numpy scipy biom-format
    mamba activate stamp_py2
    #pip install matplotlib
    pip install stamp
    
    # -- Install method 4 (Failed) --
    conda remove stamp_pyqt4
    mamba install pyqt=4 stamp
    #conda install icu=56
    
    # -- Install method 5: Windows system on Virtualbox (Failed) --
    sudo apt update
    sudo apt install virtualbox
    sudo apt install virtualbox-ext-pack
    virtualbox
    #http://www.winwin7.com/Win7QiJianBan/XTZJWin7QiJianBan-116517.html
    #http://win.hgyji.com/fanqiexp.html
    #https://eprebys.faculty.ucdavis.edu/2020/04/08/installing-windows-xp-in-virtualbox-or-other-vm/
    https://jingyan.baidu.com/article/a17d52851540e08098c8f219.html
    https://msdn.cyanlemon.net/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/Windows%20XP/%E4%B8%AD%E6%96%87-%E7%AE%80%E4%BD%93/
    MRX3F-47B9T-2487J-KWKMF-RPWBY
    https://blog.51cto.com/u_16213618/11137698
    https://msdn.itellyou.cn/
    
    # -- Install method 6: STAMP_2_1_3.exe on Windows 7 in VirtualBox (Successful) --
  7. ALDEx2 (Not_Used!)

    https://bioconductor.org/packages/release/bioc/html/ALDEx2.html
  8. Convert png to svg and pdf

    inkscape error_bar.png --export-plain-svg=error_bar.svg (embbed)
    sudo apt update
    sudo apt install autotrace
    sudo apt-get install -y libpng-dev libtiff-dev imagemagick
    git clone https://github.com/autotrace/autotrace.git
    cd autotrace
    #sudo apt install intltool
    #sudo apt install gettext libglib2.0-dev
    #sudo apt install libtool libtool-bin
    #sudo apt install automake
    sudo apt-get install libxml-parser-perl
    ./autogen.sh
    ./configure
    make
    autotrace -output-format svg -output-file error_bar.svg error_bar.png

Extract beta-diversity from the Phyloseq results

I’m pleased to know the graphs have been useful. There is a significant difference in beta diversity between Group 2 and Group 6, as demonstrated by the PCA analysis and the attached boxplot. This plot clearly shows significant differences in beta diversity within Group 2 and Group 6, as well as between the two groups. The pairwise Bray-Curtis distances indicate substantial variability when comparing the distances from Group 2 to Group 6 against the distances within each group itself (Group 2 vs. Group 2 and Group 6 vs. Group 6). Additionally, I have included the pairwise Bray-Curtis distance values in an Excel table for the figure.

Comparison_of_Bray_Distances

In line with the principle of beta diversity, we expect the diversity between samples from different groups to be greater than the diversity within groups. Based on this principle, the adjusted p-values for the first two comparisons should be small (e.g., < 0.05), while the last value should approach 1. However, as per the standard, the beta diversity comparisons in Group1_vs_Group5, Group4_vs_Group8, and Group3_vs_Group7 are not significant (see details below).

    # in the file ~/DATA/Data_Marius_16S/core_diversity_e42369/bdiv_even42369_Group/unweighted_unifrac_boxplots/Group_Stats.txt

    #Group2_vs_Group6
    Group2_vs_Group2       Group6_vs_Group2       -3.79732911184  0.000339270171256 (0.0019)      0.238506930393     
    Group6_vs_Group6       Group6_vs_Group2       -4.28406536899  5.44434521753e-05 (4.9e-5)       0.0382737468793    
    Group6_vs_Group6       Group2_vs_Group2       -0.309361435009 0.758613384091 (0.32)  1            

    #Group1_vs_Group5
    Beta-diversity1 Beta-diversity2 t-statistic p-value Bonferroni-corrected p-value
    Group1_vs_Group1    Group5_vs_Group1    2.00417798376   0.0548104465256 1
    Group5_vs_Group5    Group5_vs_Group1    -3.25546483256  0.00335706567643    1
    Group5_vs_Group5    Group1_vs_Group1    -3.32676003333  0.00498942378132    1

    #Group4_vs_Group8
    Group4_vs_Group4    Group4_vs_Group8    1.05703763767   0.293598585458  1
    Group8_vs_Group8    Group4_vs_Group8    -2.81684107057  0.00619523703667    1
    Group4_vs_Group4    Group8_vs_Group8    3.60722199799   0.00074734776948    0.525385481945

    #Group3_vs_Group7
    Group7_vs_Group7    Group7_vs_Group3    -1.69330299127  0.0967469273622 1
    Group3_vs_Group3    Group7_vs_Group3    1.83751562431   0.07220131956   1

    #0.0003  0.2109
    #0.0002  0.1406
    #0.7601  1.0000

    #0.0590  1.0000
    #0.0033  1.0000
    #0.0066  1.0000

    #0.2950  1.0000
    #0.0063  1.0000
    #0.0007  0.4921

    #0.0945  1.0000
    #0.0684  1.0000
    #0.0155  1.0000

For pathway analysis, when we set the p-value threshold to < 0.01, no pathways were found to be enriched between Group1 and Group5, Group4 and Group8, or Group3 and Group7.

QIIME + Phyloseq + MicrobiotaProcess (v2)

diff_analysis_Group3_vs_Group7

PCoA2_labeled

1, MicrobiotaProcess_Group1_vs_Group5.R

# https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html
# -----------------------------------
# ---- prepare the R environment ----
#Rscript MicrobiotaProcess.R
#NOTE: exit R script, then login again R-environment; rm -rf Phyloseq*_cache
#mkdir figures
rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html')
# with #alpha = 2.0, running the following script further!
# ("1","2","5","6","7",  "15","16","17","18","19","20",  "29","30","31","32",  "40","41","42","43","44","46")
#div.df2[div.df2 == "Group1"] <- "aged.post"
#div.df2[div.df2 == "Group3"] <- "young.post"
#div.df2[div.df2 == "Group5"] <- "aged.post"
#div.df2[div.df2 == "Group7"] <- "young.post"
# ("8","9","10","12","13","14",  "21","22","23","24","25","26","27","28",  "33","34","35","36","37","38","39","51",  "47","48","49","50","52","53","55")
#div.df2[div.df2 == "Group2"] <- "aged.pre"
#div.df2[div.df2 == "Group4"] <- "young.pre"
#div.df2[div.df2 == "Group6"] <- "aged.pre"
#div.df2[div.df2 == "Group8"] <- "young.pre"
#Group1: f.aged and post
#Group2: f.aged and pre
#Group3: f.young and post
#Group4: f.young and pre
#Group5: m.aged and post
#Group6: m.aged and pre
#Group7: m.young and post
#Group8: m.young and pre
#[,c("1","2","5","6","7",                "8","9","10","12","13","14")]
#[,c("15","16","17","18","19","20",      "21","22","23","24","25","26","27","28")]
#[,c("29","30","31","32",                "33","34","35","36","37","38","39","51")]
#[,c("40","41","42","43","44","46",      "47","48","49","50","52","53","55")]
#For the first set:
    #a6cee3: This is a light blue color, somewhat pastel and soft.
    #b2df8a: A soft, pale green, similar to a light lime.
    #fb9a99: A soft pink, slightly peachy or salmon-like.
    #cab2d6: A pale purple, reminiscent of lavender or a light mauve.
#For the second set:
    #1f78b4: This is a strong, vivid blue, close to cobalt or a medium-dark blue.
    #33a02c: A medium forest green, vibrant and leafy.
    #e31a1c: A bright red, very vivid, similar to fire engine red.
    #6a3d9a: This would be described as a deep purple, akin to a dark lavender or plum.

# -----------------------------
# ---- 3.1. bridges other tools
##https://github.com/YuLab-SMU/MicrobiotaProcess
##https://www.bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc/MicrobiotaProcess.html
##https://chiliubio.github.io/microeco_tutorial/intro.html#framework
##https://yiluheihei.github.io/microbiomeMarker/reference/plot_cladogram.html
#BiocManager::install("MicrobiotaProcess")
#install.packages("microeco")
#install.packages("ggalluvial")
#install.packages("ggh4x")
library(MicrobiotaProcess)
library(microeco)
library(ggalluvial)
library(ggh4x)
library(gghalves)
library(tidyr)
## Convert the phyloseq object to a MicrobiotaProcess object
#mp <- as.MicrobiotaProcess(ps.ng.tax)
#mt <- phyloseq2microeco(ps.ng.tax) #--> ERROR
#abundance_table <- mt$abun_table
#taxonomy_table <- mt$tax_table
#ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE)
#ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE)
##OPTION1 (NOT_USED): take all samples, prepare ps.ng.tax_abund --> mpse_abund
##mpse <- ps.ng.tax %>% as.MPSE()
#mpse_abund <- ps.ng.tax_abund %>% as.MPSE()
##OPTION2 (USED!): take partial samples, prepare ps.ng.tax or ps.ng.tax_abund (2 replacements!)--> ps.ng.tax_sel --> mpse_abund
ps.ng.tax_sel <- ps.ng.tax_abund
##otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("1","2","5","6","7",  "15","16","17","18","19","20",  "29","30","31","32",  "40","41","42","43","44","46")]
##NOTE: Only choose Group2, Group4, Group6, Group8
#> ps.ng.tax_sel
#otu_table()   OTU Table:         [ 37465 taxa and 29 samples ]
#sample_data() Sample Data:       [ 29 samples by 10 sample variables ]
#tax_table()   Taxonomy Table:    [ 37465 taxa by 7 taxonomic ranks ]
#phy_tree()    Phylogenetic Tree: [ 37465 tips and 37461 internal nodes ]
otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax_abund)[,c("1","2","5","6","7",  "29","30","31","32")]
mpse_abund <- ps.ng.tax_sel %>% as.MPSE()
# A MPSE-tibble (MPSE object) abstraction: 2,352 × 20
# NOTE mpse_abund contains 20 variables: OTU, Sample, Abundance, BarcodeSequence, LinkerPrimerSequence, FileInput, Group,
#   Sex_age 
, pre_post_stroke , Conc , Vol_50ng , Vol_PCR , Description , # Domain , Phylum , Class , Order , Family , Genus , Species # ———————————– # —- 3.2. alpha diversity analysis # Rarefied species richness + RareAbundance mpse_abund %<>% mp_rrarefy() # ‘chunks’ represent the split number of each sample to calculate alpha # diversity, default is 400. e.g. If a sample has total 40000 # reads, if chunks is 400, it will be split to 100 sub-samples # (100, 200, 300,…, 40000), then alpha diversity index was # calculated based on the sub-samples. # ‘.abundance’ the column name of abundance, if the ‘.abundance’ is not be # rarefied calculate rarecurve, user can specific ‘force=TRUE’. mpse_abund %<>% mp_cal_rarecurve( .abundance = RareAbundance, chunks = 400 ) # The RareAbundanceRarecurve column will be added the colData slot # automatically (default action=”add”) #NOTE mpse_abund contains 22 varibles = 20 varibles + RareAbundance + RareAbundanceRarecurve # default will display the confidence interval around smooth. # se=TRUE # NOTE that two colors #c(“#00A087FF”, “#3C5488FF”) for .group = pre_post_stroke; four colors c(“#1f78b4”, “#33a02c”, “#e31a1c”, “#6a3d9a”) for .group = Group; p1 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, ) p2 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, .group = Group ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) # combine the samples belong to the same groups if plot.group=TRUE p3 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = “Observe”, .group = Group, plot.group = TRUE ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”),guide=”none”) png(“rarefaction_of_samples_or_groups.png”, width=1080, height=600) p1 + p2 + p3 dev.off() # —————————————— # 3.3. calculate alpha index and visualization library(ggplot2) library(MicrobiotaProcess) mpse_abund %<>% mp_cal_alpha(.abundance=RareAbundance) mpse_abund #NOTE mpse_abund contains 28 varibles = 22 varibles + Observe , Chao1 , ACE , Shannon , Simpson , Pielou f1 <- mpse_abund %>% mp_plot_alpha( .group=Group, .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) f2 <- mpse_abund %>% mp_plot_alpha( .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) #ps.ng.tax_sel contais only pre samples –> f1 cannot be generated! png(“alpha_diversity_comparison.png”, width=1400, height=600) f1 / f2 dev.off() # ——————————————- # 3.4. The visualization of taxonomy abundance (Class) mpse_abund %<>% mp_cal_abundance( # for each samples .abundance = RareAbundance ) %>% mp_cal_abundance( # for each groups .abundance=RareAbundance, .group=Group ) mpse_abund #NOTE mpse_abund contains 29 varibles = 28 varibles + RelRareAbundanceBySample # visualize the relative abundance of top 20 phyla for each sample. # .group=time, p1 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = TRUE ) # visualize the abundance (rarefied) of top 20 phyla for each sample. # .group=time, p2 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = FALSE ) png(“relative_abundance_and_abundance.png”, width= 1200, height=600) #NOT PRODUCED! p1 / p2 dev.off() #—- h1 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = TRUE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) h2 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = FALSE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) # the character (scale or theme) of figure can be adjusted by set_scale_theme # refer to the mp_plot_dist png(“relative_abundance_and_abundance_heatmap.png”, width= 1200, height=600) aplot::plot_list(gglist=list(h1, h2), tag_levels=”A”) dev.off() # visualize the relative abundance of top 20 class for each .group (Group) p3 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group=Group, taxa.class = Class, topn = 20, plot.group = TRUE ) # visualize the abundance of top 20 phyla for each .group (time) p4 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group= Group, taxa.class = Class, topn = 20, relative = FALSE, plot.group = TRUE ) png(“relative_abundance_and_abundance_groups.png”, width= 1000, height=1000) p3 / p4 dev.off() # ————————— # 3.5. Beta diversity analysis # ——————————————— # 3.5.1 The distance between samples or groups # standardization # mp_decostand wraps the decostand of vegan, which provides # many standardization methods for community ecology. # default is hellinger, then the abundance processed will # be stored to the assays slot. mpse_abund %<>% mp_decostand(.abundance=Abundance) mpse_abund #NOTE mpse_abund contains 30 varibles = 29 varibles + hellinger # calculate the distance between the samples. # the distance will be generated a nested tibble and added to the # colData slot. mpse_abund %<>% mp_cal_dist(.abundance=hellinger, distmethod=”bray”) mpse_abund #NOTE mpse_abund contains 31 varibles = 30 varibles + bray # mp_plot_dist provides there methods to visualize the distance between the samples or groups # when .group is not provided, the dot heatmap plot will be return p1 <- mpse_abund %>% mp_plot_dist(.distmethod = bray) png(“distance_between_samples.png”, width= 1000, height=1000) p1 dev.off() # when .group is provided, the dot heatmap plot with group information will be return. p2 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group) # The scale or theme of dot heatmap plot can be adjusted using set_scale_theme function. p2 %>% set_scale_theme( x = scale_fill_manual( values=c(“#1f78b4”, “#e31a1c”), #c(“orange”, “deepskyblue”), guide = guide_legend( keywidth = 1, keyheight = 0.5, title.theme = element_text(size=8), label.theme = element_text(size=6) ) ), aes_var = Group # specific the name of variable ) %>% set_scale_theme( x = scale_color_gradient( guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) %>% set_scale_theme( x = scale_size_continuous( range = c(0.1, 3), guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) png(“distance_between_samples_with_group_info.png”, width= 1000, height=1000) p2 dev.off() # when .group is provided and group.test is TRUE, the comparison of different groups will be returned # Assuming p3 is a ggplot object after mp_plot_dist call p3 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group, group.test = TRUE, textsize = 6) + theme( axis.title.x = element_text(size = 14), # Customize x-axis label face = “bold” axis.title.y = element_text(size = 14), # Customize y-axis label axis.text.x = element_text(size = 14), # Customize x-axis ticks axis.text.y = element_text(size = 14) # Customize y-axis ticks ) # Save the plot with the new theme settings png(“Comparison_of_Bray_Distances.png”, width = 1000, height = 1000) print(p3) # Ensure that p3 is explicitly printed in the device dev.off() # Extract Bray-Curtis Distance Values and save them in a Excel-table. library(dplyr) library(openxlsx) # Define the sample numbers vector sample_numbers <- c("1","2","5","6","7", "29","30","31","32") # Consolidate the list of tibbles using the actual sample numbers bray_data <- bind_rows( lapply(seq_along(mpse_abund$bray), function(i) { tibble( Sample1 = sample_numbers[i], # Use actual sample number Sample2 = mpse_abund$bray[[i]]$braySampley, BrayDistance = mpse_abund$bray[[i]]$bray ) }), .id = "PairID" ) # Print the data frame to check the output print(bray_data) # Write the data frame to an Excel file write.xlsx(bray_data, file = "Bray_Curtis_Distances.xlsx") #DELETE the column "PairID" in Excel file # ----------------------- # 3.5.2 The PCoA analysis #install.packages("corrr") library(corrr) #install.packages("ggside") library(ggside) mpse_abund %<>% mp_cal_pcoa(.abundance=hellinger, distmethod=”bray”) # The dimensions of ordination analysis will be added the colData slot (default). mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles = 31 varibles + `PCo1 (30.16%)` , `PCo2 (15.75%)` , `PCo3 (10.53%)` #BUG why 36 variables in mpse_abund %>% print(width=380, n=1) [RareAbundanceBySample , RareAbundanceByGroup ] #> methods(class=class(mpse_abund)) # We also can perform adonis or anosim to check whether it is significant to the dissimilarities of groups. mpse_abund %<>% mp_adonis(.abundance=hellinger, .formula=~Group, distmethod=”bray”, permutations=9999, action=”add”) mpse_abund %>% mp_extract_internal_attr(name=adonis) #PAUSE p1 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = 2.4, .alpha = 1, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( #values = c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) + scale_color_manual( #values=c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) #scale_fill_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) + #scale_color_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) #scale_fill_manual(values=c(“#00A087FF”, “#3C5488FF”)) + #scale_color_manual(values=c(“#00A087FF”, “#3C5488FF”)) #png(“PCoA.png”, width= 1000, height=1000) #svg(“PCoA.svg”, width= 11, height=10) #svg(“PCoA_.svg”, width=10, height=10) #svg(“PCoA.svg”) pdf(“PCoA.pdf”) p1 dev.off() #FF0000: Red #000000: Black #0000FF: Blue #C0C0C0: Silver #00FF00: Lime (often referred to simply as Green in web colors) #FFFF00: Yellow #00FFFF: Aqua (also known as Cyan) #FFA500: Orange # The size of point also can be mapped to other variables such as Observe, or Shannon # Then the alpha diversity and beta diversity will be displayed simultaneously. p2 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = Shannon, .alpha = Observe, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_color_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_size_continuous( range=c(0.5, 3), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) pdf(“PCoA2.pdf”) p2 dev.off() # Add the sample name as text labels library(ggrepel) p2 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = Shannon, .alpha = Observe, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + geom_text_repel(aes(label = ifelse(Sample == “1”, “1”, Sample)), # Prioritize “1” size = 3, color = “black”, # Set the label color to black for better visibility max.overlaps = Inf, # Allow maximum labels force = 2, # Increase the force to push labels apart box.padding = 0.5, # Add more padding around the labels segment.size = 0.2 # Line segment size connecting labels to points ) + scale_fill_manual( values = c(“#1f78b4”, “#e31a1c”), # only needs two colors guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_color_manual( values = c(“#1f78b4”, “#e31a1c”), # only needs two colors guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_size_continuous( range=c(0.5, 3), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) #pdf(“PCoA2_labeled.pdf”) png(“PCoA2_labeled.png”, width=800, height=800) p2 dev.off() # —————————————— # 3.5.3 Hierarchical cluster (tree) analysis #input should contain hellinger! mpse_abund %<>% mp_cal_clust( .abundance = hellinger, distmethod = “bray”, hclustmethod = “average”, # (UPGAE) action = “add” # action is used to control which result will be returned ) mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles, no new variable, the column bray has been new calculated! # if action = ‘add’, the result of hierarchical cluster will be added to the MPSE object # mp_extract_internal_attr can extract it. It is a treedata object, so it can be visualized # by ggtree. sample.clust <- mpse_abund %>% mp_extract_internal_attr(name=’SampleClust’) #The object contained internal attribute: PCoA ADONIS SampleClust sample.clust #–> The associated data tibble abstraction: 27 × 30 library(ggtree) p <- ggtree(sample.clust) + geom_tippoint(aes(color=Group)) + geom_tiplab(as_ylab = TRUE) + ggplot2::scale_x_continuous(expand=c(0, 0.01)) png("hierarchical_cluster1.png", width= 1000, height=800) p dev.off() #https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html # mapping = aes(x = RelRareAbundanceBySample-->Group, # y = Sample–>Group, # fill = Phyla # ), library(ggtreeExtra) library(ggplot2) # Extract relative abundance of phyla phyla.tb <- mpse_abund %>% mp_extract_abundance(taxa.class=Phylum, topn=30) # The abundance of each samples is nested, it can be flatted using the unnest of tidyr. phyla.tb %<>% tidyr::unnest(cols=RareAbundanceBySample) %>% dplyr::rename(Phyla=”label”) phyla.tb phyla.tb %>% print(width=380, n=10) p1 <- p + geom_fruit( data=phyla.tb, geom=geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Phyla ), orientation = "y", #offset = 0.4, pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of phyla (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) png("hierarchical_cluster2_Phyla.png", width = 1000, height = 800) p1 dev.off() # Extract relative abundance of classes class.tb <- mpse_abund %>% mp_extract_abundance(taxa.class = Class, topn = 30) # Flatten and rename the columns class.tb %<>% tidyr::unnest(cols = RareAbundanceBySample) %>% dplyr::rename(Class = “label”) # View the data frame class.tb # Create the plot p1 <- p + geom_fruit( data = class.tb, geom = geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Class ), orientation = "y", pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of classes (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) # Save the plot to a file #ERROR-->NEED to be DEBUGGED! png(“hierarchical_cluster2_Class.png”, width = 1000, height = 800) print(p1) dev.off() # ———————– # 3.6 Biomarker discovery library(ggtree) library(ggtreeExtra) library(ggplot2) library(MicrobiotaProcess) library(tidytree) library(ggstar) library(forcats) library(writexl) #—-BUG: why resulting in 26 taxa != 16 in the end —- mpse_abund %>% print(width=150) #mpse_abund %<>% # mp_cal_abundance( # for each samples # .abundance = RareAbundance # ) %>% # mp_cal_abundance( # for each groups # .abundance=RareAbundance, # .group=Group # ) #mpse_abund mpse_abund %<>% mp_diff_analysis( .abundance = RelRareAbundanceBySample, .group = Group, cl.min = 4, first.test.alpha = 0.01, filter.p=”pvalue” ) # The result is stored to the taxatree or otutree slot, you can use mp_extract_tree to extract the specific slot. taxa.tree <- mpse_abund %>% mp_extract_tree(type=”taxatree”) taxa.tree ## And the result tibble of different analysis can also be extracted with tidytree (>=0.3.5) #LDAupper, LDAmean, LDAlower, taxa.tree %>% select(label, nodeClass, Sign_Group, fdr) #%>% dplyr::filter(!is.na(fdr)) taxa.tree %>% print(width=150, n=200) # — replace the pvalue and fdr with pvalue and p-adjusted from DESeq enrichment results — #TODO: replace the values of pvalue and fdr in taxa.tree, with the values of pvalue and padj from sigtab, if the the tips in taxa.tree could be found in colnames(sigtab). #tree_data <- get.data(taxa.tree) #as.treedata(taxa.tree) #d <- tibble(label = paste0('t', 1:4), trait = rnorm(4)) tree_data <- as_tibble(taxa.tree) #full_join(x, d, by = 'label') %>% as.treedata # — NOTE that sigtab generated by Phyloseq.Rmd should take ‘alpha = 2.0’ — # Modify tree_data by joining with sigtab and updating Sign_Group sigtab$label <- rownames(sigtab) write.xlsx(sigtab, file = "sigtab.xlsx") sum(sigtab$padj<0.05) #taxa.tree <- left_join(tree_data, sigtab[, c("label", "log2FoldChange", "pvalue", "padj")], by = 'label') %>% as.treedata taxa.tree2 <- tree_data %>% left_join(sigtab[, c(“label”, “baseMean”, “log2FoldChange”, “lfcSE”, “stat”, “pvalue”, “padj”)], by = “label”) %>% mutate(Sign_Group = case_when( log2FoldChange > 0 & padj <= 0.05 ~ "Group1", log2FoldChange < 0 & padj <= 0.05 ~ "Group5", TRUE ~ NA_character_ # Sets Sign_Group to NA otherwise )) %>% as.treedata() # Convert the dataframe to a treedata object taxa.tree2 %>% print(width=380, n=20) # —- print taxa_data2 to Excel, why resulting in 26 records? —- taxa_data2 <- as_tibble(taxa.tree2) sum(!is.na(taxa_data2$Sign_Group)) sapply(taxa_data2, class) # Remove or transform list columns if not needed taxa_data2_simplified <- taxa_data2 %>% select(-RareAbundanceBySample, -RareAbundanceByGroup) %>% mutate(across(where(is.list), ~toString(.))) # Convert lists to character strings if needed # Replace NA with a placeholder, such as “NA” or another suitable representation taxa_data2_simplified <- taxa_data2_simplified %>% mutate(across(everything(), ~ifelse(is.na(.), “NA”, .))) taxonomy_data <- as.data.frame(mp_extract_taxonomy(mpse_abund)) colnames(taxa_data2_simplified)[colnames(taxa_data2_simplified) == "label"] <- "OTU" combined_data <- left_join(taxa_data2_simplified, taxonomy_data, by = "OTU") write_xlsx(combined_data, "taxa_data2.xlsx") #(UNDER HOST-ENV) cp sigtab.xlsx diff_analysis_Group1_vs_Group5.xlsx and then switch label as the 1st column and sort the columns by padj. # -- NOTE that sometimes the record in DESeq2 not occurs in the final list, since the statistics calculation of MicrobiotaProcess results in NA, e.g. the record FJ879443.1.1488, we can simply delete the record from diff_analysis_Group1_vs_Group5.xlsx -- # Since taxa.tree is treedata object, it can be visualized by ggtree and ggtreeExtra p1 <- ggtree( taxa.tree2, layout="radial", size = 0.3 ) + geom_point( data = td_filter(!isTip), fill="white", size=1, shape=21 ) # display the high light of phylum clade. p2 <- p1 + geom_hilight( data = td_filter(nodeClass == "Phylum"), mapping = aes(node = node, fill = label) ) # display the relative abundance of features(OTU) p3 <- p2 + ggnewscale::new_scale("fill") + geom_fruit( data = td_unnest(RareAbundanceBySample), geom = geom_star, mapping = aes( x = fct_reorder(Sample, Group, .fun=min), size = RelRareAbundanceBySample, fill = Group, subset = RelRareAbundanceBySample > 0 ), starshape = 13, starstroke = 0.25, offset = 0.03, pwidth = 0.4, grid.params = list(linetype=2) ) + scale_size_continuous( name=”Relative Abundance (%)”, range = c(.5, 3) ) + scale_fill_manual(values=c(“#1B9E77”, “#D95F02”)) # display the tip labels of taxa tree p4 <- p3 + geom_tiplab(size=6, offset=4.0) # display the LDA of significant OTU. #p5 <- p4 + # ggnewscale::new_scale("fill") + # geom_fruit( # geom = geom_col, # mapping = aes( # x = LDAmean, # fill = Sign_Group, # subset = !is.na(LDAmean) # ), # orientation = "y", # offset = 0.3, # pwidth = 0.5, # axis.params = list(axis = "x", # title = "Log10(LDA)", # title.height = 0.01, # title.size = 2, # text.size = 1.8, # vjust = 1), # grid.params = list(linetype = 2) # ) # display the significant (FDR-->pvalue–>padj) taxonomy after kruskal.test (default) #shape = 21, #scale_size_continuous(range=c(1, 3)) + p6 <- p4 + ggnewscale::new_scale("size") + geom_point( data=td_filter(!is.na(Sign_Group)), mapping = aes(size = -log10(padj), fill = Sign_Group, ), shape = 21, ) + scale_size_continuous(range=c(1, 4)) + scale_fill_manual(values=c("#1B9E77", "#D95F02")) svg("diff_analysis.svg",width=22, height=22) #png("differently_expressed_otu.png", width=2000, height=2000) p6 + theme( legend.key.height = unit(1.0, "cm"), legend.key.width = unit(1.0, "cm"), legend.spacing.y = unit(0.01, "cm"), legend.text = element_text(size = 20), legend.title = element_text(size = 20) #legend.position = c(0.99, 0.01) ) dev.off() 2, Phyloseq.Rmd --- title: "Phyloseq microbiome" author: "" date: '`r format(Sys.time(), "%d %m %Y")`' header-includes: - \usepackage{color, fancyvrb} output: rmdformats::readthedown: highlight: kate number_sections : yes pdf_document: toc: yes toc_depth: 2 number_sections : yes --- ```{r, echo=FALSE, warning=FALSE} ## Global options # TODO: reproduce the html with the additional figure/SVN-files for editing. # IMPORTANT NOTE: needs before "mkdir figures" #rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html') ``` ```{r load-packages, include=FALSE} library(knitr) library(rmdformats) library(readxl) library(dplyr) library(kableExtra) options(max.print="75") knitr::opts_chunk$set(fig.width=8, fig.height=6, eval=TRUE, cache=TRUE, echo=TRUE, prompt=FALSE, tidy=TRUE, comment=NA, message=FALSE, warning=FALSE) opts_knit$set(width=85) # Phyloseq R library #* Phyloseq web site : https://joey711.github.io/phyloseq/index.html #* See in particular tutorials for # - importing data: https://joey711.github.io/phyloseq/import-data.html # - heat maps: https://joey711.github.io/phyloseq/plot_heatmap-examples.html ``` # Data Import raw data and assign sample key: ```{r, echo=TRUE, warning=FALSE} #extend map_corrected.txt with Diet and Flora #setwd("~/DATA/Data_Laura_16S_2/core_diversity_e4753") map_corrected <- read.csv("../map_corrected.txt", sep="\t", row.names=1) knitr::kable(map_corrected) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) “` # Prerequisites to be installed * R : https://pbil.univ-lyon1.fr/CRAN/ * R studio : https://www.rstudio.com/products/rstudio/download/#download “`R install.packages(“dplyr”) # To manipulate dataframes install.packages(“readxl”) # To read Excel files into R install.packages(“ggplot2”) # for high quality graphics install.packages(“heatmaply”) source(“https://bioconductor.org/biocLite.R”) biocLite(“phyloseq”) “` “`{r libraries, echo=TRUE, message=FALSE} library(“readxl”) # necessary to import the data from Excel file library(“ggplot2”) # graphics library(“picante”) library(“microbiome”) # data analysis and visualisation library(“phyloseq”) # also the basis of data object. Data analysis and visualisation library(“ggpubr”) # publication quality figures, based on ggplot2 library(“dplyr”) # data handling, filter and reformat data frames library(“RColorBrewer”) # nice color options library(“heatmaply”) library(vegan) library(gplots) “` # Read the data and create phyloseq objects Three tables are needed * OTU * Taxonomy * Samples “`{r, echo=TRUE, warning=FALSE} #Change your working directory to where the files are located ps.ng.tax <- import_biom("./table_even42369.biom", "../clustering/rep_set.tre") sample <- read.csv("../map_corrected.txt", sep="\t", row.names=1) SAM = sample_data(sample, errorIfNULL = T) rownames(SAM) <- c("1","2","3","5","6","7","8","9","10","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","46","47","48","49","50","51","52","53","55") ps.ng.tax <- merge_phyloseq(ps.ng.tax, SAM) print(ps.ng.tax) colnames(tax_table(ps.ng.tax)) <- c("Domain","Phylum","Class","Order","Family","Genus","Species") saveRDS(ps.ng.tax, "./ps.ng.tax.rds") ``` Visualize data ```{r, echo=TRUE, warning=FALSE} sample_names(ps.ng.tax) rank_names(ps.ng.tax) sample_variables(ps.ng.tax) ``` Normalize number of reads in each sample using median sequencing depth. ```{r, echo=TRUE, warning=FALSE} # RAREFACTION #set.seed(9242) # This will help in reproducing the filtering and nomalisation. #ps.ng.tax <- rarefy_even_depth(ps.ng.tax, sample.size = 42369) #total <- 42369 # NORMALIZE number of reads in each sample using median sequencing depth. total = median(sample_sums(ps.ng.tax)) #> total #[1] 42369 standf = function(x, t=total) round(t * (x / sum(x))) ps.ng.tax = transform_sample_counts(ps.ng.tax, standf) ps.ng.tax_rel <- microbiome::transform(ps.ng.tax, "compositional") saveRDS(ps.ng.tax, "./ps.ng.tax.rds") hmp.meta <- meta(ps.ng.tax) hmp.meta$sam_name <- rownames(hmp.meta) ``` # Heatmaps ```{r, echo=TRUE, warning=FALSE} #MOVE_FROM_ABOVE: The number of reads used for normalization is **`r sprintf("%.0f", total)`**. #A basic heatmap using the default parameters. # plot_heatmap(ps.ng.tax, method = "NMDS", distance = "bray") #NOTE that giving the correct OTU numbers in the text (1%, 0.5%, ...)!!! ``` We consider the most abundant OTUs for heatmaps. For example one can only take OTUs that represent at least 1% of reads in at least one sample. Remember we normalized all the sampples to median number of reads (total). We are left with only 168 OTUS which makes the reading much more easy. ```{r, echo=TRUE, warning=FALSE} # Custom function to plot a heatmap with the specified sample order #plot_heatmap_custom <- function(ps, sample_order, method = "NMDS", distance = "bray") { ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE) kable(otu_table(ps.ng.tax_abund)) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) # Calculate the relative abundance for each sample ps.ng.tax_abund_rel <- transform_sample_counts(ps.ng.tax_abund, function(x) x / sum(x)) datamat_ = as.data.frame(otu_table(ps.ng.tax_abund)) #datamat <- datamat_[c("1","2","5","6","7", "8","9","10","12","13","14", "15","16","17","18","19","20", "21","22","23","24","25","26","27","28", "29","30","31","32", "33","34","35","36","37","38","39","51", "40","41","42","43","44","46", "47","48","49","50","52","53","55")] datamat <- datamat_[c("8","9","10","12","13","14", "21","22","23","24","25","26","27","28", "33","34","35","36","37","38","39","51", "47","48","49","50","52","53","55")] hr <- hclust(as.dist(1-cor(t(datamat), method="pearson")), method="complete") hc <- hclust(as.dist(1-cor(datamat, method="spearman")), method="complete") mycl = cutree(hr, h=max(hr$height)/1.08) mycol = c("YELLOW", "DARKBLUE", "DARKORANGE", "DARKMAGENTA", "DARKCYAN", "DARKRED", "MAROON", "DARKGREEN", "LIGHTBLUE", "PINK", "MAGENTA", "LIGHTCYAN","LIGHTGREEN", "BLUE", "ORANGE", "CYAN", "RED", "GREEN"); mycol = mycol[as.vector(mycl)] sampleCols <- rep('GREY',ncol(datamat)) #names(sampleCols) <- c("Group1", "Group1", "Group1", "Group1", "Group1", "Group2", "Group2", "Group2", "Group2", "Group2","Group2", "Group3", "Group3", "Group3", "Group3", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1", "Group1") #sampleCols[colnames(datamat)=='1'] <- '#a6cee3' #sampleCols[colnames(datamat)=='2'] <- '#a6cee3' #sampleCols[colnames(datamat)=='5'] <- '#a6cee3' #sampleCols[colnames(datamat)=='6'] <- '#a6cee3' #sampleCols[colnames(datamat)=='7'] <- '#a6cee3' sampleCols[colnames(datamat)=='8'] <- '#1f78b4' sampleCols[colnames(datamat)=='9'] <- '#1f78b4' sampleCols[colnames(datamat)=='10'] <- '#1f78b4' sampleCols[colnames(datamat)=='12'] <- '#1f78b4' sampleCols[colnames(datamat)=='13'] <- '#1f78b4' sampleCols[colnames(datamat)=='14'] <- '#1f78b4' #sampleCols[colnames(datamat)=='15'] <- '#b2df8a' #sampleCols[colnames(datamat)=='16'] <- '#b2df8a' #sampleCols[colnames(datamat)=='17'] <- '#b2df8a' #sampleCols[colnames(datamat)=='18'] <- '#b2df8a' #sampleCols[colnames(datamat)=='19'] <- '#b2df8a' #sampleCols[colnames(datamat)=='20'] <- '#b2df8a' sampleCols[colnames(datamat)=='21'] <- '#33a02c' sampleCols[colnames(datamat)=='22'] <- '#33a02c' sampleCols[colnames(datamat)=='23'] <- '#33a02c' sampleCols[colnames(datamat)=='24'] <- '#33a02c' sampleCols[colnames(datamat)=='25'] <- '#33a02c' sampleCols[colnames(datamat)=='26'] <- '#33a02c' sampleCols[colnames(datamat)=='27'] <- '#33a02c' sampleCols[colnames(datamat)=='28'] <- '#33a02c' #sampleCols[colnames(datamat)=='29'] <- '#fb9a99' #sampleCols[colnames(datamat)=='30'] <- '#fb9a99' #sampleCols[colnames(datamat)=='31'] <- '#fb9a99' #sampleCols[colnames(datamat)=='32'] <- '#fb9a99' sampleCols[colnames(datamat)=='33'] <- '#e31a1c' sampleCols[colnames(datamat)=='34'] <- '#e31a1c' sampleCols[colnames(datamat)=='35'] <- '#e31a1c' sampleCols[colnames(datamat)=='36'] <- '#e31a1c' sampleCols[colnames(datamat)=='37'] <- '#e31a1c' sampleCols[colnames(datamat)=='38'] <- '#e31a1c' sampleCols[colnames(datamat)=='39'] <- '#e31a1c' sampleCols[colnames(datamat)=='51'] <- '#e31a1c' #sampleCols[colnames(datamat)=='40'] <- '#cab2d6' #sampleCols[colnames(datamat)=='41'] <- '#cab2d6' #sampleCols[colnames(datamat)=='42'] <- '#cab2d6' #sampleCols[colnames(datamat)=='43'] <- '#cab2d6' #sampleCols[colnames(datamat)=='44'] <- '#cab2d6' #sampleCols[colnames(datamat)=='46'] <- '#cab2d6' sampleCols[colnames(datamat)=='47'] <- '#6a3d9a' sampleCols[colnames(datamat)=='48'] <- '#6a3d9a' sampleCols[colnames(datamat)=='49'] <- '#6a3d9a' sampleCols[colnames(datamat)=='50'] <- '#6a3d9a' sampleCols[colnames(datamat)=='52'] <- '#6a3d9a' sampleCols[colnames(datamat)=='53'] <- '#6a3d9a' sampleCols[colnames(datamat)=='55'] <- '#6a3d9a' #bluered(75) #color_pattern <- colorRampPalette(c("blue", "white", "red"))(100) library(RColorBrewer) custom_palette <- colorRampPalette(brewer.pal(9, "Blues")) heatmap_colors <- custom_palette(100) #colors <- heatmap_color_default(100) png("figures/heatmap.png", width=1200, height=2400) #par(mar=c(2, 2, 2, 2)) , lwid=1 lhei=c(0.7, 10)) # Adjust height of color keys keysize=0.3, heatmap.2(as.matrix(datamat),Rowv=as.dendrogram(hr),Colv = NA, dendrogram = 'row', scale='row',trace='none',col=heatmap_colors, cexRow=1.2, cexCol=1.5, RowSideColors = mycol, ColSideColors = sampleCols, srtCol=15, labRow=row.names(datamat), key=TRUE, margins=c(10, 15), lhei=c(0.7, 15), lwid=c(1,8)) dev.off() ``` ```{r, echo=TRUE, warning=FALSE, fig.cap="Heatmap", out.width = '100%', fig.align= "center"} knitr::include_graphics("./figures/heatmap.png") ``` ```{r, echo=FALSE, warning=FALSE} #It is possible to use different distances and different multivaraite methods. Many different built-in distances can be used. #dist_methods <- unlist(distanceMethodList) #print(dist_methods) ``` \pagebreak # Taxonomic summary ## Bar plots in phylum level ```{r, echo=FALSE, warning=FALSE} #Make the bargraph nicer by removing OTUs boundaries. This is done by adding ggplot2 modifier. # 1: uniform color. Color is for the border, fill is for the inside #ggplot(mtcars, aes(x=as.factor(cyl) )) + # geom_bar(color="blue", fill=rgb(0.1,0.4,0.5,0.7) ) # 2: Using Hue #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) + # geom_bar( ) + # scale_fill_hue(c = 40) + # theme(legend.position="none") # 3: Using RColorBrewer #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) + # geom_bar( ) + # scale_fill_brewer(palette = "Set1") + # theme(legend.position="none") # 4: Using greyscale: #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) + # geom_bar( ) + # scale_fill_grey(start = 0.25, end = 0.75) + # theme(legend.position="none") # 5: Set manualy #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) + # geom_bar( ) + # scale_fill_manual(values = c("red", "green", "blue") ) + # theme(legend.position="none") #NOT SUCCESSFUL! #allGroupsColors<- c( # "grey0", "grey50", "dodgerblu", "deepskyblue", # "red", "darkred", "green", "green4") # plot_bar(ps.ng.tax_rel, fill="Phylum") + # geom_bar(stat="identity", position="stack") + scale_color_manual(values = allGroupsColors) #, fill=Phylum + scale_fill_brewer(palette = "Set1") # ##### Keep only the most abundant phyla and #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Actinobacteria")) #1.57 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Bacteroidetes")) #27.27436 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Cyanobacteria")) #0.02244249 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Epsilonbacteraeota")) #0.01309145 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Euryarchaeota")) #0.1210024 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Firmicutes")) #32.50589 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Lentisphaerae")) #0.0001870208 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Patescibacteria")) #0.008789976 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Planctomycetes")) #0.01365252 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Proteobacteria")) #6.769216 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Synergistetes")) #0.005049561 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Tenericutes")) #0.0005610623 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Verrucomicrobia")) #2.076304 #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c(NA)) #sum(otu_table(ps.ng.tax_most)) = 2.619413 ``` ```{r, echo=TRUE, warning=FALSE} library(ggplot2) geom.text.size = 6 theme.size = 8 #(14/5) * geom.text.size #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Actinobacteria", "D_1__Bacteroidetes", "D_1__Firmicutes", "D_1__Proteobacteria", "D_1__Verrucomicrobia", NA)) ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE) #CONSOLE(OPTIONAL): for sampleid in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73; do #echo “otu_table(ps.ng.tax_most)[,${sampleid}]=otu_table(ps.ng.tax_most)[,${sampleid}]/sum(otu_table(ps.ng.tax_most)[,${sampleid}])” done #OR ps.ng.tax_most_ = transform_sample_counts(ps.ng.tax_most, function(x) x / sum(x)) “` “`{r, echo=FALSE, warning=FALSE} ##–Creating 100% stacked bar plots with less abundant taxa in a sub-category #901– ##https://github.com/joey711/phyloseq/issues/901 ##ps.ng.tax_most_df <- psmelt(ps.ng.tax_most_) #5986x19 #glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Phylum') #tax_table(glom) # should list # taxa as # phyla #data <- psmelt(glom) # create dataframe from phyloseq object #data$Phylum <- as.character(data$Phylum) #convert to character ##simple way to rename phyla with < 1% abundance #data$Phylum[data$Abundance < 0.001] <- "< 0.1% abund." # #library(plyr) #medians <- ddply(data, ~Phylum, function(x) c(median=median(x$Abundance))) #remainder <- medians[medians$median <= 0.001,]$Phylum #data[data$Phylum %in% remainder,]$Phylum <- "Phyla < 0.1% abund." #data$Phylum[data$Abundance < 0.001] <- "Phyla < 0.1% abund." ##--> data are not used! # ##in class level #glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Class') #tax_table(glom) # should list # taxa as # phyla #data <- psmelt(glom) # create dataframe from phyloseq object #data$Class <- as.character(data$Class) #convert to character # ##simple way to rename phyla with < 1% abundance #data$Class[data$Abundance < 0.001] <- "< 0.1% abund." #Count = length(unique(data$Class)) # ##unique(data$Class) ##data$Class <- factor(data$Class, levels = c("Bacilli", "Bacteroidia", "Verrucomicrobiae", "Clostridia", "Gammaproteobacteria", "Alphaproteobacteria", "Actinobacteria", "Negativicutes", "Erysipelotrichia", "Methanobacteria", "< 0.1% abund.")) ##------- Creating 100% stacked bar plots END -------- library(stringr) #FITTING1: # tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2] # ... ... # tax_table(ps.ng.tax_most_)[167,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Species"], "__")[[1]][2] #ps.ng.tax_most_ #in total [ 89 taxa and 55 samples ] #otu_table() OTU Table: [ 166 taxa and 54 samples ] #otu_table() OTU Table: [ 168 taxa and 50 samples ] #for id in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166; do #echo "tax_table(ps.ng.tax_most_)[${id},\"Domain\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Domain\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Phylum\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Phylum\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Class\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Class\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Order\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Order\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Family\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Family\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Genus\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Genus\"], \"__\")[[1]][2]" #echo "tax_table(ps.ng.tax_most_)[${id},\"Species\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Species\"], \"__\")[[1]][2]" #done tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[1,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[2,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[3,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[4,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[5,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[6,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[7,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[8,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[9,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[10,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[11,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[12,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[13,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[14,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[15,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[16,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[17,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[18,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[19,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[20,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[21,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[22,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[23,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[24,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[25,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[26,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[27,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[28,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[29,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[30,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[31,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[32,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[33,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[34,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[35,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[36,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[37,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[38,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[39,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[40,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[41,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[42,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[43,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[44,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[45,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[46,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[47,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[48,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[49,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[50,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[51,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[52,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[53,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[54,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[55,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[56,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[57,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[58,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[59,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[60,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[61,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[62,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[63,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[64,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[65,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[66,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[67,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[68,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[69,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[70,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[71,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[72,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[73,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[74,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[75,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[76,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[77,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[78,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[79,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[80,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[81,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[82,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[83,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[84,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[85,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[86,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[87,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[88,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[89,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[90,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[91,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[92,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[93,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[94,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[95,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[96,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[97,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[98,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[99,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[100,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[101,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[102,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[103,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[104,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[105,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[106,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[107,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[108,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[109,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[110,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[111,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[112,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[113,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[114,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[115,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[116,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[117,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[118,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[119,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[120,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[121,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[122,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[123,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[124,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[125,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[126,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[127,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[128,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[129,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[130,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[131,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[132,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[133,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[134,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[135,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[136,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[137,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[138,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[139,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[140,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[141,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[142,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[143,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[144,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[145,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[146,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[147,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[148,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[149,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[150,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[151,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[152,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[153,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[154,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[155,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[156,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[157,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[158,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[159,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[160,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[161,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[162,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[163,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[164,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[165,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[166,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Species"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Domain"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Phylum"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Class"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Order"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Family"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Genus"], "__")[[1]][2] tax_table(ps.ng.tax_most_)[167,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Species"], "__")[[1]][2] ``` ```{r, echo=TRUE, warning=FALSE} #aes(color="Phylum", fill="Phylum") --> aes() #ggplot(data=data, aes(x=Sample, y=Abundance, fill=Phylum)) plot_bar(ps.ng.tax_most_, fill=”Phylum”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = 5, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=2)) #6 instead of theme.size “` “`{r, echo=FALSE, warning=FALSE} #png(“abc.png”) #knitr::include_graphics(“./Phyloseq_files/figure-html/unnamed-chunk-7-1.png”) #dev.off() “` \pagebreak Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth. “`{r, echo=TRUE, warning=FALSE} ps.ng.tax_most_pre_post_stroke <- merge_samples(ps.ng.tax_most_, "pre_post_stroke") ps.ng.tax_most_pre_post_stroke_ = transform_sample_counts(ps.ng.tax_most_pre_post_stroke, function(x) x / sum(x)) #plot_bar(ps.ng.tax_most_SampleType_, fill = "Phylum") + geom_bar(aes(color=Phylum, fill=Phylum), stat="identity", position="stack") plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Phylum") + geom_bar(aes(), stat="identity", position="stack") + scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = theme.size, colour="black")) ``` \pagebreak Use color according to phylum. Do separate panels Stroke and Sex_age. ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_most_copied <- data.table::copy(ps.ng.tax_most_) #FITTING6: regulate the bar height if it has replicates: 5+6+6+8+4+8+6+7=25+25=50 otu_table(ps.ng.tax_most_)[,c("1")] <- otu_table(ps.ng.tax_most_)[,c("1")]/5 otu_table(ps.ng.tax_most_)[,c("2")] <- otu_table(ps.ng.tax_most_)[,c("2")]/5 otu_table(ps.ng.tax_most_)[,c("5")] <- otu_table(ps.ng.tax_most_)[,c("5")]/5 otu_table(ps.ng.tax_most_)[,c("6")] <- otu_table(ps.ng.tax_most_)[,c("6")]/5 otu_table(ps.ng.tax_most_)[,c("7")] <- otu_table(ps.ng.tax_most_)[,c("7")]/5 otu_table(ps.ng.tax_most_)[,c("8")] <- otu_table(ps.ng.tax_most_)[,c("8")]/6 otu_table(ps.ng.tax_most_)[,c("9")] <- otu_table(ps.ng.tax_most_)[,c("9")]/6 otu_table(ps.ng.tax_most_)[,c("10")] <- otu_table(ps.ng.tax_most_)[,c("10")]/6 otu_table(ps.ng.tax_most_)[,c("12")] <- otu_table(ps.ng.tax_most_)[,c("12")]/6 otu_table(ps.ng.tax_most_)[,c("13")] <- otu_table(ps.ng.tax_most_)[,c("13")]/6 otu_table(ps.ng.tax_most_)[,c("14")] <- otu_table(ps.ng.tax_most_)[,c("14")]/6 otu_table(ps.ng.tax_most_)[,c("15")] <- otu_table(ps.ng.tax_most_)[,c("15")]/6 otu_table(ps.ng.tax_most_)[,c("16")] <- otu_table(ps.ng.tax_most_)[,c("16")]/6 otu_table(ps.ng.tax_most_)[,c("17")] <- otu_table(ps.ng.tax_most_)[,c("17")]/6 otu_table(ps.ng.tax_most_)[,c("18")] <- otu_table(ps.ng.tax_most_)[,c("18")]/6 otu_table(ps.ng.tax_most_)[,c("19")] <- otu_table(ps.ng.tax_most_)[,c("19")]/6 otu_table(ps.ng.tax_most_)[,c("20")] <- otu_table(ps.ng.tax_most_)[,c("20")]/6 otu_table(ps.ng.tax_most_)[,c("21")] <- otu_table(ps.ng.tax_most_)[,c("21")]/8 otu_table(ps.ng.tax_most_)[,c("22")] <- otu_table(ps.ng.tax_most_)[,c("22")]/8 otu_table(ps.ng.tax_most_)[,c("23")] <- otu_table(ps.ng.tax_most_)[,c("23")]/8 otu_table(ps.ng.tax_most_)[,c("24")] <- otu_table(ps.ng.tax_most_)[,c("24")]/8 otu_table(ps.ng.tax_most_)[,c("25")] <- otu_table(ps.ng.tax_most_)[,c("25")]/8 otu_table(ps.ng.tax_most_)[,c("26")] <- otu_table(ps.ng.tax_most_)[,c("26")]/8 otu_table(ps.ng.tax_most_)[,c("27")] <- otu_table(ps.ng.tax_most_)[,c("27")]/8 otu_table(ps.ng.tax_most_)[,c("28")] <- otu_table(ps.ng.tax_most_)[,c("28")]/8 otu_table(ps.ng.tax_most_)[,c("29")] <- otu_table(ps.ng.tax_most_)[,c("29")]/4 otu_table(ps.ng.tax_most_)[,c("30")] <- otu_table(ps.ng.tax_most_)[,c("30")]/4 otu_table(ps.ng.tax_most_)[,c("31")] <- otu_table(ps.ng.tax_most_)[,c("31")]/4 otu_table(ps.ng.tax_most_)[,c("32")] <- otu_table(ps.ng.tax_most_)[,c("32")]/4 otu_table(ps.ng.tax_most_)[,c("33")] <- otu_table(ps.ng.tax_most_)[,c("33")]/8 otu_table(ps.ng.tax_most_)[,c("34")] <- otu_table(ps.ng.tax_most_)[,c("34")]/8 otu_table(ps.ng.tax_most_)[,c("35")] <- otu_table(ps.ng.tax_most_)[,c("35")]/8 otu_table(ps.ng.tax_most_)[,c("36")] <- otu_table(ps.ng.tax_most_)[,c("36")]/8 otu_table(ps.ng.tax_most_)[,c("37")] <- otu_table(ps.ng.tax_most_)[,c("37")]/8 otu_table(ps.ng.tax_most_)[,c("38")] <- otu_table(ps.ng.tax_most_)[,c("38")]/8 otu_table(ps.ng.tax_most_)[,c("39")] <- otu_table(ps.ng.tax_most_)[,c("39")]/8 otu_table(ps.ng.tax_most_)[,c("51")] <- otu_table(ps.ng.tax_most_)[,c("51")]/8 otu_table(ps.ng.tax_most_)[,c("40")] <- otu_table(ps.ng.tax_most_)[,c("40")]/6 otu_table(ps.ng.tax_most_)[,c("41")] <- otu_table(ps.ng.tax_most_)[,c("41")]/6 otu_table(ps.ng.tax_most_)[,c("42")] <- otu_table(ps.ng.tax_most_)[,c("42")]/6 otu_table(ps.ng.tax_most_)[,c("43")] <- otu_table(ps.ng.tax_most_)[,c("43")]/6 otu_table(ps.ng.tax_most_)[,c("44")] <- otu_table(ps.ng.tax_most_)[,c("44")]/6 otu_table(ps.ng.tax_most_)[,c("46")] <- otu_table(ps.ng.tax_most_)[,c("46")]/6 otu_table(ps.ng.tax_most_)[,c("47")] <- otu_table(ps.ng.tax_most_)[,c("47")]/7 otu_table(ps.ng.tax_most_)[,c("48")] <- otu_table(ps.ng.tax_most_)[,c("48")]/7 otu_table(ps.ng.tax_most_)[,c("49")] <- otu_table(ps.ng.tax_most_)[,c("49")]/7 otu_table(ps.ng.tax_most_)[,c("50")] <- otu_table(ps.ng.tax_most_)[,c("50")]/7 otu_table(ps.ng.tax_most_)[,c("52")] <- otu_table(ps.ng.tax_most_)[,c("52")]/7 otu_table(ps.ng.tax_most_)[,c("53")] <- otu_table(ps.ng.tax_most_)[,c("53")]/7 otu_table(ps.ng.tax_most_)[,c("55")] <- otu_table(ps.ng.tax_most_)[,c("55")]/7 #plot_bar(ps.ng.tax_most_swab_, x="Phylum", fill = "Phylum", facet_grid = Patient~RoundDay) + geom_bar(aes(color=Phylum, fill=Phylum), stat="identity", position="stack") + theme(axis.text = element_text(size = theme.size, colour="black")) plot_bar(ps.ng.tax_most_, x="Phylum", fill="Phylum", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") + scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=2)) ``` ```{r, echo=FALSE, warning=FALSE} #knitr::include_graphics("./Phyloseq_files/figure-html/unnamed-chunk-10-1.png") #> tax_table(carbom) #Taxonomy Table: [205 taxa by 7 taxonomic ranks]: # Domain Supergroup Division Class #Otu001 “Eukaryota” “Archaeplastida” “Chlorophyta” “Mamiellophyceae” # Order Family Genus #Otu001 “Mamiellales” “Bathycoccaceae” “Ostreococcus” #sample_data(ps.ng.tax) “` ## Bar plots in class level “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_copied, fill=”Class”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = 5, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=3)) “` Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth. “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_pre_post_stroke_, fill=”Class”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = theme.size, colour=”black”)) “` \pagebreak Use color according to class. Do separate panels Stroke and Sex_age. “`{r, echo=TRUE, warning=FALSE} #– If existing replicates, to be processed as follows — plot_bar(ps.ng.tax_most_, x=”Class”, fill=”Class”, facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = 5, colour=”black”), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=3)) “` ## Bar plots in order level “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_copied, fill=”Order”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = 5, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=4)) “` Regroup together pre vs post stroke and normalize number of reads in each group using median sequencing depth. “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_pre_post_stroke_, fill=”Order”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = theme.size, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=4)) “` \pagebreak Use color according to order. Do separate panels Stroke and Sex_age. “`{r, echo=TRUE, warning=FALSE} #FITTING7: regulate the bar height if it has replicates plot_bar(ps.ng.tax_most_, x=”Order”, fill=”Order”, facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“darkblue”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “lightskyblue”, “darkgreen”, “deeppink”, “khaki2”, “firebrick”, “brown1”, “darkorange1”, “cyan1”, “royalblue4”, “darksalmon”, “darkblue”,”royalblue4″, “dodgerblue3”, “steelblue1”, “lightskyblue”, “darkseagreen”, “darkgoldenrod1”, “darkseagreen”, “darkorchid”, “darkolivegreen1”, “brown1”, “darkorange1”, “cyan1”, “darkgrey”)) + theme(axis.text = element_text(size = 5, colour=”black”), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=4)) “` ## Bar plots in family level “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_copied, fill=”Family”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#FFFFFF”, “#FFFF00”, “#00FFFF”, “#FFA500”, “#00FF00”, “#808080”, “#FF00FF”, “#800080”, “#FDD017”, “#0000A0”, “#3BB9FF”, “#008000”, “#800000”, “#ADD8E6”, “#F778A1”, “#800517”, “#736F6E”, “#F52887”, “#C11B17”, “#5CB3FF”, “#A52A2A”, “#FF8040”, “#2B60DE”, “#736AFF”, “#1589FF”, “#98AFC7”, “#8D38C9”, “#307D7E”, “#F6358A”, “#151B54”, “#6D7B8D”, “#FDEEF4”, “#FF0080”, “#F88017”, “#2554C7”, “#FFF8C6”, “#D4A017”, “#306EFF”, “#151B8D”, “#9E7BFF”, “#EAC117”, “#E0FFFF”, “#15317E”, “#6C2DC7”, “#FBB917”, “#FCDFFF”, “#15317E”, “#254117”, “#FAAFBE”, “#357EC7″)) + theme(axis.text = element_text(size = 5, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=8)) “` Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth. “`{r, echo=TRUE, warning=FALSE} plot_bar(ps.ng.tax_most_pre_post_stroke_, fill=”Family”) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#FFFFFF”, “#FFFF00”, “#00FFFF”, “#FFA500”, “#00FF00”, “#808080”, “#FF00FF”, “#800080”, “#FDD017”, “#0000A0”, “#3BB9FF”, “#008000”, “#800000”, “#ADD8E6”, “#F778A1”, “#800517”, “#736F6E”, “#F52887”, “#C11B17”, “#5CB3FF”, “#A52A2A”, “#FF8040”, “#2B60DE”, “#736AFF”, “#1589FF”, “#98AFC7”, “#8D38C9”, “#307D7E”, “#F6358A”, “#151B54”, “#6D7B8D”, “#FDEEF4”, “#FF0080”, “#F88017”, “#2554C7”, “#FFF8C6”, “#D4A017”, “#306EFF”, “#151B8D”, “#9E7BFF”, “#EAC117”, “#E0FFFF”, “#15317E”, “#6C2DC7”, “#FBB917”, “#FCDFFF”, “#15317E”, “#254117”, “#FAAFBE”, “#357EC7″)) + theme(axis.text = element_text(size = theme.size, colour=”black”)) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=8)) “` \pagebreak Use color according to family. Do separate panels Stroke and Sex_age. “`{r, echo=TRUE, warning=FALSE} #– If existing replicates, to be processed as follows — plot_bar(ps.ng.tax_most_, x=”Family”, fill=”Family”, facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat=”identity”, position=”stack”) + scale_fill_manual(values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#FFFFFF”, “#FFFF00”, “#00FFFF”, “#FFA500”, “#00FF00”, “#808080”, “#FF00FF”, “#800080”, “#FDD017”, “#0000A0”, “#3BB9FF”, “#008000”, “#800000”, “#ADD8E6”, “#F778A1”, “#800517”, “#736F6E”, “#F52887”, “#C11B17”, “#5CB3FF”, “#A52A2A”, “#FF8040”, “#2B60DE”, “#736AFF”, “#1589FF”, “#98AFC7”, “#8D38C9”, “#307D7E”, “#F6358A”, “#151B54”, “#6D7B8D”, “#FDEEF4”, “#FF0080”, “#F88017”, “#2554C7”, “#FFF8C6”, “#D4A017”, “#306EFF”, “#151B8D”, “#9E7BFF”, “#EAC117”, “#E0FFFF”, “#15317E”, “#6C2DC7”, “#FBB917”, “#FCDFFF”, “#15317E”, “#254117”, “#FAAFBE”, “#357EC7″)) + theme(axis.text = element_text(size = 5, colour=”black”), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=8)) “` “`{r, echo=FALSE, warning=FALSE} #MOVE_FROM_ABOVE: ## Bar plots in genus level #MOVE_FROM_ABOVE: Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth. #plot_bar(ps.ng.tax_most_pre_post_stroke_, fill=”Genus”) + geom_bar(aes(), stat=”identity”, position=”stack”) + #scale_fill_manual(values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#FFFFFF”, “#FFFF00”, “#00FFFF”, “#FFA500”, “#00FF00”, “#808080”, “#FF00FF”, “#800080”, “#FDD017”, “#0000A0”, “#3BB9FF”, “#008000”, “#800000”, “#ADD8E6”, “#F778A1”, “#800517”, “#736F6E”, “#F52887”, “#C11B17”, “#5CB3FF”, “#A52A2A”, “#FF8040”, “#2B60DE”, “#736AFF”, “#1589FF”, “#98AFC7”, “#8D38C9”, “#307D7E”, “#F6358A”, “#151B54”, “#6D7B8D”, “#FDEEF4”, “#FF0080”, “#F88017”, “#2554C7”, “#FFF8C6”, “#D4A017”, “#306EFF”, “#151B8D”, “#9E7BFF”, “#EAC117”, “#E0FFFF”, “#15317E”, “#6C2DC7”, “#FBB917”, “#FCDFFF”, “#15317E”, “#254117”, “#FAAFBE”, “#357EC7″)) + theme(axis.text = element_text(size = theme.size, colour=”black”)) + theme(legend.position=”bottom”) “` \pagebreak “`{r, echo=FALSE, warning=FALSE} #MOVE_FROM_ABOVE: Use color according to genus. Do separate panels Stroke and Sex_age. ##– If existing replicates, to be processed as follows — #plot_bar(ps.ng.tax_most_, x=”Genus”, fill=”Genus”, facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat=”identity”, position=”stack”) + #scale_fill_manual(values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#FFFFFF”, “#FFFF00”, “#00FFFF”, “#FFA500”, “#00FF00”, “#808080”, “#FF00FF”, “#800080”, “#FDD017”, “#0000A0”, “#3BB9FF”, “#008000”, “#800000”, “#ADD8E6”, “#F778A1”, “#800517”, “#736F6E”, “#F52887”, “#C11B17”, “#5CB3FF”, “#A52A2A”, “#FF8040”, “#2B60DE”, “#736AFF”, “#1589FF”, “#98AFC7”, “#8D38C9”, “#307D7E”, “#F6358A”, “#151B54”, “#6D7B8D”, “#FDEEF4”, “#FF0080”, “#F88017”, “#2554C7”, “#FFF8C6”, “#D4A017”, “#306EFF”, “#151B8D”, “#9E7BFF”, “#EAC117”, “#E0FFFF”, “#15317E”, “#6C2DC7”, “#FBB917”, “#FCDFFF”, “#15317E”, “#254117”, “#FAAFBE”, “#357EC7″)) + theme(axis.text = element_text(size = 6, colour=”black”), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position=”bottom”) + guides(fill=guide_legend(nrow=18)) “` \pagebreak # Alpha diversity Plot Chao1 richness estimator, Observed OTUs, Shannon index, and Phylogenetic diversity. Regroup together samples from the same group. “`{r, echo=FALSE, warning=FALSE} # using rarefied data #FITTING2: CONSOLE: #gunzip table_even4753.biom.gz #alpha_diversity.py -i table_even42369.biom –metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering/rep_set.tre #gunzip table_even4753.biom.gz #alpha_diversity.py -i table_even4753.biom –metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering_stool/rep_set.tre #gunzip table_even4753.biom.gz #alpha_diversity.py -i table_even4753.biom –metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering_swab/rep_set.tre “` “`{r, echo=TRUE, warning=FALSE} hmp.div_qiime <- read.csv("adiv_even.txt", sep="\t") colnames(hmp.div_qiime) <- c("sam_name", "chao1", "observed_otus", "shannon", "PD_whole_tree") row.names(hmp.div_qiime) <- hmp.div_qiime$sam_name div.df <- merge(hmp.div_qiime, hmp.meta, by = "sam_name") div.df2 <- div.df[, c("Group", "chao1", "shannon", "observed_otus", "PD_whole_tree")] colnames(div.df2) <- c("Group", "Chao-1", "Shannon", "OTU", "Phylogenetic Diversity") #colnames(div.df2) options(max.print=999999) #27 H47 830.5000 5.008482 319 10.60177 #FITTING4: if occuring "Computation failed in `stat_signif()`:not enough 'y' observations" #means: the patient H47 contains only one sample, it should be removed for the statistical p-values calculations. #delete H47(1) #div.df2 <- div.df2[-c(3), ] #div.df2 <- div.df2[-c(55,54, 45,40,39,27,26,25,1), ] knitr::kable(div.df2) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) #https://uc-r.github.io/t_test #We can perform the test with t.test and transform our data and we can also perform the nonparametric test with the wilcox.test function. stat.test.Shannon <- compare_means( Shannon ~ Group, data = div.df2, method = "t.test" ) knitr::kable(stat.test.Shannon) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) div_df_melt <- reshape2::melt(div.df2) #head(div_df_melt) #https://plot.ly/r/box-plots/#horizontal-boxplot #http://www.sthda.com/english/wiki/print.php?id=177 #https://rpkgs.datanovia.com/ggpubr/reference/as_ggplot.html #http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/82-ggplot2-easy-way-to-change-graphical-parameters/ #https://plot.ly/r/box-plots/#horizontal-boxplot #library("gridExtra") #par(mfrow=c(4,1)) p <- ggboxplot(div_df_melt, x = "Group", y = "value", facet.by = "variable", scales = "free", width = 0.5, fill = "gray", legend= "right") #ggpar(p, xlab = FALSE, ylab = FALSE) lev <- levels(factor(div_df_melt$Group)) # get the variables #FITTING4: delete H47(1) in lev #lev <- lev[-c(3)] # make a pairwise list that we want to compare. #my_stat_compare_means #https://stackoverflow.com/questions/47839988/indicating-significance-with-ggplot2-in-a-boxplot-with-multiple-groups L.pairs <- combn(seq_along(lev), 2, simplify = FALSE, FUN = function(i) lev[i]) #%>% filter(p.signif != “ns”) my_stat_compare_means <- function (mapping = NULL, data = NULL, method = NULL, paired = FALSE, method.args = list(), ref.group = NULL, comparisons = NULL, hide.ns = FALSE, label.sep = ", ", label = NULL, label.x.npc = "left", label.y.npc = "top", label.x = NULL, label.y = NULL, tip.length = 0.03, symnum.args = list(), geom = "text", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...) { if (!is.null(comparisons)) { method.info <- ggpubr:::.method_info(method) method <- method.info$method method.args <- ggpubr:::.add_item(method.args, paired = paired) if (method == "wilcox.test") method.args$exact <- FALSE pms <- list(...) size <- ifelse(is.null(pms$size), 0.3, pms$size) color <- ifelse(is.null(pms$color), "black", pms$color) map_signif_level <- FALSE if (is.null(label)) label <- "p.format" if (ggpubr:::.is_p.signif_in_mapping(mapping) | (label %in% "p.signif")) { if (ggpubr:::.is_empty(symnum.args)) { map_signif_level <- c(`****` = 1e-04, `***` = 0.001, `**` = 0.01, `*` = 0.05, ns = 1) } else { map_signif_level <- symnum.args } if (hide.ns) names(map_signif_level)[5] <- " " } step_increase <- ifelse(is.null(label.y), 0.12, 0) ggsignif::geom_signif(comparisons = comparisons, y_position = label.y, test = method, test.args = method.args, step_increase = step_increase, size = size, color = color, map_signif_level = map_signif_level, tip_length = tip.length, data = data) } else { mapping <- ggpubr:::.update_mapping(mapping, label) layer(stat = StatCompareMeans, data = data, mapping = mapping, geom = geom, position = position, show.legend = show.legend, inherit.aes = inherit.aes, params = list(label.x.npc = label.x.npc, label.y.npc = label.y.npc, label.x = label.x, label.y = label.y, label.sep = label.sep, method = method, method.args = method.args, paired = paired, ref.group = ref.group, symnum.args = symnum.args, hide.ns = hide.ns, na.rm = na.rm, ...)) } } p2 <- p + stat_compare_means( method="t.test", #comparisons = L.pairs, # L.pairs comparisons = list(c("Group1", "Group2"), c("Group1", "Group3"), c("Group1", "Group4"), c("Group1", "Group6"), c("Group1", "Group8"), c("Group2", "Group5"),c("Group4", "Group5"),c("Group4", "Group6"),c("Group4", "Group7"),c("Group6", "Group7")), label = "p.signif", symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns")), #symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05), symbols = c("****", "***", "**", "*")), ) #stat_pvalue_manual #print(p2) #https://stackoverflow.com/questions/20500706/saving-multiple-ggplots-from-ls-into-one-and-separate-files-in-r #FITTING3: mkdir figures ggsave("./figures/alpha_diversity_Group.png", device="png", height = 10, width = 12) ggsave("./figures/alpha_diversity_Group.svg", device="svg", height = 10, width = 12) p3 <- p + stat_compare_means( method="t.test", #comparisons = L.pairs, # L.pairs comparisons = list(c("Group2", "Group4"), c("Group2", "Group6"), c("Group4", "Group8"), c("Group6", "Group8")), label = "p.signif", symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns")), #symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05), symbols = c("****", "***", "**", "*")), ) #stat_pvalue_manual #print(p2) #https://stackoverflow.com/questions/20500706/saving-multiple-ggplots-from-ls-into-one-and-separate-files-in-r #FITTING3: mkdir figures ggsave("./figures/alpha_diversity_Group2.png", device="png", height = 10, width = 12) ggsave("./figures/alpha_diversity_Group2.svg", device="svg", height = 10, width = 12) ``` # Selected alpha diversity ```{r, echo=TRUE, warning=FALSE, fig.cap="Alpha diversity", out.width = '100%', fig.align= "center"} knitr::include_graphics("./figures/alpha_diversity_Group2.png") selected_alpha_diversities<-read.csv("selected_alpha_diversities.txt",sep="\t") knitr::kable(selected_alpha_diversities) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) “` # Beta diversity “`{r, echo=TRUE, warning=FALSE, fig.cap=”Beta diversity”, out.width = ‘100%’, fig.align= “center”} #file:///home/jhuang/DATA/Data_Marius_16S/core_diversity_e42369/bdiv_even42369_Group/unweighted_unifrac_boxplots/Group_Stats.txt beta_diversity_group_stats<-read.csv("unweighted_unifrac_boxplots_Group_Stats.txt",sep="\t") knitr::kable(beta_diversity_group_stats) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) knitr::include_graphics(“./figures/PCoA.png”) “` # Differential abundance analysis Differential abundance analysis aims to find the differences in the abundance of each taxa between two groups of samples, assigning a significance value to each comparison. ## Group2 vs Group4 “`{r, echo=TRUE, warning=FALSE} library(“DESeq2”) #ALTERNATIVE using ps.ng.tax_most_copied: ps.ng.tax (40594) vs. ps.ng.tax_most_copied (166) ps.ng.tax_sel <- ps.ng.tax #FITTING5: correct the id of the group members, see FITTING6 otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("8","9","10","12","13","14", "21","22","23","24","25","26","27","28")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group4") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 0.05 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) #rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)) write.xlsx(sigtab, file = “sigtab_Group2_vs_Group4.xlsx”) #subv %in% v ### returns a vector TRUE FALSE #is.element(subv, v) ### returns a vector TRUE FALSE library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+ theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) #Error in checkForExperimentalReplicates(object, modelMatrix) : # The design matrix has the same number of samples and coefficients to fit, # so estimation of dispersion is not possible. Treating samples # as replicates was deprecated in v1.20 and no longer supported since v1.22. ``` ## Group2 vs Group6 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("8","9","10","12","13","14", "33","34","35","36","37","38","39","51")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group6") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 2.0 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+ theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ``` ## Group4 vs Group8 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("21","22","23","24","25","26","27","28", "47","48","49","50","52","53","55")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group8") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 0.05 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+ theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ``` ## Group6 vs Group8 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("33","34","35","36","37","38","39","51", "47","48","49","50","52","53","55")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group8") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 0.05 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+ theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ``` ## Group1 vs Group5 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("1","2","5","6","7", "29","30","31","32")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group5") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 2.0 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+ theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ``` ## Group4 vs Group8 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("21","22","23","24","25","26","27","28", "47","48","49","50","52","53","55")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group8") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 2.0 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ``` ## Group3 vs Group7 ```{r, echo=TRUE, warning=FALSE} ps.ng.tax_sel <- ps.ng.tax otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("15","16","17","18","19","20", "40","41","42","43","44","46")] diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group) diagdds$Group <- relevel(diagdds$Group, "Group7") diagdds = DESeq(diagdds, test="Wald", fitType="parametric") resultsNames(diagdds) res = results(diagdds, cooksCutoff = FALSE) alpha = 2.0 sigtab = res[which(res$padj < alpha), ] sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix")) sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ] kable(sigtab) %>% kable_styling(bootstrap_options = c(“striped”, “hover”, “condensed”, “responsive”)) library(“ggplot2”) theme_set(theme_bw()) scale_fill_discrete <- function(palname = "Set1", ...) { scale_fill_brewer(palette = palname, ...) } x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x)) x = sort(x) sigtab$Order = factor(as.character(sigtab$Order), levels=names(x)) x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x)) x = sort(x) sigtab$Family = factor(as.character(sigtab$Family), levels=names(x)) ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5)) ```

MicrobiotaProcess Group2 vs Group6 (v1)

https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html

diff_analysis_Group2_vs_Group6

PCoA2_Group2_vs_Group6

PCoA2_Group2_vs_Group6

  1. code of MicrobiotaProcess_Group2_vs_Group6.R

    # https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html
    
    # -----------------------------------
    # ---- prepare the R environment ----
    #Rscript MicrobiotaProcess.R
    #NOTE: exit R script, then login again R-environment; rm -rf Phyloseq*_cache
    rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html')
    
    # -----------------------------
    # ---- 3.1. bridges other tools
    ##https://github.com/YuLab-SMU/MicrobiotaProcess
    ##https://www.bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc/MicrobiotaProcess.html
    ##https://chiliubio.github.io/microeco_tutorial/intro.html#framework
    ##https://yiluheihei.github.io/microbiomeMarker/reference/plot_cladogram.html
    #BiocManager::install("MicrobiotaProcess")
    #install.packages("microeco")
    #install.packages("ggalluvial")
    #install.packages("ggh4x")
    
    library(MicrobiotaProcess)
    library(microeco)
    library(ggalluvial)
    library(ggh4x)
    library(gghalves)
    
    ## Convert the phyloseq object to a MicrobiotaProcess object
    #mp <- as.MicrobiotaProcess(ps.ng.tax)
    
    #mt <- phyloseq2microeco(ps.ng.tax) #--> ERROR
    #abundance_table <- mt$abun_table
    #taxonomy_table <- mt$tax_table
    
    #ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE)
    #ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE)
    
    ##OPTION1 (NOT_USED): take all samples, prepare ps.ng.tax_abund --> mpse_abund
    ##mpse <- ps.ng.tax %>% as.MPSE()
    #mpse_abund <- ps.ng.tax_abund %>% as.MPSE()
    
    ##OPTION2 (USED!): take partial samples, prepare ps.ng.tax or ps.ng.tax_abund (2 replacements!)--> ps.ng.tax_sel --> mpse_abund
    ps.ng.tax_sel <- ps.ng.tax_abund
    ##otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("1","2","5","6","7",  "15","16","17","18","19","20",  "29","30","31","32",  "40","41","42","43","44","46")]
    ##NOTE: Only choose Group2, Group4, Group6, Group8
    #> ps.ng.tax_sel
    #otu_table()   OTU Table:         [ 37465 taxa and 29 samples ]
    #sample_data() Sample Data:       [ 29 samples by 10 sample variables ]
    #tax_table()   Taxonomy Table:    [ 37465 taxa by 7 taxonomic ranks ]
    #phy_tree()    Phylogenetic Tree: [ 37465 tips and 37461 internal nodes ]
    #-Group4: "21","22","23","24","25","26","27","28",
    #-Group8: ,  "47","48","49","50","52","53","55"
    otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax_abund)[,c("8","9","10","12","13","14",  "33","34","35","36","37","38","39","51")]
    mpse_abund <- ps.ng.tax_sel %>% as.MPSE()
    # A MPSE-tibble (MPSE object) abstraction: 2,352 × 20
    # NOTE mpse_abund contains 20 variables: OTU, Sample, Abundance, BarcodeSequence, LinkerPrimerSequence, FileInput, Group,
    #   Sex_age 
    , pre_post_stroke , Conc , Vol_50ng , Vol_PCR , Description , # Domain , Phylum , Class , Order , Family , Genus , Species # ———————————– # —- 3.2. alpha diversity analysis # Rarefied species richness + RareAbundance mpse_abund %<>% mp_rrarefy() # ‘chunks’ represent the split number of each sample to calculate alpha # diversity, default is 400. e.g. If a sample has total 40000 # reads, if chunks is 400, it will be split to 100 sub-samples # (100, 200, 300,…, 40000), then alpha diversity index was # calculated based on the sub-samples. # ‘.abundance’ the column name of abundance, if the ‘.abundance’ is not be # rarefied calculate rarecurve, user can specific ‘force=TRUE’. mpse_abund %<>% mp_cal_rarecurve( .abundance = RareAbundance, chunks = 400 ) # The RareAbundanceRarecurve column will be added the colData slot # automatically (default action=”add”) #NOTE mpse_abund contains 22 varibles = 20 varibles + RareAbundance + RareAbundanceRarecurve # default will display the confidence interval around smooth. # se=TRUE # NOTE that two colors #c(“#00A087FF”, “#3C5488FF”) for .group = pre_post_stroke; four colors c(“#1f78b4”, “#33a02c”, “#e31a1c”, “#6a3d9a”) for .group = Group; p1 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, ) p2 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, .group = Group ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) # combine the samples belong to the same groups if plot.group=TRUE p3 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = “Observe”, .group = Group, plot.group = TRUE ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”),guide=”none”) png(“rarefaction_of_samples_or_groups.png”, width=1080, height=600) p1 + p2 + p3 dev.off() # —————————————— # 3.3. calculate alpha index and visualization library(ggplot2) library(MicrobiotaProcess) mpse_abund %<>% mp_cal_alpha(.abundance=RareAbundance) mpse_abund #NOTE mpse_abund contains 28 varibles = 22 varibles + Observe , Chao1 , ACE , Shannon , Simpson , Pielou f1 <- mpse_abund %>% mp_plot_alpha( .group=Group, .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) f2 <- mpse_abund %>% mp_plot_alpha( .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) #ps.ng.tax_sel contais only pre samples –> f1 cannot be generated! png(“alpha_diversity_comparison.png”, width=1400, height=600) f1 / f2 dev.off() # ——————————————- # 3.4. The visualization of taxonomy abundance (Class) mpse_abund %<>% mp_cal_abundance( # for each samples .abundance = RareAbundance ) %>% mp_cal_abundance( # for each groups .abundance=RareAbundance, .group=Group ) mpse_abund #NOTE mpse_abund contains 29 varibles = 28 varibles + RelRareAbundanceBySample # visualize the relative abundance of top 20 phyla for each sample. # .group=time, p1 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = TRUE ) # visualize the abundance (rarefied) of top 20 phyla for each sample. # .group=time, p2 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = FALSE ) png(“relative_abundance_and_abundance.png”, width= 1200, height=600) #NOT PRODUCED! p1 / p2 dev.off() #—- h1 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = TRUE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) h2 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = FALSE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) # the character (scale or theme) of figure can be adjusted by set_scale_theme # refer to the mp_plot_dist png(“relative_abundance_and_abundance_heatmap.png”, width= 1200, height=600) aplot::plot_list(gglist=list(h1, h2), tag_levels=”A”) dev.off() # visualize the relative abundance of top 20 class for each .group (Group) p3 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group=Group, taxa.class = Class, topn = 20, plot.group = TRUE ) # visualize the abundance of top 20 phyla for each .group (time) p4 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group= Group, taxa.class = Class, topn = 20, relative = FALSE, plot.group = TRUE ) png(“relative_abundance_and_abundance_groups.png”, width= 1000, height=1000) p3 / p4 dev.off() # ————————— # 3.5. Beta diversity analysis # ——————————————— # 3.5.1 The distance between samples or groups # standardization # mp_decostand wraps the decostand of vegan, which provides # many standardization methods for community ecology. # default is hellinger, then the abundance processed will # be stored to the assays slot. mpse_abund %<>% mp_decostand(.abundance=Abundance) mpse_abund #NOTE mpse_abund contains 30 varibles = 29 varibles + hellinger # calculate the distance between the samples. # the distance will be generated a nested tibble and added to the # colData slot. mpse_abund %<>% mp_cal_dist(.abundance=hellinger, distmethod=”bray”) mpse_abund #NOTE mpse_abund contains 31 varibles = 30 varibles + bray # mp_plot_dist provides there methods to visualize the distance between the samples or groups # when .group is not provided, the dot heatmap plot will be return p1 <- mpse_abund %>% mp_plot_dist(.distmethod = bray) png(“distance_between_samples.png”, width= 1000, height=1000) p1 dev.off() # when .group is provided, the dot heatmap plot with group information will be return. p2 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group) # The scale or theme of dot heatmap plot can be adjusted using set_scale_theme function. p2 %>% set_scale_theme( x = scale_fill_manual( values=c(“#1f78b4”, “#e31a1c”), #c(“orange”, “deepskyblue”), guide = guide_legend( keywidth = 1, keyheight = 0.5, title.theme = element_text(size=8), label.theme = element_text(size=6) ) ), aes_var = Group # specific the name of variable ) %>% set_scale_theme( x = scale_color_gradient( guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) %>% set_scale_theme( x = scale_size_continuous( range = c(0.1, 3), guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) png(“distance_between_samples_with_group_info.png”, width= 1000, height=1000) p2 dev.off() # when .group is provided and group.test is TRUE, the comparison of different groups will be returned # Assuming p3 is a ggplot object after mp_plot_dist call p3 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group, group.test = TRUE, textsize = 6) + theme( axis.title.x = element_text(size = 14), # Customize x-axis label face = “bold” axis.title.y = element_text(size = 14), # Customize y-axis label axis.text.x = element_text(size = 14), # Customize x-axis ticks axis.text.y = element_text(size = 14) # Customize y-axis ticks ) # Save the plot with the new theme settings png(“Comparison_of_Bray_Distances.png”, width = 1000, height = 1000) print(p3) # Ensure that p3 is explicitly printed in the device dev.off() # Extract Bray-Curtis Distance Values and save them in a Excel-table. library(dplyr) library(tidyr) library(openxlsx) # Define the sample numbers vector sample_numbers <- c("8", "9", "10", "12", "13", "14", "33", "34", "35", "36", "37", "38", "39", "51") # Consolidate the list of tibbles using the actual sample numbers bray_data <- bind_rows( lapply(seq_along(mpse_abund$bray), function(i) { tibble( Sample1 = sample_numbers[i], # Use actual sample number Sample2 = mpse_abund$bray[[i]]$braySampley, BrayDistance = mpse_abund$bray[[i]]$bray ) }), .id = "PairID" ) # Print the data frame to check the output print(bray_data) # Write the data frame to an Excel file write.xlsx(bray_data, file = "Bray_Curtis_Distances.xlsx") #DELETE the column "PairID" in Excel file # ----------------------- # 3.5.2 The PCoA analysis #install.packages("corrr") library(corrr) #install.packages("ggside") library(ggside) mpse_abund %<>% mp_cal_pcoa(.abundance=hellinger, distmethod=”bray”) # The dimensions of ordination analysis will be added the colData slot (default). mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles = 31 varibles + `PCo1 (30.16%)` , `PCo2 (15.75%)` , `PCo3 (10.53%)` #BUG why 36 variables in mpse_abund %>% print(width=380, n=1) [RareAbundanceBySample , RareAbundanceByGroup ] #> methods(class=class(mpse_abund)) # [1] [ [[<- [<- # [4] $ $<- arrange # [7] as_tibble as.data.frame as.phyloseq #[10] coerce coerce<- colData<- #[13] distinct filter group_by #[16] left_join mp_adonis mp_aggregate_clade #[19] mp_aggregate mp_anosim mp_balance_clade #[22] mp_cal_abundance mp_cal_alpha mp_cal_cca #[25] mp_cal_clust mp_cal_dca mp_cal_dist #[28] mp_cal_nmds mp_cal_pca mp_cal_pcoa #[31] mp_cal_pd_metric mp_cal_rarecurve mp_cal_rda #[34] mp_cal_upset mp_cal_venn mp_decostand #[37] mp_diff_analysis mp_diff_clade mp_envfit #[40] mp_extract_abundance mp_extract_assays mp_extract_dist #[43] mp_extract_feature mp_extract_internal_attr mp_extract_rarecurve #[46] mp_extract_refseq mp_extract_sample mp_extract_taxonomy #[49] mp_extract_tree mp_filter_taxa mp_mantel #[52] mp_mrpp mp_plot_abundance mp_plot_alpha #[55] mp_plot_diff_boxplot mp_plot_diff_res mp_plot_dist #[58] mp_plot_ord mp_plot_rarecurve mp_plot_upset #[61] mp_plot_venn mp_rrarefy mp_select_as_tip #[64] mp_stat_taxa mutate otutree #[67] otutree<- print pull #[70] refsequence refsequence<- rename #[73] rownames<- select show # [ reached getOption("max.print") -- omitted 6 entries ] #see '?methods' for accessing help and source code # We also can perform adonis or anosim to check whether it is significant to the dissimilarities of groups. mpse_abund %<>% mp_adonis(.abundance=hellinger, .formula=~Group, distmethod=”bray”, permutations=9999, action=”add”) mpse_abund %>% mp_extract_internal_attr(name=adonis) #NOTE mpse_abund contains 34 varibles, no new variable, it has been saved in mpse_abund and can be extracted with “mpse_abund %>% mp_extract_internal_attr(name=’adonis’)” #The result of adonis has been saved to the internal attribute ! #It can be extracted using this-object %>% mp_extract_internal_attr(name=’adonis’) #The object contained internal attribute: PCoA ADONIS #Permutation test for adonis under reduced model #Terms added sequentially (first to last) #Permutation: free #Number of permutations: 9999 # #vegan::adonis2(formula = .formula, data = sampleda, permutations = permutations, method = distmethod) # Df SumOfSqs R2 F Pr(>F) #Group 1 0.23448 0.22659 3.5158 5e-04 *** #Residual 12 0.80032 0.77341 #Total 13 1.03480 1.00000 #— #Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 # (“1″,”2″,”5″,”6″,”7”, “15”,”16″,”17″,”18″,”19″,”20″, “29”,”30″,”31″,”32″, “40”,”41″,”42″,”43″,”44″,”46″) #div.df2[div.df2 == “Group1”] <- "aged.post" #div.df2[div.df2 == "Group3"] <- "young.post" #div.df2[div.df2 == "Group5"] <- "aged.post" #div.df2[div.df2 == "Group7"] <- "young.post" # ("8","9","10","12","13","14", "21","22","23","24","25","26","27","28", "33","34","35","36","37","38","39","51", "47","48","49","50","52","53","55") #div.df2[div.df2 == "Group2"] <- "aged.pre" #div.df2[div.df2 == "Group4"] <- "young.pre" #div.df2[div.df2 == "Group6"] <- "aged.pre" #div.df2[div.df2 == "Group8"] <- "young.pre" #Group1: f.aged and post #Group2: f.aged and pre #Group3: f.young and post #Group4: f.young and pre #Group5: m.aged and post #Group6: m.aged and pre #Group7: m.young and post #Group8: m.young and pre #[,c("1","2","5","6","7", "8","9","10","12","13","14")] #[,c("15","16","17","18","19","20", "21","22","23","24","25","26","27","28")] #[,c("29","30","31","32", "33","34","35","36","37","38","39","51")] #[,c("40","41","42","43","44","46", "47","48","49","50","52","53","55")] #For the first set: #a6cee3: This is a light blue color, somewhat pastel and soft. #b2df8a: A soft, pale green, similar to a light lime. #fb9a99: A soft pink, slightly peachy or salmon-like. #cab2d6: A pale purple, reminiscent of lavender or a light mauve. #For the second set: #1f78b4: This is a strong, vivid blue, close to cobalt or a medium-dark blue. #33a02c: A medium forest green, vibrant and leafy. #e31a1c: A bright red, very vivid, similar to fire engine red. #6a3d9a: This would be described as a deep purple, akin to a dark lavender or plum. p1 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = 2.4, .alpha = 1, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( #values = c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) + scale_color_manual( #values=c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) #scale_fill_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) + #scale_color_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) #scale_fill_manual(values=c(“#00A087FF”, “#3C5488FF”)) + #scale_color_manual(values=c(“#00A087FF”, “#3C5488FF”)) #png(“PCoA.png”, width= 1000, height=1000) #svg(“PCoA.svg”, width= 11, height=10) #svg(“PCoA_.svg”, width=10, height=10) #svg(“PCoA.svg”) pdf(“PCoA_Group2_vs_Group6.pdf”) p1 dev.off() #FF0000: Red #000000: Black #0000FF: Blue #C0C0C0: Silver #00FF00: Lime (often referred to simply as Green in web colors) #FFFF00: Yellow #00FFFF: Aqua (also known as Cyan) #FFA500: Orange # The size of point also can be mapped to other variables such as Observe, or Shannon # Then the alpha diversity and beta diversity will be displayed simultaneously. p2 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = Shannon, .alpha = Observe, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_color_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_size_continuous( range=c(0.5, 3), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) pdf(“PCoA2_Group2_vs_Group6.pdf”) p2 dev.off() # —————————————— # 3.5.3 Hierarchical cluster (tree) analysis #input should contain hellinger! mpse_abund %<>% mp_cal_clust( .abundance = hellinger, distmethod = “bray”, hclustmethod = “average”, # (UPGAE) action = “add” # action is used to control which result will be returned ) mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles, no new variable, the column bray has been new calculated! # if action = ‘add’, the result of hierarchical cluster will be added to the MPSE object # mp_extract_internal_attr can extract it. It is a treedata object, so it can be visualized # by ggtree. sample.clust <- mpse_abund %>% mp_extract_internal_attr(name=’SampleClust’) #The object contained internal attribute: PCoA ADONIS SampleClust sample.clust #–> The associated data tibble abstraction: 27 × 30 library(ggtree) p <- ggtree(sample.clust) + geom_tippoint(aes(color=Group)) + geom_tiplab(as_ylab = TRUE) + ggplot2::scale_x_continuous(expand=c(0, 0.01)) png("hierarchical_cluster1.png", width= 1000, height=800) p dev.off() #https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html # mapping = aes(x = RelRareAbundanceBySample-->Group, # y = Sample–>Group, # fill = Phyla # ), library(ggtreeExtra) library(ggplot2) # Extract relative abundance of phyla phyla.tb <- mpse_abund %>% mp_extract_abundance(taxa.class=Phylum, topn=30) # The abundance of each samples is nested, it can be flatted using the unnest of tidyr. phyla.tb %<>% tidyr::unnest(cols=RareAbundanceBySample) %>% dplyr::rename(Phyla=”label”) phyla.tb phyla.tb %>% print(width=380, n=10) p1 <- p + geom_fruit( data=phyla.tb, geom=geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Phyla ), orientation = "y", #offset = 0.4, pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of phyla (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) png("hierarchical_cluster2_Phyla.png", width = 1000, height = 800) p1 dev.off() # Extract relative abundance of classes class.tb <- mpse_abund %>% mp_extract_abundance(taxa.class = Class, topn = 30) # Flatten and rename the columns class.tb %<>% tidyr::unnest(cols = RareAbundanceBySample) %>% dplyr::rename(Class = “label”) # View the data frame class.tb # Create the plot p1 <- p + geom_fruit( data = class.tb, geom = geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Class ), orientation = "y", pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of classes (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) # Save the plot to a file #ERROR-->NEED to be DEBUGGED! png(“hierarchical_cluster2_Class.png”, width = 1000, height = 800) print(p1) dev.off() # ———————– # 3.6 Biomarker discovery library(ggtree) library(ggtreeExtra) library(ggplot2) library(MicrobiotaProcess) library(tidytree) library(ggstar) library(forcats) mpse_abund %>% print(width=150) #mpse_abund %<>% # mp_cal_abundance( # for each samples # .abundance = RareAbundance # ) %>% # mp_cal_abundance( # for each groups # .abundance=RareAbundance, # .group=Group # ) #mpse_abund mpse_abund %<>% mp_diff_analysis( .abundance = RelRareAbundanceBySample, .group = Group, first.test.alpha = 0.01, filter.p=”pvalue” ) # The result is stored to the taxatree or otutree slot, you can use mp_extract_tree to extract the specific slot. taxa.tree <- mpse_abund %>% mp_extract_tree(type=”taxatree”) taxa.tree ## And the result tibble of different analysis can also be extracted ## with tidytree (>=0.3.5) taxa.tree %>% select(label, nodeClass, LDAupper, LDAmean, LDAlower, Sign_Group, pvalue, fdr) %>% dplyr::filter(!is.na(fdr)) taxa.tree %>% print(width=150, n=1) # Since taxa.tree is treedata object, it can be visualized by ggtree and ggtreeExtra p1 <- ggtree( taxa.tree, layout="radial", size = 0.3 ) + geom_point( data = td_filter(!isTip), fill="white", size=1, shape=21 ) # display the high light of phylum clade. p2 <- p1 + geom_hilight( data = td_filter(nodeClass == "Phylum"), mapping = aes(node = node, fill = label) ) # display the relative abundance of features(OTU) p3 <- p2 + ggnewscale::new_scale("fill") + geom_fruit( data = td_unnest(RareAbundanceBySample), geom = geom_star, mapping = aes( x = fct_reorder(Sample, Group, .fun=min), size = RelRareAbundanceBySample, fill = Group, subset = RelRareAbundanceBySample > 0 ), starshape = 13, starstroke = 0.25, offset = 0.03, pwidth = 0.4, grid.params = list(linetype=2) ) + scale_size_continuous( name=”Relative Abundance (%)”, range = c(.5, 3) ) + scale_fill_manual(values=c(“#1B9E77”, “#D95F02”)) # display the tip labels of taxa tree p4 <- p3 + geom_tiplab(size=6, offset=4.0) # display the LDA of significant OTU. #p5 <- p4 + # ggnewscale::new_scale("fill") + # geom_fruit( # geom = geom_col, # mapping = aes( # x = LDAmean, # fill = Sign_Group, # subset = !is.na(LDAmean) # ), # orientation = "y", # offset = 0.3, # pwidth = 0.5, # axis.params = list(axis = "x", # title = "Log10(LDA)", # title.height = 0.01, # title.size = 2, # text.size = 1.8, # vjust = 1), # grid.params = list(linetype = 2) # ) # display the significant (FDR-->pvalue) taxonomy after kruskal.test (default) #shape = 21, #scale_size_continuous(range=c(1, 3)) + p6 <- p4 + ggnewscale::new_scale("size") + geom_point( data=td_filter(!is.na(Sign_Group)), mapping = aes(size = -log10(pvalue), fill = Sign_Group, ), shape = 21, ) + scale_size_continuous(range=c(1, 4)) + scale_fill_manual(values=c("#1B9E77", "#D95F02")) svg("diff_analysis_Group2_vs_Group6.svg",width=22, height=22) #png("differently_expressed_otu.png", width=2000, height=2000) p6 + theme( legend.key.height = unit(1.0, "cm"), legend.key.width = unit(1.0, "cm"), legend.spacing.y = unit(0.01, "cm"), legend.text = element_text(size = 20), legend.title = element_text(size = 20) #legend.position = c(0.99, 0.01) ) dev.off() #-- save the data in an Excel-file -- #install.packages("tidyverse") #library(tidyverse) install.packages("dplyr") install.packages("readr") library(dplyr) library(readr) # Extracting different parts of mpse_abund, assuming these functions are applicable: abundance_data <- as.data.frame(mp_extract_abundance(mpse_abund)) taxonomy_data <- as.data.frame(mp_extract_taxonomy(mpse_abund)) # Joining the data together by a common identifier, assuming 'OTU' is present in both combined_data <- left_join(abundance_data, taxonomy_data, by = "OTU") # Install and load openxlsx package if not already installed if (!require(openxlsx)) { install.packages("openxlsx") library(openxlsx) } # Assuming `abundance_data` has lists that need flattening; example for one column: abundance_data <- abundance_data %>% mutate(RareAbundanceBySample = sapply(RareAbundanceBySample, function(x) paste(x, collapse = “, “))) %>% mutate(RareAbundanceByGroup = sapply(RareAbundanceByGroup, function(x) paste(x, collapse = “, “))) # Check the structure now str(abundance_data) # Rename the ‘label’ column in abundance_data to ‘OTU’ colnames(abundance_data)[colnames(abundance_data) == “label”] <- "OTU" # Merge the cleaned abundance data with taxonomy data combined_data <- left_join(abundance_data, taxonomy_data, by = "OTU") # Check the resulting data frame str(combined_data) library(openxlsx) # Write the data frame to an Excel file write.xlsx(combined_data, "diff_analysis_Group2_vs_Group6.xlsx") #delete RareAbundanceBySample! # ------ Deprecated ------ #.data, layout, tree.type, .taxa.class, tiplab.size, offset.abun, pwidth.abun, offset.effsize, pwidth.effsize, group.abun, tiplab.linetype p <- mpse_abund %>% mp_plot_diff_res( group.abun = FALSE, pwidth.abun=0.01, offset.abun=0.2, pwidth.effsize=0.01, offset.effsize=0.2, tiplab.size = 5.0, tiplab.linetype = 3 ) + scale_fill_manual(values=c(“deepskyblue”, “orange”)) + scale_fill_manual( aesthetics = “fill_new”, # The fill aes was renamed to “fill_new” for the abundance dotplot layer values = c(“deepskyblue”, “orange”) ) + scale_fill_manual( aesthetics = “fill_new_new”, # The fill aes for hight light layer of tree was renamed to ‘fill_new_new’ values = c(“#E41A1C”, “#377EB8”, “#4DAF4A”, “#984EA3”, “#FF7F00”, “#FFFF33”, “#A65628”, “#F781BF”, “#00FFFF”, “#999999” ) ) + theme( axis.title = element_text(size = 28), # Font size for axis titles axis.text = element_text(size = 28), # Font size for axis text plot.title = element_text(size = 16), # Font size for plot title legend.title = element_text(size = 16), # Font size for legend title legend.text = element_text(size = 14) # Font size for legend text ) #p$layers[[2]]$geom <- geom_tiplab(fontsize = 22) # Change 12 to the desired font size p <- mpse_abund %>% mp_plot_diff_res( group.abun = TRUE, pwidth.abun=0.05, offset.abun=0.04, pwidth.effsize=0.3, offset.effsize=0.6, tiplab.size = 4.9, barplot.x = -log10(pvalue) ) + scale_fill_manual(values=c(“deepskyblue”, “orange”)) + scale_fill_manual( aesthetics = “fill_new”, # The fill aes was renamed to “fill_new” for the abundance dotplot layer values = c(“deepskyblue”, “orange”) ) + scale_fill_manual( aesthetics = “fill_new_new”, # The fill aes for hight light layer of tree was renamed to ‘fill_new_new’ values = c(“#E41A1C”, “#377EB8”, “#4DAF4A”, “#984EA3”, “#FF7F00”, “#FFFF33”, “#A65628”, “#F781BF”, “#00FFFF”, “#999999” ) ) + theme( axis.title = element_text(size = 28), # Font size for axis titles axis.text = element_text(size = 28), # Font size for axis text plot.title = element_text(size = 28), # Font size for plot title legend.title = element_text(size = 16), # Font size for legend title legend.text = element_text(size = 14) # Font size for legend text ) #png(“differently_expressed_otu.png”, width=2000, height=2000) svg(“p7.svg”,width=22, height=22) p dev.off() p <- mpse_abund %>% mp_plot_diff_res( group.abun = FALSE, pwidth.abun=0.1, tiplab.size = 0.1, offset.effsize=0.1, pwidth.effsize=0.2 ) + scale_fill_manual(values=c(“deepskyblue”, “orange”)) + scale_fill_manual( aesthetics = “fill_new”, # The fill aes was renamed to “fill_new” for the abundance dotplot layer values = c(“deepskyblue”, “orange”) ) + scale_fill_manual( aesthetics = “fill_new_new”, # The fill aes for hight light layer of tree was renamed to ‘fill_new_new’ values = c(“#E41A1C”, “#377EB8”, “#4DAF4A”, “#984EA3”, “#FF7F00”, “#FFFF33”, “#A65628”, “#F781BF”, “#00FFFF”, “#999999” ) ) #svg(“p8.svg”,width=22, height=22) png(“differently_expressed_otu.png”, width=2000, height=2000) p dev.off() f <- mpse_abund %>% mp_plot_diff_cladogram( label.size = 2.5, hilight.alpha = .3, bg.tree.size = .5, bg.point.size = 2, bg.point.stroke = .25 ) + scale_fill_diff_cladogram( # set the color of different group. values = c(‘deepskyblue’, ‘orange’) ) + scale_size_continuous(range = c(1, 4)) #png(“cladogram.png”, width=1000, height=1000) svg(“cladogram.svg”, width=10, height=10) f dev.off() ## Extract the OTU table and taxonomy table from the phyloseq object otu_table <- phyloseq::otu_table(ps.ng.tax_abund) %>% as.data.frame() %>% as.matrix() tax_table <- phyloseq::tax_table(ps.ng.tax_abund) %>% as.data.frame() %>% as.matrix() write.csv(otu_table, file=”otu_table.csv”) write.csv(tax_table, file=”tax_table.csv”) #~/Tools/csv2xls-0.4/csv_to_xls.py otu_table.csv tax_table.csv -d’,’ -o otu_tax.xls
  2. code of Phyloseq.Rmd

    author: ""
    date: '`r format(Sys.time(), "%d %m %Y")`'
    header-includes:
      - \usepackage{color, fancyvrb}
    output:
      rmdformats::readthedown:
        highlight: kate
        number_sections : yes
      pdf_document:
        toc: yes
        toc_depth: 2
        number_sections : yes
    ---
    
    ```{r, echo=FALSE, warning=FALSE}
    ## Global options
    # TODO: reproduce the html with the additional figure/SVN-files for editing.
    # IMPORTANT NOTE: needs before "mkdir figures"
    #rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html')
    ```
    
    ```{r load-packages, include=FALSE}
    library(knitr)
    library(rmdformats)
    library(readxl)
    library(dplyr)
    library(kableExtra)
    
    options(max.print="75")
    knitr::opts_chunk$set(fig.width=8,
                          fig.height=6,
                          eval=TRUE,
                          cache=TRUE,
                          echo=TRUE,
                          prompt=FALSE,
                          tidy=TRUE,
                          comment=NA,
                          message=FALSE,
                          warning=FALSE)
    opts_knit$set(width=85)
    # Phyloseq R library
    #* Phyloseq web site : https://joey711.github.io/phyloseq/index.html
    #* See in particular tutorials for
    #    - importing data: https://joey711.github.io/phyloseq/import-data.html
    #    - heat maps: https://joey711.github.io/phyloseq/plot_heatmap-examples.html
    ```
    
    # Data
    
    Import raw data and assign sample key:
    
    ```{r, echo=TRUE, warning=FALSE}
    #extend map_corrected.txt with Diet and Flora
    #setwd("~/DATA/Data_Laura_16S_2/core_diversity_e4753")
    map_corrected <- read.csv("map_corrected.txt", sep="\t", row.names=1)
    knitr::kable(map_corrected) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    ```
    
    # Prerequisites to be installed
    
    * R : https://pbil.univ-lyon1.fr/CRAN/
    * R studio : https://www.rstudio.com/products/rstudio/download/#download
    
    ```R
    install.packages("dplyr")     # To manipulate dataframes
    install.packages("readxl")    # To read Excel files into R
    install.packages("ggplot2")   # for high quality graphics
    install.packages("heatmaply")
    source("https://bioconductor.org/biocLite.R")
    biocLite("phyloseq")
    ```
    
    ```{r libraries, echo=TRUE, message=FALSE}
    library("readxl") # necessary to import the data from Excel file
    library("ggplot2") # graphics
    library("picante")
    library("microbiome") # data analysis and visualisation
    library("phyloseq") # also the basis of data object. Data analysis and visualisation
    library("ggpubr") # publication quality figures, based on ggplot2
    library("dplyr") # data handling, filter and reformat data frames
    library("RColorBrewer") # nice color options
    library("heatmaply")
    library(vegan)
    library(gplots)
    ```
    
    # Read the data and create phyloseq objects
    
    Three tables are needed
    
    * OTU
    * Taxonomy
    * Samples
    
    ```{r, echo=TRUE, warning=FALSE}
        #Change your working directory to where the files are located
        ps.ng.tax <- import_biom("./table_even42369.biom", "./clustering/rep_set.tre")
        sample <- read.csv("./map_corrected.txt", sep="\t", row.names=1)
        SAM = sample_data(sample, errorIfNULL = T)
        rownames(SAM) <-
        c("1","2","3","5","6","7","8","9","10","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","46","47","48","49","50","51","52","53","55")
        ps.ng.tax <- merge_phyloseq(ps.ng.tax, SAM)
        print(ps.ng.tax)
        colnames(tax_table(ps.ng.tax)) <- c("Domain","Phylum","Class","Order","Family","Genus","Species")
        saveRDS(ps.ng.tax, "./ps.ng.tax.rds")
    ```
    
    Visualize data
    ```{r, echo=TRUE, warning=FALSE}
      sample_names(ps.ng.tax)
      rank_names(ps.ng.tax)
      sample_variables(ps.ng.tax)
    ```
    
    Normalize number of reads in each sample using median sequencing depth.
    ```{r, echo=TRUE, warning=FALSE}
    # RAREFACTION
    #set.seed(9242)  # This will help in reproducing the filtering and nomalisation.
    #ps.ng.tax <- rarefy_even_depth(ps.ng.tax, sample.size = 42369)
    #total <- 42369
    
    # NORMALIZE number of reads in each sample using median sequencing depth.
    total = median(sample_sums(ps.ng.tax))
    #> total
    #[1] 42369
    standf = function(x, t=total) round(t * (x / sum(x)))
    ps.ng.tax = transform_sample_counts(ps.ng.tax, standf)
    ps.ng.tax_rel <- microbiome::transform(ps.ng.tax, "compositional")
    
    saveRDS(ps.ng.tax, "./ps.ng.tax.rds")
    hmp.meta <- meta(ps.ng.tax)
    hmp.meta$sam_name <- rownames(hmp.meta)
    ```
    
    # Heatmaps
    
    ```{r, echo=TRUE, warning=FALSE}
    #MOVE_FROM_ABOVE: The number of reads used for normalization is **`r sprintf("%.0f", total)`**.
    #A basic heatmap using the default parameters.
    #  plot_heatmap(ps.ng.tax, method = "NMDS", distance = "bray")
    #NOTE that giving the correct OTU numbers in the text (1%, 0.5%, ...)!!!
    ```
    
    We consider the most abundant OTUs for heatmaps. For example one can only take OTUs that represent at least 1% of reads in at least one sample. Remember we normalized all the sampples to median number of reads (total).  We are left with only 168 OTUS which makes the reading much more easy.
    ```{r, echo=TRUE, warning=FALSE}
    
    # Custom function to plot a heatmap with the specified sample order
    #plot_heatmap_custom <- function(ps, sample_order, method = "NMDS", distance = "bray") {
    ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE)
    kable(otu_table(ps.ng.tax_abund)) %>%
    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    # Calculate the relative abundance for each sample
    ps.ng.tax_abund_rel <- transform_sample_counts(ps.ng.tax_abund, function(x) x / sum(x))
    
    datamat_ = as.data.frame(otu_table(ps.ng.tax_abund))
    #datamat <- datamat_[c("1","2","5","6","7",  "8","9","10","12","13","14",    "15","16","17","18","19","20",  "21","22","23","24","25","26","27","28",    "29","30","31","32",  "33","34","35","36","37","38","39","51",    "40","41","42","43","44","46",  "47","48","49","50","52","53","55")]
    datamat <- datamat_[c("8","9","10","12","13","14",    "21","22","23","24","25","26","27","28",    "33","34","35","36","37","38","39","51",    "47","48","49","50","52","53","55")]
    hr <- hclust(as.dist(1-cor(t(datamat), method="pearson")), method="complete")
    hc <- hclust(as.dist(1-cor(datamat, method="spearman")), method="complete")
    mycl = cutree(hr, h=max(hr$height)/1.08)
    mycol = c("YELLOW", "DARKBLUE", "DARKORANGE", "DARKMAGENTA", "DARKCYAN", "DARKRED",  "MAROON", "DARKGREEN", "LIGHTBLUE", "PINK", "MAGENTA", "LIGHTCYAN","LIGHTGREEN", "BLUE", "ORANGE", "CYAN", "RED", "GREEN");
    
    mycol = mycol[as.vector(mycl)]
    sampleCols <- rep('GREY',ncol(datamat))
    #names(sampleCols) <- c("Group1", "Group1", "Group1", "Group1", "Group1",   "Group2", "Group2", "Group2", "Group2", "Group2","Group2",    "Group3", "Group3", "Group3", "Group3",   "Group1", "Group1", "Group1", "Group1", "Group1",   "Group1", "Group1", "Group1", "Group1", "Group1",  "Group1", "Group1", "Group1", "Group1", "Group1",  "Group1", "Group1", "Group1", "Group1", "Group1",  "Group1", "Group1", "Group1", "Group1", "Group1",    "Group1", "Group1", "Group1", "Group1", "Group1",  "Group1", "Group1", "Group1", "Group1", "Group1")
    
    #sampleCols[colnames(datamat)=='1'] <- '#a6cee3'
    #sampleCols[colnames(datamat)=='2'] <- '#a6cee3'
    #sampleCols[colnames(datamat)=='5'] <- '#a6cee3'
    #sampleCols[colnames(datamat)=='6'] <- '#a6cee3'
    #sampleCols[colnames(datamat)=='7'] <- '#a6cee3'
    
    sampleCols[colnames(datamat)=='8'] <- '#1f78b4'
    sampleCols[colnames(datamat)=='9'] <- '#1f78b4'
    sampleCols[colnames(datamat)=='10'] <- '#1f78b4'
    sampleCols[colnames(datamat)=='12'] <- '#1f78b4'
    sampleCols[colnames(datamat)=='13'] <- '#1f78b4'
    sampleCols[colnames(datamat)=='14'] <- '#1f78b4'
    
    #sampleCols[colnames(datamat)=='15'] <- '#b2df8a'
    #sampleCols[colnames(datamat)=='16'] <- '#b2df8a'
    #sampleCols[colnames(datamat)=='17'] <- '#b2df8a'
    #sampleCols[colnames(datamat)=='18'] <- '#b2df8a'
    #sampleCols[colnames(datamat)=='19'] <- '#b2df8a'
    #sampleCols[colnames(datamat)=='20'] <- '#b2df8a'
    
    sampleCols[colnames(datamat)=='21'] <- '#33a02c'
    sampleCols[colnames(datamat)=='22'] <- '#33a02c'
    sampleCols[colnames(datamat)=='23'] <- '#33a02c'
    sampleCols[colnames(datamat)=='24'] <- '#33a02c'
    sampleCols[colnames(datamat)=='25'] <- '#33a02c'
    sampleCols[colnames(datamat)=='26'] <- '#33a02c'
    sampleCols[colnames(datamat)=='27'] <- '#33a02c'
    sampleCols[colnames(datamat)=='28'] <- '#33a02c'
    
    #sampleCols[colnames(datamat)=='29'] <- '#fb9a99'
    #sampleCols[colnames(datamat)=='30'] <- '#fb9a99'
    #sampleCols[colnames(datamat)=='31'] <- '#fb9a99'
    #sampleCols[colnames(datamat)=='32'] <- '#fb9a99'
    
    sampleCols[colnames(datamat)=='33'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='34'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='35'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='36'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='37'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='38'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='39'] <- '#e31a1c'
    sampleCols[colnames(datamat)=='51'] <- '#e31a1c'
    
    #sampleCols[colnames(datamat)=='40'] <- '#cab2d6'
    #sampleCols[colnames(datamat)=='41'] <- '#cab2d6'
    #sampleCols[colnames(datamat)=='42'] <- '#cab2d6'
    #sampleCols[colnames(datamat)=='43'] <- '#cab2d6'
    #sampleCols[colnames(datamat)=='44'] <- '#cab2d6'
    #sampleCols[colnames(datamat)=='46'] <- '#cab2d6'
    
    sampleCols[colnames(datamat)=='47'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='48'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='49'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='50'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='52'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='53'] <- '#6a3d9a'
    sampleCols[colnames(datamat)=='55'] <- '#6a3d9a'
    #bluered(75)
    #color_pattern <- colorRampPalette(c("blue", "white", "red"))(100)
    library(RColorBrewer)
    custom_palette <- colorRampPalette(brewer.pal(9, "Blues"))
    heatmap_colors <- custom_palette(100)
    #colors <- heatmap_color_default(100)
    png("figures/heatmap.png", width=1200, height=2400)
    #par(mar=c(2, 2, 2, 2))  , lwid=1    lhei=c(0.7, 10)) # Adjust height of color keys   keysize=0.3,
    heatmap.2(as.matrix(datamat),Rowv=as.dendrogram(hr),Colv = NA, dendrogram = 'row',
                scale='row',trace='none',col=heatmap_colors, cexRow=1.2, cexCol=1.5,
                RowSideColors = mycol, ColSideColors = sampleCols, srtCol=15, labRow=row.names(datamat), key=TRUE, margins=c(10, 15), lhei=c(0.7, 15), lwid=c(1,8))
    dev.off()
    ```
    ```{r, echo=TRUE, warning=FALSE, fig.cap="Heatmap", out.width = '100%', fig.align= "center"}
    knitr::include_graphics("./figures/heatmap.png")
    ```
    
    ```{r, echo=FALSE, warning=FALSE}
      #It is possible to use different distances and different multivaraite methods. Many different built-in distances can be used.
      #dist_methods <- unlist(distanceMethodList)
      #print(dist_methods)
    ```
    
    \pagebreak
    
    # Taxonomic summary
    
    ## Bar plots in phylum level
    
    ```{r, echo=FALSE, warning=FALSE}
    #Make the bargraph nicer by removing OTUs boundaries. This is done by adding ggplot2 modifier.
    # 1: uniform color. Color is for the border, fill is for the inside
    #ggplot(mtcars, aes(x=as.factor(cyl) )) +
    #  geom_bar(color="blue", fill=rgb(0.1,0.4,0.5,0.7) )
    # 2: Using Hue
    #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) +
    #  geom_bar( ) +
    #  scale_fill_hue(c = 40) +
    #  theme(legend.position="none")
    # 3: Using RColorBrewer
    #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) +
    #  geom_bar( ) +
    #  scale_fill_brewer(palette = "Set1") +
    #  theme(legend.position="none")
    # 4: Using greyscale:
    #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) +
    #  geom_bar( ) +
    #  scale_fill_grey(start = 0.25, end = 0.75) +
    #  theme(legend.position="none")
    # 5: Set manualy
    #ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl) )) +
    #  geom_bar( ) +
    #  scale_fill_manual(values = c("red", "green", "blue") ) +
    #  theme(legend.position="none")
    #NOT SUCCESSFUL!
    #allGroupsColors<- c(
    #  "grey0", "grey50", "dodgerblu", "deepskyblue",
    #  "red", "darkred", "green", "green4")
    #  plot_bar(ps.ng.tax_rel, fill="Phylum") +
    #  geom_bar(stat="identity", position="stack") + scale_color_manual(values = allGroupsColors) #, fill=Phylum   + scale_fill_brewer(palette = "Set1")
      # ##### Keep only the most abundant phyla and
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Actinobacteria")) #1.57
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Bacteroidetes"))  #27.27436
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Cyanobacteria"))  #0.02244249
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Epsilonbacteraeota"))  #0.01309145
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Euryarchaeota"))  #0.1210024
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Firmicutes"))     #32.50589
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Lentisphaerae"))  #0.0001870208
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Patescibacteria")) #0.008789976
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Planctomycetes")) #0.01365252
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Proteobacteria")) #6.769216
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Synergistetes"))  #0.005049561
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Tenericutes"))    #0.0005610623
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Verrucomicrobia"))  #2.076304
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c(NA))  #sum(otu_table(ps.ng.tax_most)) = 2.619413
    ```
    ```{r, echo=TRUE, warning=FALSE}
      library(ggplot2)
      geom.text.size = 6
      theme.size = 8 #(14/5) * geom.text.size
      #ps.ng.tax_most <- subset_taxa(ps.ng.tax_rel, Phylum %in% c("D_1__Actinobacteria", "D_1__Bacteroidetes", "D_1__Firmicutes", "D_1__Proteobacteria", "D_1__Verrucomicrobia", NA))
      ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE)
      #CONSOLE(OPTIONAL): for sampleid in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73; do
      #echo "otu_table(ps.ng.tax_most)[,${sampleid}]=otu_table(ps.ng.tax_most)[,${sampleid}]/sum(otu_table(ps.ng.tax_most)[,${sampleid}])" done
      #OR
      ps.ng.tax_most_ = transform_sample_counts(ps.ng.tax_most, function(x) x / sum(x))
    ```
    
    ```{r, echo=FALSE, warning=FALSE}
      ##--Creating 100% stacked bar plots with less abundant taxa in a sub-category #901--
      ##https://github.com/joey711/phyloseq/issues/901
      ##ps.ng.tax_most_df <- psmelt(ps.ng.tax_most_)  #5986x19
      #glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Phylum')
      #tax_table(glom) # should list # taxa as # phyla
      #data <- psmelt(glom) # create dataframe from phyloseq object
      #data$Phylum <- as.character(data$Phylum) #convert to character
      ##simple way to rename phyla with < 1% abundance
      #data$Phylum[data$Abundance < 0.001] <- "< 0.1% abund."
      #
      #library(plyr)
      #medians <- ddply(data, ~Phylum, function(x) c(median=median(x$Abundance)))
      #remainder <- medians[medians$median <= 0.001,]$Phylum
      #data[data$Phylum %in% remainder,]$Phylum <- "Phyla < 0.1% abund."
      #data$Phylum[data$Abundance < 0.001] <- "Phyla < 0.1% abund."
      ##--> data are not used!
      #
      ##in class level
      #glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Class')
      #tax_table(glom) # should list # taxa as # phyla
      #data <- psmelt(glom) # create dataframe from phyloseq object
      #data$Class <- as.character(data$Class) #convert to character
      #
      ##simple way to rename phyla with < 1% abundance
      #data$Class[data$Abundance < 0.001] <- "< 0.1% abund."
      #Count = length(unique(data$Class))
      #
      ##unique(data$Class)
      ##data$Class <- factor(data$Class, levels = c("Bacilli", "Bacteroidia", "Verrucomicrobiae", "Clostridia", "Gammaproteobacteria", "Alphaproteobacteria", "Actinobacteria", "Negativicutes", "Erysipelotrichia", "Methanobacteria", "< 0.1% abund."))
      ##------- Creating 100% stacked bar plots END --------
    
      library(stringr)
    #FITTING1:
    # tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2]
    # ... ...
    # tax_table(ps.ng.tax_most_)[167,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Species"], "__")[[1]][2]
    #ps.ng.tax_most_
    #in total [ 89 taxa and 55 samples ]
    #otu_table()   OTU Table:         [ 166 taxa and 54 samples ]
    #otu_table()   OTU Table:         [ 168 taxa and 50 samples ]
    #for id in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166; do
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Domain\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Domain\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Phylum\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Phylum\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Class\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Class\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Order\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Order\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Family\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Family\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Genus\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Genus\"], \"__\")[[1]][2]"
    #echo "tax_table(ps.ng.tax_most_)[${id},\"Species\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Species\"], \"__\")[[1]][2]"
    #done
    
    tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[1,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[2,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[3,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[4,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[5,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[6,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[7,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[8,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[9,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[10,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[11,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[12,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[13,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[14,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[15,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[16,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[17,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[18,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[19,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[20,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[21,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[22,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[23,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[24,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[25,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[26,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[27,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[28,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[29,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[30,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[31,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[32,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[33,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[34,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[35,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[36,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[37,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[38,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[39,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[40,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[41,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[42,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[43,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[44,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[45,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[46,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[47,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[48,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[49,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[50,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[51,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[52,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[53,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[54,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[55,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[56,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[57,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[58,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[59,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[60,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[61,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[62,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[63,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[64,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[65,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[65,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[66,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[66,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[67,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[67,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[68,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[68,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[69,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[69,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[70,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[70,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[71,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[71,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[72,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[72,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[73,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[73,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[74,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[74,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[75,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[75,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[76,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[76,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[77,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[77,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[78,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[78,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[79,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[79,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[80,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[80,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[81,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[81,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[82,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[82,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[83,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[83,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[84,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[84,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[85,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[85,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[86,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[86,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[87,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[87,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[88,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[88,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[89,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[89,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[90,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[90,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[91,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[91,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[92,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[92,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[93,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[93,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[94,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[94,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[95,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[95,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[96,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[96,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[97,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[97,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[98,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[98,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[99,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[99,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[100,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[100,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[101,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[101,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[102,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[102,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[103,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[103,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[104,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[104,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[105,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[105,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[106,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[106,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[107,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[107,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[108,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[108,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[109,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[109,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[110,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[110,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[111,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[111,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[112,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[112,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[113,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[113,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[114,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[114,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[115,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[115,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[116,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[116,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[117,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[117,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[118,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[118,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[119,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[119,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[120,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[120,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[121,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[121,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[122,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[122,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[123,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[123,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[124,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[124,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[125,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[125,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[126,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[126,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[127,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[127,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[128,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[128,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[129,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[129,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[130,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[130,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[131,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[131,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[132,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[132,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[133,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[133,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[134,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[134,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[135,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[135,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[136,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[136,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[137,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[137,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[138,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[138,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[139,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[139,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[140,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[140,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[141,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[141,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[142,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[142,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[143,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[143,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[144,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[144,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[145,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[145,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[146,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[146,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[147,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[147,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[148,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[148,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[149,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[149,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[150,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[150,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[151,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[151,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[152,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[152,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[153,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[153,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[154,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[154,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[155,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[155,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[156,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[156,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[157,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[157,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[158,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[158,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[159,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[159,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[160,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[160,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[161,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[161,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[162,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[162,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[163,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[163,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[164,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[164,"Species"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[165,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[165,"Species"], "__")[[1]][2]
    
    tax_table(ps.ng.tax_most_)[166,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[166,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[166,"Species"], "__")[[1]][2]
    
    tax_table(ps.ng.tax_most_)[167,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Domain"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Phylum"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Class"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Order"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Family"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Genus"], "__")[[1]][2]
    tax_table(ps.ng.tax_most_)[167,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Species"], "__")[[1]][2]
    ```
    
    ```{r, echo=TRUE, warning=FALSE}
      #aes(color="Phylum", fill="Phylum") --> aes()
      #ggplot(data=data, aes(x=Sample, y=Abundance, fill=Phylum))
      plot_bar(ps.ng.tax_most_, fill="Phylum") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=2))                                  #6 instead of theme.size
    ```
    ```{r, echo=FALSE, warning=FALSE}
      #png("abc.png")
      #knitr::include_graphics("./Phyloseq_files/figure-html/unnamed-chunk-7-1.png")
      #dev.off()
    ```
    
    \pagebreak
    
    Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth.
    
    ```{r, echo=TRUE, warning=FALSE}
      ps.ng.tax_most_pre_post_stroke <- merge_samples(ps.ng.tax_most_, "pre_post_stroke")
      ps.ng.tax_most_pre_post_stroke_ = transform_sample_counts(ps.ng.tax_most_pre_post_stroke, function(x) x / sum(x))
      #plot_bar(ps.ng.tax_most_SampleType_, fill = "Phylum") + geom_bar(aes(color=Phylum, fill=Phylum), stat="identity", position="stack")
      plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Phylum") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = theme.size, colour="black"))
    ```
    
    \pagebreak
    
    Use color according to phylum. Do separate panels Stroke and Sex_age.
    ```{r, echo=TRUE, warning=FALSE}
      ps.ng.tax_most_copied <- data.table::copy(ps.ng.tax_most_)
      #FITTING6: regulate the bar height if it has replicates: 5+6+6+8+4+8+6+7=25+25=50
      otu_table(ps.ng.tax_most_)[,c("1")] <- otu_table(ps.ng.tax_most_)[,c("1")]/5
      otu_table(ps.ng.tax_most_)[,c("2")] <- otu_table(ps.ng.tax_most_)[,c("2")]/5
      otu_table(ps.ng.tax_most_)[,c("5")] <- otu_table(ps.ng.tax_most_)[,c("5")]/5
      otu_table(ps.ng.tax_most_)[,c("6")] <- otu_table(ps.ng.tax_most_)[,c("6")]/5
      otu_table(ps.ng.tax_most_)[,c("7")] <- otu_table(ps.ng.tax_most_)[,c("7")]/5
    
      otu_table(ps.ng.tax_most_)[,c("8")] <- otu_table(ps.ng.tax_most_)[,c("8")]/6
      otu_table(ps.ng.tax_most_)[,c("9")] <- otu_table(ps.ng.tax_most_)[,c("9")]/6
      otu_table(ps.ng.tax_most_)[,c("10")] <- otu_table(ps.ng.tax_most_)[,c("10")]/6
      otu_table(ps.ng.tax_most_)[,c("12")] <- otu_table(ps.ng.tax_most_)[,c("12")]/6
      otu_table(ps.ng.tax_most_)[,c("13")] <- otu_table(ps.ng.tax_most_)[,c("13")]/6
      otu_table(ps.ng.tax_most_)[,c("14")] <- otu_table(ps.ng.tax_most_)[,c("14")]/6
    
      otu_table(ps.ng.tax_most_)[,c("15")] <- otu_table(ps.ng.tax_most_)[,c("15")]/6
      otu_table(ps.ng.tax_most_)[,c("16")] <- otu_table(ps.ng.tax_most_)[,c("16")]/6
      otu_table(ps.ng.tax_most_)[,c("17")] <- otu_table(ps.ng.tax_most_)[,c("17")]/6
      otu_table(ps.ng.tax_most_)[,c("18")] <- otu_table(ps.ng.tax_most_)[,c("18")]/6
      otu_table(ps.ng.tax_most_)[,c("19")] <- otu_table(ps.ng.tax_most_)[,c("19")]/6
      otu_table(ps.ng.tax_most_)[,c("20")] <- otu_table(ps.ng.tax_most_)[,c("20")]/6
    
      otu_table(ps.ng.tax_most_)[,c("21")] <- otu_table(ps.ng.tax_most_)[,c("21")]/8
      otu_table(ps.ng.tax_most_)[,c("22")] <- otu_table(ps.ng.tax_most_)[,c("22")]/8
      otu_table(ps.ng.tax_most_)[,c("23")] <- otu_table(ps.ng.tax_most_)[,c("23")]/8
      otu_table(ps.ng.tax_most_)[,c("24")] <- otu_table(ps.ng.tax_most_)[,c("24")]/8
      otu_table(ps.ng.tax_most_)[,c("25")] <- otu_table(ps.ng.tax_most_)[,c("25")]/8
      otu_table(ps.ng.tax_most_)[,c("26")] <- otu_table(ps.ng.tax_most_)[,c("26")]/8
      otu_table(ps.ng.tax_most_)[,c("27")] <- otu_table(ps.ng.tax_most_)[,c("27")]/8
      otu_table(ps.ng.tax_most_)[,c("28")] <- otu_table(ps.ng.tax_most_)[,c("28")]/8
    
      otu_table(ps.ng.tax_most_)[,c("29")] <- otu_table(ps.ng.tax_most_)[,c("29")]/4
      otu_table(ps.ng.tax_most_)[,c("30")] <- otu_table(ps.ng.tax_most_)[,c("30")]/4
      otu_table(ps.ng.tax_most_)[,c("31")] <- otu_table(ps.ng.tax_most_)[,c("31")]/4
      otu_table(ps.ng.tax_most_)[,c("32")] <- otu_table(ps.ng.tax_most_)[,c("32")]/4
    
      otu_table(ps.ng.tax_most_)[,c("33")] <- otu_table(ps.ng.tax_most_)[,c("33")]/8
      otu_table(ps.ng.tax_most_)[,c("34")] <- otu_table(ps.ng.tax_most_)[,c("34")]/8
      otu_table(ps.ng.tax_most_)[,c("35")] <- otu_table(ps.ng.tax_most_)[,c("35")]/8
      otu_table(ps.ng.tax_most_)[,c("36")] <- otu_table(ps.ng.tax_most_)[,c("36")]/8
      otu_table(ps.ng.tax_most_)[,c("37")] <- otu_table(ps.ng.tax_most_)[,c("37")]/8
      otu_table(ps.ng.tax_most_)[,c("38")] <- otu_table(ps.ng.tax_most_)[,c("38")]/8
      otu_table(ps.ng.tax_most_)[,c("39")] <- otu_table(ps.ng.tax_most_)[,c("39")]/8
      otu_table(ps.ng.tax_most_)[,c("51")] <- otu_table(ps.ng.tax_most_)[,c("51")]/8
    
      otu_table(ps.ng.tax_most_)[,c("40")] <- otu_table(ps.ng.tax_most_)[,c("40")]/6
      otu_table(ps.ng.tax_most_)[,c("41")] <- otu_table(ps.ng.tax_most_)[,c("41")]/6
      otu_table(ps.ng.tax_most_)[,c("42")] <- otu_table(ps.ng.tax_most_)[,c("42")]/6
      otu_table(ps.ng.tax_most_)[,c("43")] <- otu_table(ps.ng.tax_most_)[,c("43")]/6
      otu_table(ps.ng.tax_most_)[,c("44")] <- otu_table(ps.ng.tax_most_)[,c("44")]/6
      otu_table(ps.ng.tax_most_)[,c("46")] <- otu_table(ps.ng.tax_most_)[,c("46")]/6
    
      otu_table(ps.ng.tax_most_)[,c("47")] <- otu_table(ps.ng.tax_most_)[,c("47")]/7
      otu_table(ps.ng.tax_most_)[,c("48")] <- otu_table(ps.ng.tax_most_)[,c("48")]/7
      otu_table(ps.ng.tax_most_)[,c("49")] <- otu_table(ps.ng.tax_most_)[,c("49")]/7
      otu_table(ps.ng.tax_most_)[,c("50")] <- otu_table(ps.ng.tax_most_)[,c("50")]/7
      otu_table(ps.ng.tax_most_)[,c("52")] <- otu_table(ps.ng.tax_most_)[,c("52")]/7
      otu_table(ps.ng.tax_most_)[,c("53")] <- otu_table(ps.ng.tax_most_)[,c("53")]/7
      otu_table(ps.ng.tax_most_)[,c("55")] <- otu_table(ps.ng.tax_most_)[,c("55")]/7
    
      #plot_bar(ps.ng.tax_most_swab_, x="Phylum", fill = "Phylum", facet_grid = Patient~RoundDay) + geom_bar(aes(color=Phylum, fill=Phylum), stat="identity", position="stack") + theme(axis.text = element_text(size = theme.size, colour="black"))
      plot_bar(ps.ng.tax_most_, x="Phylum", fill="Phylum", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=2))
    ```
    ```{r, echo=FALSE, warning=FALSE}
      #knitr::include_graphics("./Phyloseq_files/figure-html/unnamed-chunk-10-1.png")
      #> tax_table(carbom)
      #Taxonomy Table:     [205 taxa by 7 taxonomic ranks]:
      #     Domain      Supergroup       Division      Class
      #Otu001 "Eukaryota" "Archaeplastida" "Chlorophyta" "Mamiellophyceae"
      #       Order                      Family                 Genus
      #Otu001 "Mamiellales"              "Bathycoccaceae"       "Ostreococcus"
      #sample_data(ps.ng.tax)
    ```
    
    ## Bar plots in class level
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_copied, fill="Class") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=3))
    ```
    
    Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth.
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Class") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = theme.size, colour="black"))
    ```
    \pagebreak
    
    Use color according to class. Do separate panels Stroke and Sex_age.
    ```{r, echo=TRUE, warning=FALSE}
      #-- If existing replicates, to be processed as follows --
      plot_bar(ps.ng.tax_most_, x="Class", fill="Class", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=3))
    ```
    
    ## Bar plots in order level
    
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_copied, fill="Order") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=4))
    ```
    
    Regroup together pre vs post stroke and normalize number of reads in each group using median sequencing depth.
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Order") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = theme.size, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=4))
    ```
    \pagebreak
    
    Use color according to order. Do separate panels Stroke and Sex_age.
    ```{r, echo=TRUE, warning=FALSE}
      #FITTING7: regulate the bar height if it has replicates
      plot_bar(ps.ng.tax_most_, x="Order", fill="Order", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=4))
    ```
    
    ## Bar plots in family level
    
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_copied, fill="Family") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=8))
    ```
    
    Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth.
    ```{r, echo=TRUE, warning=FALSE}
      plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Family") + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = theme.size, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=8))
    ```
    \pagebreak
    
    Use color according to family. Do separate panels Stroke and Sex_age.
    ```{r, echo=TRUE, warning=FALSE}
      #-- If existing replicates, to be processed as follows --
      plot_bar(ps.ng.tax_most_, x="Family", fill="Family", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") +
      scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = 5, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=8))
    ```
    
    ```{r, echo=FALSE, warning=FALSE}
      #MOVE_FROM_ABOVE: ## Bar plots in genus level
      #MOVE_FROM_ABOVE: Regroup together pre vs post stroke samples and normalize number of reads in each group using median sequencing depth.
      #plot_bar(ps.ng.tax_most_pre_post_stroke_, fill="Genus") + geom_bar(aes(), stat="identity", position="stack") +
      #scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = theme.size, colour="black")) + theme(legend.position="bottom")
    ```
    \pagebreak
    
    ```{r, echo=FALSE, warning=FALSE}
      #MOVE_FROM_ABOVE: Use color according to genus. Do separate panels Stroke and Sex_age.
      ##-- If existing replicates, to be processed as follows --
      #plot_bar(ps.ng.tax_most_, x="Genus", fill="Genus", facet_grid = pre_post_stroke~Sex_age) + geom_bar(aes(), stat="identity", position="stack") +
      #scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = 6, colour="black"), axis.text.x=element_blank(), axis.ticks=element_blank()) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=18))
    ```
    
    \pagebreak
    
    # Alpha diversity
    Plot Chao1 richness estimator, Observed OTUs, Shannon index, and Phylogenetic diversity.
    Regroup together samples from the same group.
    ```{r, echo=FALSE, warning=FALSE}
    # using rarefied data
    #FITTING2: CONSOLE:
    #gunzip table_even4753.biom.gz
    #alpha_diversity.py -i table_even42369.biom --metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering/rep_set.tre
    #gunzip table_even4753.biom.gz
    #alpha_diversity.py -i table_even4753.biom --metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering_stool/rep_set.tre
    #gunzip table_even4753.biom.gz
    #alpha_diversity.py -i table_even4753.biom --metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering_swab/rep_set.tre
    ```
    
    ```{r, echo=TRUE, warning=FALSE}
    hmp.div_qiime <- read.csv("adiv_even.txt", sep="\t")
    colnames(hmp.div_qiime) <- c("sam_name", "chao1", "observed_otus", "shannon", "PD_whole_tree")
    row.names(hmp.div_qiime) <- hmp.div_qiime$sam_name
    div.df <- merge(hmp.div_qiime, hmp.meta, by = "sam_name")
    div.df2 <- div.df[, c("Group", "chao1", "shannon", "observed_otus", "PD_whole_tree")]
    colnames(div.df2) <- c("Group", "Chao-1", "Shannon", "OTU", "Phylogenetic Diversity")
    #colnames(div.df2)
    options(max.print=999999)
    #27     H47 830.5000 5.008482 319               10.60177
    #FITTING4: if occuring "Computation failed in `stat_signif()`:not enough 'y' observations"
    #means: the patient H47 contains only one sample, it should be removed for the statistical p-values calculations.
    #delete H47(1)
    #div.df2 <- div.df2[-c(3), ]
    #div.df2 <- div.df2[-c(55,54, 45,40,39,27,26,25,1), ]
    knitr::kable(div.df2) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    
    #https://uc-r.github.io/t_test
    #We can perform the test with t.test and transform our data and we can also perform the nonparametric test with the wilcox.test function.
    stat.test.Shannon <- compare_means(
    Shannon ~ Group, data = div.df2,
    method = "t.test"
    )
    knitr::kable(stat.test.Shannon) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    
    div_df_melt <- reshape2::melt(div.df2)
    #head(div_df_melt)
    
    #https://plot.ly/r/box-plots/#horizontal-boxplot
    #http://www.sthda.com/english/wiki/print.php?id=177
    #https://rpkgs.datanovia.com/ggpubr/reference/as_ggplot.html
    #http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/82-ggplot2-easy-way-to-change-graphical-parameters/
    #https://plot.ly/r/box-plots/#horizontal-boxplot
    #library("gridExtra")
    #par(mfrow=c(4,1))
    p <- ggboxplot(div_df_melt, x = "Group", y = "value",
                  facet.by = "variable",
                  scales = "free",
                  width = 0.5,
                  fill = "gray", legend= "right")
    #ggpar(p, xlab = FALSE, ylab = FALSE)
    lev <- levels(factor(div_df_melt$Group)) # get the variables
    #FITTING4: delete H47(1) in lev
    #lev <- lev[-c(3)]
    # make a pairwise list that we want to compare.
    #my_stat_compare_means
    #https://stackoverflow.com/questions/47839988/indicating-significance-with-ggplot2-in-a-boxplot-with-multiple-groups
    L.pairs <- combn(seq_along(lev), 2, simplify = FALSE, FUN = function(i) lev[i]) #%>% filter(p.signif != "ns")
    my_stat_compare_means  <- function (mapping = NULL, data = NULL, method = NULL, paired = FALSE,
        method.args = list(), ref.group = NULL, comparisons = NULL,
        hide.ns = FALSE, label.sep = ", ", label = NULL, label.x.npc = "left",
        label.y.npc = "top", label.x = NULL, label.y = NULL, tip.length = 0.03,
        symnum.args = list(), geom = "text", position = "identity",
        na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
    {
        if (!is.null(comparisons)) {
            method.info <- ggpubr:::.method_info(method)
            method <- method.info$method
            method.args <- ggpubr:::.add_item(method.args, paired = paired)
            if (method == "wilcox.test")
                method.args$exact <- FALSE
            pms <- list(...)
            size <- ifelse(is.null(pms$size), 0.3, pms$size)
            color <- ifelse(is.null(pms$color), "black", pms$color)
            map_signif_level <- FALSE
            if (is.null(label))
                label <- "p.format"
            if (ggpubr:::.is_p.signif_in_mapping(mapping) | (label %in% "p.signif")) {
                if (ggpubr:::.is_empty(symnum.args)) {
                    map_signif_level <- c(`****` = 1e-04, `***` = 0.001,
                      `**` = 0.01, `*` = 0.05, ns = 1)
                } else {
                  map_signif_level <- symnum.args
                }
                if (hide.ns)
                    names(map_signif_level)[5] <- " "
            }
            step_increase <- ifelse(is.null(label.y), 0.12, 0)
            ggsignif::geom_signif(comparisons = comparisons, y_position = label.y,
                test = method, test.args = method.args, step_increase = step_increase,
                size = size, color = color, map_signif_level = map_signif_level,
                tip_length = tip.length, data = data)
        } else {
            mapping <- ggpubr:::.update_mapping(mapping, label)
            layer(stat = StatCompareMeans, data = data, mapping = mapping,
                geom = geom, position = position, show.legend = show.legend,
                inherit.aes = inherit.aes, params = list(label.x.npc = label.x.npc,
                    label.y.npc = label.y.npc, label.x = label.x,
                    label.y = label.y, label.sep = label.sep, method = method,
                    method.args = method.args, paired = paired, ref.group = ref.group,
                    symnum.args = symnum.args, hide.ns = hide.ns,
                    na.rm = na.rm, ...))
        }
    }
    
    p2 <- p +
    stat_compare_means(
      method="t.test",
      comparisons = list(c("Group1", "Group2"), c("Group1", "Group3"), c("Group1", "Group4"), c("Group1", "Group6"), c("Group1", "Group8"), c("Group2", "Group5"),c("Group4", "Group5"),c("Group4", "Group6"),c("Group4", "Group7"),c("Group6", "Group7")),
      label = "p.signif",
      symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns"))
    )
    #comparisons = L.pairs,
    #symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05), symbols = c("****", "***", "**", "*")),
    #stat_pvalue_manual
    #print(p2)
    #https://stackoverflow.com/questions/20500706/saving-multiple-ggplots-from-ls-into-one-and-separate-files-in-r
    #FITTING3: mkdir figures
    ggsave("./figures/alpha_diversity_Group.png", device="png", height = 10, width = 12)
    ggsave("./figures/alpha_diversity_Group.svg", device="svg", height = 10, width = 12)
    
    p3 <- p +
    stat_compare_means(
      method="t.test",
      comparisons = list(c("Group2", "Group4"), c("Group2", "Group6"), c("Group4", "Group8"), c("Group6", "Group8")),
      label = "p.signif",
      symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns")),
    )
    #symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05), symbols = c("****", "***", "**", "*")),
    #stat_pvalue_manual
    #print(p2)
    #https://stackoverflow.com/questions/20500706/saving-multiple-ggplots-from-ls-into-one-and-separate-files-in-r
    #FITTING3: mkdir figures
    ggsave("./figures/alpha_diversity_Group2.png", device="png", height = 10, width = 12)
    ggsave("./figures/alpha_diversity_Group2.svg", device="svg", height = 10, width = 12)
    ```
    
    # Selected alpha diversity
    ```{r, echo=TRUE, warning=FALSE, fig.cap="Alpha diversity", out.width = '100%', fig.align= "center"}
    knitr::include_graphics("./figures/alpha_diversity_Group2.png")
    
    selected_alpha_diversities<-read.csv("selected_alpha_diversities.txt",sep="\t")
    knitr::kable(selected_alpha_diversities) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    ```
    
    # Beta diversity
    ```{r, echo=TRUE, warning=FALSE, fig.cap="Beta diversity", out.width = '100%', fig.align= "center"}
    #file:///home/jhuang/DATA/Data_Marius_16S/core_diversity_e42369/bdiv_even42369_Group/unweighted_unifrac_boxplots/Group_Stats.txt
    beta_diversity_group_stats<-read.csv("unweighted_unifrac_boxplots_Group_Stats.txt",sep="\t")
    knitr::kable(beta_diversity_group_stats) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    #NOTE: Run this Phyloseq0.Rmd, then run the code of MicrobiotaProcess.R to manually generate PCoA.png, then run this Phyloseq.Rmd!
    #NOTE: AT_FIRST_DEACTIVATE_THIS_LINE: knitr::include_graphics("./figures/PCoA.png")
    ```
    
    # Differential abundance analysis
    
    Differential abundance analysis aims to find the differences in the abundance of each taxa between two groups of samples, assigning a significance value to each comparison.
    
    ## Group2 vs Group4
    
    ```{r, echo=TRUE, warning=FALSE}
    library("DESeq2")
    #ALTERNATIVE using ps.ng.tax_most_copied: ps.ng.tax (40594) vs. ps.ng.tax_most_copied (166)
    ps.ng.tax_sel <- ps.ng.tax
    #FITTING5: correct the id of the group members, see FITTING6
    otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("8","9","10","12","13","14",  "21","22","23","24","25","26","27","28")]
    diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group)
    diagdds$Group <- relevel(diagdds$Group, "Group4")
    diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
    resultsNames(diagdds)
    
    res = results(diagdds, cooksCutoff = FALSE)
    alpha = 0.05
    sigtab = res[which(res$padj < alpha), ]
    sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
    sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
    kable(sigtab) %>%
      kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    #rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied))
    #subv %in% v
    ### returns a vector TRUE FALSE
    #is.element(subv, v)
    ### returns a vector TRUE FALSE
    
    library("ggplot2")
    theme_set(theme_bw())
    scale_fill_discrete <- function(palname = "Set1", ...) {
        scale_fill_brewer(palette = palname, ...)
    }
    x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
    x = sort(x)
    sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
    x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
    x = sort(x)
    sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
    ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
      theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
    
    #Error in checkForExperimentalReplicates(object, modelMatrix) :
    #  The design matrix has the same number of samples and coefficients to fit,
    #  so estimation of dispersion is not possible. Treating samples
    #  as replicates was deprecated in v1.20 and no longer supported since v1.22.
    ```
    
    ## Group2 vs Group6
    
    ```{r, echo=TRUE, warning=FALSE}
    ps.ng.tax_sel <- ps.ng.tax
    otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("8","9","10","12","13","14",    "33","34","35","36","37","38","39","51")]
    diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group)
    diagdds$Group <- relevel(diagdds$Group, "Group6")
    diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
    resultsNames(diagdds)
    
    res = results(diagdds, cooksCutoff = FALSE)
    alpha = 0.05
    sigtab = res[which(res$padj < alpha), ]
    sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
    sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
    kable(sigtab) %>%
      kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    
    library("ggplot2")
    theme_set(theme_bw())
    scale_fill_discrete <- function(palname = "Set1", ...) {
        scale_fill_brewer(palette = palname, ...)
    }
    x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
    x = sort(x)
    sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
    x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
    x = sort(x)
    sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
    ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
      theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
    ```
    
    ## Group4 vs Group8
    
    ```{r, echo=TRUE, warning=FALSE}
    ps.ng.tax_sel <- ps.ng.tax
    otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("21","22","23","24","25","26","27","28",    "47","48","49","50","52","53","55")]
    diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group)
    diagdds$Group <- relevel(diagdds$Group, "Group8")
    diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
    resultsNames(diagdds)
    
    res = results(diagdds, cooksCutoff = FALSE)
    alpha = 0.05
    sigtab = res[which(res$padj < alpha), ]
    sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
    sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
    kable(sigtab) %>%
      kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    
    library("ggplot2")
    theme_set(theme_bw())
    scale_fill_discrete <- function(palname = "Set1", ...) {
        scale_fill_brewer(palette = palname, ...)
    }
    x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
    x = sort(x)
    sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
    x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
    x = sort(x)
    sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
    ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
      theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
    ```
    
    ## Group6 vs Group8
    
    ```{r, echo=TRUE, warning=FALSE}
    ps.ng.tax_sel <- ps.ng.tax
    otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("33","34","35","36","37","38","39","51",    "47","48","49","50","52","53","55")]
    diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~Group)
    diagdds$Group <- relevel(diagdds$Group, "Group8")
    diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
    resultsNames(diagdds)
    
    res = results(diagdds, cooksCutoff = FALSE)
    alpha = 0.05
    sigtab = res[which(res$padj < alpha), ]
    sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
    sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
    kable(sigtab) %>%
      kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
    
    library("ggplot2")
    theme_set(theme_bw())
    scale_fill_discrete <- function(palname = "Set1", ...) {
        scale_fill_brewer(palette = palname, ...)
    }
    x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
    x = sort(x)
    sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
    x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
    x = sort(x)
    sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
    ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
      theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
    ```

QIIME + Phyloseq + MicrobiotaProcess (v1)

diff_analysis_Group2_vs_Group6

# https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html

# -----------------------------------
# ---- prepare the R environment ----
#Rscript MicrobiotaProcess.R
#NOTE: exit R script, then login again R-environment; rm -rf Phyloseq*_cache
#mkdir figures
rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html')

# with #alpha = 2.0, running the following script further!

# -----------------------------
# ---- 3.1. bridges other tools
##https://github.com/YuLab-SMU/MicrobiotaProcess
##https://www.bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc/MicrobiotaProcess.html
##https://chiliubio.github.io/microeco_tutorial/intro.html#framework
##https://yiluheihei.github.io/microbiomeMarker/reference/plot_cladogram.html
#BiocManager::install("MicrobiotaProcess")
#install.packages("microeco")
#install.packages("ggalluvial")
#install.packages("ggh4x")

library(MicrobiotaProcess)
library(microeco)
library(ggalluvial)
library(ggh4x)
library(gghalves)

## Convert the phyloseq object to a MicrobiotaProcess object
#mp <- as.MicrobiotaProcess(ps.ng.tax)

#mt <- phyloseq2microeco(ps.ng.tax) #--> ERROR
#abundance_table <- mt$abun_table
#taxonomy_table <- mt$tax_table

#ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE)
#ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE)

##OPTION1 (NOT_USED): take all samples, prepare ps.ng.tax_abund --> mpse_abund
##mpse <- ps.ng.tax %>% as.MPSE()
#mpse_abund <- ps.ng.tax_abund %>% as.MPSE()

##OPTION2 (USED!): take partial samples, prepare ps.ng.tax or ps.ng.tax_abund (2 replacements!)--> ps.ng.tax_sel --> mpse_abund
ps.ng.tax_sel <- ps.ng.tax_abund

##otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("1","2","5","6","7",  "15","16","17","18","19","20",  "29","30","31","32",  "40","41","42","43","44","46")]
##NOTE: Only choose Group2, Group4, Group6, Group8
#> ps.ng.tax_sel
#otu_table()   OTU Table:         [ 37465 taxa and 29 samples ]
#sample_data() Sample Data:       [ 29 samples by 10 sample variables ]
#tax_table()   Taxonomy Table:    [ 37465 taxa by 7 taxonomic ranks ]
#phy_tree()    Phylogenetic Tree: [ 37465 tips and 37461 internal nodes ]
#-Group4: "21","22","23","24","25","26","27","28",
#-Group8: ,  "47","48","49","50","52","53","55"
otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax_abund)[,c("8","9","10","12","13","14",  "33","34","35","36","37","38","39","51")]
mpse_abund <- ps.ng.tax_sel %>% as.MPSE()
# A MPSE-tibble (MPSE object) abstraction: 2,352 × 20
# NOTE mpse_abund contains 20 variables: OTU, Sample, Abundance, BarcodeSequence, LinkerPrimerSequence, FileInput, Group,
#   Sex_age 
, pre_post_stroke , Conc , Vol_50ng , Vol_PCR , Description , # Domain , Phylum , Class , Order , Family , Genus , Species # ———————————– # —- 3.2. alpha diversity analysis # Rarefied species richness + RareAbundance mpse_abund %<>% mp_rrarefy() # ‘chunks’ represent the split number of each sample to calculate alpha # diversity, default is 400. e.g. If a sample has total 40000 # reads, if chunks is 400, it will be split to 100 sub-samples # (100, 200, 300,…, 40000), then alpha diversity index was # calculated based on the sub-samples. # ‘.abundance’ the column name of abundance, if the ‘.abundance’ is not be # rarefied calculate rarecurve, user can specific ‘force=TRUE’. mpse_abund %<>% mp_cal_rarecurve( .abundance = RareAbundance, chunks = 400 ) # The RareAbundanceRarecurve column will be added the colData slot # automatically (default action=”add”) #NOTE mpse_abund contains 22 varibles = 20 varibles + RareAbundance + RareAbundanceRarecurve # default will display the confidence interval around smooth. # se=TRUE # NOTE that two colors #c(“#00A087FF”, “#3C5488FF”) for .group = pre_post_stroke; four colors c(“#1f78b4”, “#33a02c”, “#e31a1c”, “#6a3d9a”) for .group = Group; p1 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, ) p2 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = Observe, .group = Group ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) # combine the samples belong to the same groups if plot.group=TRUE p3 <- mpse_abund %>% mp_plot_rarecurve( .rare = RareAbundanceRarecurve, .alpha = “Observe”, .group = Group, plot.group = TRUE ) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”)) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”),guide=”none”) png(“rarefaction_of_samples_or_groups.png”, width=1080, height=600) p1 + p2 + p3 dev.off() # —————————————— # 3.3. calculate alpha index and visualization library(ggplot2) library(MicrobiotaProcess) mpse_abund %<>% mp_cal_alpha(.abundance=RareAbundance) mpse_abund #NOTE mpse_abund contains 28 varibles = 22 varibles + Observe , Chao1 , ACE , Shannon , Simpson , Pielou f1 <- mpse_abund %>% mp_plot_alpha( .group=Group, .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) + scale_fill_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) + scale_color_manual(values=c(“#1f78b4”, “#e31a1c”), guide=”none”) f2 <- mpse_abund %>% mp_plot_alpha( .alpha=c(Observe, Chao1, ACE, Shannon, Simpson, Pielou) ) #ps.ng.tax_sel contais only pre samples –> f1 cannot be generated! png(“alpha_diversity_comparison.png”, width=1400, height=600) f1 / f2 dev.off() # ——————————————- # 3.4. The visualization of taxonomy abundance (Class) mpse_abund %<>% mp_cal_abundance( # for each samples .abundance = RareAbundance ) %>% mp_cal_abundance( # for each groups .abundance=RareAbundance, .group=Group ) mpse_abund #NOTE mpse_abund contains 29 varibles = 28 varibles + RelRareAbundanceBySample # visualize the relative abundance of top 20 phyla for each sample. # .group=time, p1 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = TRUE ) # visualize the abundance (rarefied) of top 20 phyla for each sample. # .group=time, p2 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, taxa.class = Class, topn = 20, relative = FALSE ) png(“relative_abundance_and_abundance.png”, width= 1200, height=600) #NOT PRODUCED! p1 / p2 dev.off() #—- h1 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = TRUE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) h2 <- mpse_abund %>% mp_plot_abundance( .abundance = RareAbundance, .group = Group, taxa.class = Class, relative = FALSE, topn = 20, geom = ‘heatmap’, features.dist = ‘euclidean’, features.hclust = ‘average’, sample.dist = ‘bray’, sample.hclust = ‘average’ ) # the character (scale or theme) of figure can be adjusted by set_scale_theme # refer to the mp_plot_dist png(“relative_abundance_and_abundance_heatmap.png”, width= 1200, height=600) aplot::plot_list(gglist=list(h1, h2), tag_levels=”A”) dev.off() # visualize the relative abundance of top 20 class for each .group (Group) p3 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group=Group, taxa.class = Class, topn = 20, plot.group = TRUE ) # visualize the abundance of top 20 phyla for each .group (time) p4 <- mpse_abund %>% mp_plot_abundance( .abundance=RareAbundance, .group= Group, taxa.class = Class, topn = 20, relative = FALSE, plot.group = TRUE ) png(“relative_abundance_and_abundance_groups.png”, width= 1000, height=1000) p3 / p4 dev.off() # ————————— # 3.5. Beta diversity analysis # ——————————————— # 3.5.1 The distance between samples or groups # standardization # mp_decostand wraps the decostand of vegan, which provides # many standardization methods for community ecology. # default is hellinger, then the abundance processed will # be stored to the assays slot. mpse_abund %<>% mp_decostand(.abundance=Abundance) mpse_abund #NOTE mpse_abund contains 30 varibles = 29 varibles + hellinger # calculate the distance between the samples. # the distance will be generated a nested tibble and added to the # colData slot. mpse_abund %<>% mp_cal_dist(.abundance=hellinger, distmethod=”bray”) mpse_abund #NOTE mpse_abund contains 31 varibles = 30 varibles + bray # mp_plot_dist provides there methods to visualize the distance between the samples or groups # when .group is not provided, the dot heatmap plot will be return p1 <- mpse_abund %>% mp_plot_dist(.distmethod = bray) png(“distance_between_samples.png”, width= 1000, height=1000) p1 dev.off() # when .group is provided, the dot heatmap plot with group information will be return. p2 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group) # The scale or theme of dot heatmap plot can be adjusted using set_scale_theme function. p2 %>% set_scale_theme( x = scale_fill_manual( values=c(“#1f78b4”, “#e31a1c”), #c(“orange”, “deepskyblue”), guide = guide_legend( keywidth = 1, keyheight = 0.5, title.theme = element_text(size=8), label.theme = element_text(size=6) ) ), aes_var = Group # specific the name of variable ) %>% set_scale_theme( x = scale_color_gradient( guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) %>% set_scale_theme( x = scale_size_continuous( range = c(0.1, 3), guide = guide_legend(keywidth = 0.5, keyheight = 0.5) ), aes_var = bray ) png(“distance_between_samples_with_group_info.png”, width= 1000, height=1000) p2 dev.off() # when .group is provided and group.test is TRUE, the comparison of different groups will be returned # Assuming p3 is a ggplot object after mp_plot_dist call p3 <- mpse_abund %>% mp_plot_dist(.distmethod = bray, .group = Group, group.test = TRUE, textsize = 6) + theme( axis.title.x = element_text(size = 14), # Customize x-axis label face = “bold” axis.title.y = element_text(size = 14), # Customize y-axis label axis.text.x = element_text(size = 14), # Customize x-axis ticks axis.text.y = element_text(size = 14) # Customize y-axis ticks ) # Save the plot with the new theme settings png(“Comparison_of_Bray_Distances.png”, width = 1000, height = 1000) print(p3) # Ensure that p3 is explicitly printed in the device dev.off() # Extract Bray-Curtis Distance Values and save them in a Excel-table. library(dplyr) library(tidyr) library(openxlsx) # Define the sample numbers vector sample_numbers <- c("8", "9", "10", "12", "13", "14", "33", "34", "35", "36", "37", "38", "39", "51") # Consolidate the list of tibbles using the actual sample numbers bray_data <- bind_rows( lapply(seq_along(mpse_abund$bray), function(i) { tibble( Sample1 = sample_numbers[i], # Use actual sample number Sample2 = mpse_abund$bray[[i]]$braySampley, BrayDistance = mpse_abund$bray[[i]]$bray ) }), .id = "PairID" ) # Print the data frame to check the output print(bray_data) # Write the data frame to an Excel file write.xlsx(bray_data, file = "Bray_Curtis_Distances.xlsx") #DELETE the column "PairID" in Excel file # ----------------------- # 3.5.2 The PCoA analysis #install.packages("corrr") library(corrr) #install.packages("ggside") library(ggside) mpse_abund %<>% mp_cal_pcoa(.abundance=hellinger, distmethod=”bray”) # The dimensions of ordination analysis will be added the colData slot (default). mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles = 31 varibles + `PCo1 (30.16%)` , `PCo2 (15.75%)` , `PCo3 (10.53%)` #BUG why 36 variables in mpse_abund %>% print(width=380, n=1) [RareAbundanceBySample , RareAbundanceByGroup ] #> methods(class=class(mpse_abund)) # [1] [ [[<- [<- # [4] $ $<- arrange # [7] as_tibble as.data.frame as.phyloseq #[10] coerce coerce<- colData<- #[13] distinct filter group_by #[16] left_join mp_adonis mp_aggregate_clade #[19] mp_aggregate mp_anosim mp_balance_clade #[22] mp_cal_abundance mp_cal_alpha mp_cal_cca #[25] mp_cal_clust mp_cal_dca mp_cal_dist #[28] mp_cal_nmds mp_cal_pca mp_cal_pcoa #[31] mp_cal_pd_metric mp_cal_rarecurve mp_cal_rda #[34] mp_cal_upset mp_cal_venn mp_decostand #[37] mp_diff_analysis mp_diff_clade mp_envfit #[40] mp_extract_abundance mp_extract_assays mp_extract_dist #[43] mp_extract_feature mp_extract_internal_attr mp_extract_rarecurve #[46] mp_extract_refseq mp_extract_sample mp_extract_taxonomy #[49] mp_extract_tree mp_filter_taxa mp_mantel #[52] mp_mrpp mp_plot_abundance mp_plot_alpha #[55] mp_plot_diff_boxplot mp_plot_diff_res mp_plot_dist #[58] mp_plot_ord mp_plot_rarecurve mp_plot_upset #[61] mp_plot_venn mp_rrarefy mp_select_as_tip #[64] mp_stat_taxa mutate otutree #[67] otutree<- print pull #[70] refsequence refsequence<- rename #[73] rownames<- select show # [ reached getOption("max.print") -- omitted 6 entries ] #see '?methods' for accessing help and source code # We also can perform adonis or anosim to check whether it is significant to the dissimilarities of groups. mpse_abund %<>% mp_adonis(.abundance=hellinger, .formula=~Group, distmethod=”bray”, permutations=9999, action=”add”) mpse_abund %>% mp_extract_internal_attr(name=adonis) #NOTE mpse_abund contains 34 varibles, no new variable, it has been saved in mpse_abund and can be extracted with “mpse_abund %>% mp_extract_internal_attr(name=’adonis’)” #The result of adonis has been saved to the internal attribute ! #It can be extracted using this-object %>% mp_extract_internal_attr(name=’adonis’) #The object contained internal attribute: PCoA ADONIS #Permutation test for adonis under reduced model #Terms added sequentially (first to last) #Permutation: free #Number of permutations: 9999 # #vegan::adonis2(formula = .formula, data = sampleda, permutations = permutations, method = distmethod) # Df SumOfSqs R2 F Pr(>F) #Group 1 0.23448 0.22659 3.5158 5e-04 *** #Residual 12 0.80032 0.77341 #Total 13 1.03480 1.00000 #— #Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 # (“1″,”2″,”5″,”6″,”7”, “15”,”16″,”17″,”18″,”19″,”20″, “29”,”30″,”31″,”32″, “40”,”41″,”42″,”43″,”44″,”46″) #div.df2[div.df2 == “Group1”] <- "aged.post" #div.df2[div.df2 == "Group3"] <- "young.post" #div.df2[div.df2 == "Group5"] <- "aged.post" #div.df2[div.df2 == "Group7"] <- "young.post" # ("8","9","10","12","13","14", "21","22","23","24","25","26","27","28", "33","34","35","36","37","38","39","51", "47","48","49","50","52","53","55") #div.df2[div.df2 == "Group2"] <- "aged.pre" #div.df2[div.df2 == "Group4"] <- "young.pre" #div.df2[div.df2 == "Group6"] <- "aged.pre" #div.df2[div.df2 == "Group8"] <- "young.pre" #Group1: f.aged and post #Group2: f.aged and pre #Group3: f.young and post #Group4: f.young and pre #Group5: m.aged and post #Group6: m.aged and pre #Group7: m.young and post #Group8: m.young and pre #[,c("1","2","5","6","7", "8","9","10","12","13","14")] #[,c("15","16","17","18","19","20", "21","22","23","24","25","26","27","28")] #[,c("29","30","31","32", "33","34","35","36","37","38","39","51")] #[,c("40","41","42","43","44","46", "47","48","49","50","52","53","55")] #For the first set: #a6cee3: This is a light blue color, somewhat pastel and soft. #b2df8a: A soft, pale green, similar to a light lime. #fb9a99: A soft pink, slightly peachy or salmon-like. #cab2d6: A pale purple, reminiscent of lavender or a light mauve. #For the second set: #1f78b4: This is a strong, vivid blue, close to cobalt or a medium-dark blue. #33a02c: A medium forest green, vibrant and leafy. #e31a1c: A bright red, very vivid, similar to fire engine red. #6a3d9a: This would be described as a deep purple, akin to a dark lavender or plum. p1 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = 2.4, .alpha = 1, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( #values = c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) + scale_color_manual( #values=c(“#a6cee3”, “#1f78b4”, “#b2df8a”, “#33a02c”, “#fb9a99”, “#e31a1c”, “#cab2d6”, “#6a3d9a”), #values = c(“#a6cee3”, “#b2df8a”, “#fb9a99”, “#cab2d6”), values = c(“#1f78b4”, “#e31a1c”), guide = guide_legend(keywidth=1.6, keyheight=1.6, label.theme=element_text(size=12)) ) #scale_fill_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) + #scale_color_manual(values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”)) #scale_fill_manual(values=c(“#00A087FF”, “#3C5488FF”)) + #scale_color_manual(values=c(“#00A087FF”, “#3C5488FF”)) #png(“PCoA.png”, width= 1000, height=1000) #svg(“PCoA.svg”, width= 11, height=10) #svg(“PCoA_.svg”, width=10, height=10) #svg(“PCoA.svg”) pdf(“PCoA_Group2_vs_Group6.pdf”) p1 dev.off() #FF0000: Red #000000: Black #0000FF: Blue #C0C0C0: Silver #00FF00: Lime (often referred to simply as Green in web colors) #FFFF00: Yellow #00FFFF: Aqua (also known as Cyan) #FFA500: Orange # The size of point also can be mapped to other variables such as Observe, or Shannon # Then the alpha diversity and beta diversity will be displayed simultaneously. p2 <- mpse_abund %>% mp_plot_ord( .ord = pcoa, .group = Group, .color = Group, .size = Shannon, .alpha = Observe, ellipse = TRUE, show.legend = FALSE # don’t display the legend of stat_ellipse ) + scale_fill_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values = c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_color_manual( values = c(“#1f78b4”, “#e31a1c”), #only needs four colors. #values=c(“#FF0000”, “#000000”, “#0000FF”, “#C0C0C0”, “#00FF00”, “#FFFF00”, “#00FFFF”, “#FFA500”), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) + scale_size_continuous( range=c(0.5, 3), guide = guide_legend(keywidth=0.6, keyheight=0.6, label.theme=element_text(size=8)) ) pdf(“PCoA2_Group2_vs_Group6.pdf”) p2 dev.off() # —————————————— # 3.5.3 Hierarchical cluster (tree) analysis #input should contain hellinger! mpse_abund %<>% mp_cal_clust( .abundance = hellinger, distmethod = “bray”, hclustmethod = “average”, # (UPGAE) action = “add” # action is used to control which result will be returned ) mpse_abund mpse_abund %>% print(width=380, n=2) #NOTE mpse_abund contains 34 varibles, no new variable, the column bray has been new calculated! # if action = ‘add’, the result of hierarchical cluster will be added to the MPSE object # mp_extract_internal_attr can extract it. It is a treedata object, so it can be visualized # by ggtree. sample.clust <- mpse_abund %>% mp_extract_internal_attr(name=’SampleClust’) #The object contained internal attribute: PCoA ADONIS SampleClust sample.clust #–> The associated data tibble abstraction: 27 × 30 library(ggtree) p <- ggtree(sample.clust) + geom_tippoint(aes(color=Group)) + geom_tiplab(as_ylab = TRUE) + ggplot2::scale_x_continuous(expand=c(0, 0.01)) png("hierarchical_cluster1.png", width= 1000, height=800) p dev.off() #https://bioconductor.org/packages/release/bioc/vignettes/MicrobiotaProcess/inst/doc//MicrobiotaProcess.html # mapping = aes(x = RelRareAbundanceBySample-->Group, # y = Sample–>Group, # fill = Phyla # ), library(ggtreeExtra) library(ggplot2) # Extract relative abundance of phyla phyla.tb <- mpse_abund %>% mp_extract_abundance(taxa.class=Phylum, topn=30) # The abundance of each samples is nested, it can be flatted using the unnest of tidyr. phyla.tb %<>% tidyr::unnest(cols=RareAbundanceBySample) %>% dplyr::rename(Phyla=”label”) phyla.tb phyla.tb %>% print(width=380, n=10) p1 <- p + geom_fruit( data=phyla.tb, geom=geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Phyla ), orientation = "y", #offset = 0.4, pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of phyla (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) png("hierarchical_cluster2_Phyla.png", width = 1000, height = 800) p1 dev.off() # Extract relative abundance of classes class.tb <- mpse_abund %>% mp_extract_abundance(taxa.class = Class, topn = 30) # Flatten and rename the columns class.tb %<>% tidyr::unnest(cols = RareAbundanceBySample) %>% dplyr::rename(Class = “label”) # View the data frame class.tb # Create the plot p1 <- p + geom_fruit( data = class.tb, geom = geom_col, mapping = aes(x = RelRareAbundanceBySample, y = Sample, fill = Class ), orientation = "y", pwidth = 3, axis.params = list(axis = "x", title = "The relative abundance of classes (%)", title.size = 4, text.size = 2, vjust = 1), grid.params = list() ) # Save the plot to a file #ERROR-->NEED to be DEBUGGED! png(“hierarchical_cluster2_Class.png”, width = 1000, height = 800) print(p1) dev.off() # ———————– # 3.6 Biomarker discovery library(ggtree) library(ggtreeExtra) library(ggplot2) library(MicrobiotaProcess) library(tidytree) library(ggstar) library(forcats) #—-BUG: why resulting in 26 taxa != 16 in the end —- mpse_abund %>% print(width=150) #mpse_abund %<>% # mp_cal_abundance( # for each samples # .abundance = RareAbundance # ) %>% # mp_cal_abundance( # for each groups # .abundance=RareAbundance, # .group=Group # ) #mpse_abund mpse_abund %<>% mp_diff_analysis( .abundance = RelRareAbundanceBySample, .group = Group, first.test.alpha = 0.01, filter.p=”pvalue” ) # The result is stored to the taxatree or otutree slot, you can use mp_extract_tree to extract the specific slot. taxa.tree <- mpse_abund %>% mp_extract_tree(type=”taxatree”) taxa.tree ## And the result tibble of different analysis can also be extracted with tidytree (>=0.3.5) #LDAupper, LDAmean, LDAlower, taxa.tree %>% select(label, nodeClass, Sign_Group, fdr) #%>% dplyr::filter(!is.na(fdr)) taxa.tree %>% print(width=150, n=200) # — replace the pvalue and fdr with pvalue and p-adjusted from DESeq enrichment results — #TODO: replace the values of pvalue and fdr in taxa.tree, with the values of pvalue and padj from sigtab, if the the tips in taxa.tree could be found in colnames(sigtab). #tree_data <- get.data(taxa.tree) #as.treedata(taxa.tree) #d <- tibble(label = paste0('t', 1:4), trait = rnorm(4)) tree_data <- as_tibble(taxa.tree) #full_join(x, d, by = 'label') %>% as.treedata # Modify tree_data by joining with sigtab and updating Sign_Group sigtab$label <- rownames(sigtab) #write.xlsx(sigtab, file = "sigtab.xlsx") sum(sigtab$padj<0.05)) #taxa.tree <- left_join(tree_data, sigtab[, c("label", "log2FoldChange", "pvalue", "padj")], by = 'label') %>% as.treedata taxa.tree2 <- tree_data %>% left_join(sigtab[, c(“label”, “baseMean”, “log2FoldChange”, “lfcSE”, “stat”, “pvalue”, “padj”)], by = “label”) %>% mutate(Sign_Group = case_when( log2FoldChange > 0 & padj <= 0.05 ~ "Group2", log2FoldChange < 0 & padj <= 0.05 ~ "Group6", TRUE ~ NA_character_ # Sets Sign_Group to NA otherwise )) %>% as.treedata() # Convert the dataframe to a treedata object taxa.tree2 %>% print(width=380, n=20) # —- print taxa_data2 to Excel, why resulting in 26 records? —- taxa_data2 <- as_tibble(taxa.tree2) sum(!is.na(taxa_data2$Sign_Group)) sapply(taxa_data2, class) # Remove or transform list columns if not needed taxa_data2_simplified <- taxa_data2 %>% select(-RareAbundanceBySample, -RareAbundanceByGroup) %>% mutate(across(where(is.list), ~toString(.))) # Convert lists to character strings if needed # Replace NA with a placeholder, such as “NA” or another suitable representation taxa_data2_simplified <- taxa_data2_simplified %>% mutate(across(everything(), ~ifelse(is.na(.), “NA”, .))) taxonomy_data <- as.data.frame(mp_extract_taxonomy(mpse_abund)) colnames(taxa_data2_simplified)[colnames(taxa_data2_simplified) == "label"] <- "OTU" combined_data <- left_join(taxa_data2_simplified, taxonomy_data, by = "OTU") library(writexl) write_xlsx(combined_data, "taxa_data2.xlsx") # Since taxa.tree is treedata object, it can be visualized by ggtree and ggtreeExtra p1 <- ggtree( taxa.tree2, layout="radial", size = 0.3 ) + geom_point( data = td_filter(!isTip), fill="white", size=1, shape=21 ) # display the high light of phylum clade. p2 <- p1 + geom_hilight( data = td_filter(nodeClass == "Phylum"), mapping = aes(node = node, fill = label) ) # display the relative abundance of features(OTU) p3 <- p2 + ggnewscale::new_scale("fill") + geom_fruit( data = td_unnest(RareAbundanceBySample), geom = geom_star, mapping = aes( x = fct_reorder(Sample, Group, .fun=min), size = RelRareAbundanceBySample, fill = Group, subset = RelRareAbundanceBySample > 0 ), starshape = 13, starstroke = 0.25, offset = 0.03, pwidth = 0.4, grid.params = list(linetype=2) ) + scale_size_continuous( name=”Relative Abundance (%)”, range = c(.5, 3) ) + scale_fill_manual(values=c(“#1B9E77”, “#D95F02”)) # display the tip labels of taxa tree p4 <- p3 + geom_tiplab(size=6, offset=4.0) # display the LDA of significant OTU. #p5 <- p4 + # ggnewscale::new_scale("fill") + # geom_fruit( # geom = geom_col, # mapping = aes( # x = LDAmean, # fill = Sign_Group, # subset = !is.na(LDAmean) # ), # orientation = "y", # offset = 0.3, # pwidth = 0.5, # axis.params = list(axis = "x", # title = "Log10(LDA)", # title.height = 0.01, # title.size = 2, # text.size = 1.8, # vjust = 1), # grid.params = list(linetype = 2) # ) # display the significant (FDR-->pvalue–>padj) taxonomy after kruskal.test (default) #shape = 21, #scale_size_continuous(range=c(1, 3)) + p6 <- p4 + ggnewscale::new_scale("size") + geom_point( data=td_filter(!is.na(Sign_Group)), mapping = aes(size = -log10(padj), fill = Sign_Group, ), shape = 21, ) + scale_size_continuous(range=c(1, 4)) + scale_fill_manual(values=c("#1B9E77", "#D95F02")) svg("diff_analysis_Group2_vs_Group6.svg",width=22, height=22) #png("differently_expressed_otu.png", width=2000, height=2000) p6 + theme( legend.key.height = unit(1.0, "cm"), legend.key.width = unit(1.0, "cm"), legend.spacing.y = unit(0.01, "cm"), legend.text = element_text(size = 20), legend.title = element_text(size = 20) #legend.position = c(0.99, 0.01) ) dev.off()

Mapping reads on reference genomes

  1. Search for the reference complete genome at https://www.ncbi.nlm.nih.gov/genomes/GenomesGroup.cgi: Enterovirus type B sequences, Parvovirus B19 sequences, Rhinovirus A sequences and Parainfluenza type 3

    #- Sort and Index the BAM File:
    #    samtools sort -o sorted.bam input.bam
    #    samtools index sorted.bam
    #- Call Variants:
    #    bcftools mpileup -Ou -f reference.fasta sorted.bam | bcftools call -mv -Oz -o calls.vcf.gz
    #    bcftools index calls.vcf.gz
    #- Generate Consensus FASTA:
    #    bcftools consensus -f reference.fasta calls.vcf.gz -o consensus.fasta
  2. Align Reads to Reference Genome

    First, align the reads from isolate 2 to the genome of isolate 1. For example, using BWA:

    bwa index Enterovirus_B.fasta
    bwa index Parvovirus_B19.fasta
    bwa index Rhinovirus_A.fasta
    bwa index Parainfluenza_3.fasta
    #bwa mem Enterovirus_B.fasta isolate2_reads.fastq > aligned.sam
    #bwa mem Enterovirus_B.fasta isolate2_reads_1.fastq isolate2_reads_2.fastq > aligned.sam
    bwa mem -t 64 Enterovirus_B.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_AW_on_Enterovirus_B.bam
    bwa mem -t 64 Enterovirus_B.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_GE_on_Enterovirus_B.bam
    bwa mem -t 64 Enterovirus_B.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_IF_on_Enterovirus_B.bam
    bwa mem -t 64 Enterovirus_B.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_42_S1_on_Enterovirus_B.bam
    bwa mem -t 64 Enterovirus_B.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_43_S2_on_Enterovirus_B.bam
    bwa mem -t 64 Enterovirus_B.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_44_S3_on_Enterovirus_B.bam
    
    bwa mem -t 64 Parvovirus_B19.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_AW_on_Parvovirus_B19.bam
    bwa mem -t 64 Parvovirus_B19.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_GE_on_Parvovirus_B19.bam
    bwa mem -t 64 Parvovirus_B19.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_IF_on_Parvovirus_B19.bam
    bwa mem -t 64 Parvovirus_B19.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_42_S1_on_Parvovirus_B19.bam
    bwa mem -t 64 Parvovirus_B19.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_43_S2_on_Parvovirus_B19.bam
    bwa mem -t 64 Parvovirus_B19.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_44_S3_on_Parvovirus_B19.bam
    
    bwa mem -t 64 Rhinovirus_A.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_AW_on_Rhinovirus_A.bam
    bwa mem -t 64 Rhinovirus_A.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_GE_on_Rhinovirus_A.bam
    bwa mem -t 64 Rhinovirus_A.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_IF_on_Rhinovirus_A.bam
    bwa mem -t 64 Rhinovirus_A.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_42_S1_on_Rhinovirus_A.bam
    bwa mem -t 64 Rhinovirus_A.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_43_S2_on_Rhinovirus_A.bam
    bwa mem -t 64 Rhinovirus_A.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_44_S3_on_Rhinovirus_A.bam
    
    bwa mem -t 64 Parainfluenza_3.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_1/AW_S22_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_AW_on_Parainfluenza_3.bam
    bwa mem -t 64 Parainfluenza_3.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_2/GE_S23_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_GE_on_Parainfluenza_3.bam
    bwa mem -t 64 Parainfluenza_3.fasta ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R1_001.fastq.gz ./240822_VH00358_106_AAFKTG7M5/p20562_3/IF_S24_R2_001.fastq.gz | samtools view -Sb - > MiSeq_p20562_IF_on_Parainfluenza_3.bam
    bwa mem -t 64 Parainfluenza_3.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/42_S1_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_42_S1_on_Parainfluenza_3.bam
    bwa mem -t 64 Parainfluenza_3.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/43_S2_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_43_S2_on_Parainfluenza_3.bam
    bwa mem -t 64 Parainfluenza_3.fasta ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R1_001.fastq.gz ./20240822_FS10003086_54_BTR99504-1132/Alignment_Imported_1/20240823_184235/Fastq/44_S3_L001_R2_001.fastq.gz | samtools view -Sb - > iSeq_44_S3_on_Parainfluenza_3.bam

    or, use vrap to generate input.bam

    #for bowtie (1 DB): --host Bacillus_cereus.fasta
    #for blast (5 DBs): --virus=Acinetobacter_baumannii.fasta -n /mnt/h1/jhuang/blast/nt -a /mnt/h1/jhuang/blast/nr, and two default download_db.py
    #A6_chr_plasmid.fasta reads filtered, should only the contamination reads remaining!
    vrap/vrap.py -1 ./results_ATCC19606/trimmed/A10_CraA_HQ_trimmed_P_1.fastq.gz -2 ./results_ATCC19606/trimmed/A10_CraA_HQ_trimmed_P_2.fastq.gz -o A10_vrap_host_A6 --host A6_chr_plasmid.fasta --noblast -t 55
  3. Convert SAM to BAM, Sort and Index

    Convert the SAM file to BAM, sort it, and create an index:

    samtools view -Sb mapped > aligned.bam
    samtools sort aligned.bam -o sorted.bam
    samtools index sorted.bam
  4. Coverage Analysis

    Check the coverage of the genome regions. Regions with no coverage will be masked later.

    #bedtools genomecov -ibam sorted.bam -bg > coverage.bed
    #BUG above: By default, Bedtools doesn't explicitly list regions with zero coverage in the output of genomecov. To get around this, you can use the -bga option with genomecov. This option ensures that regions with zero coverage are also included in the output. Here's how you can modify your command:
    bedtools genomecov -ibam sorted.bam -bga > coverage.bed
  5. Create a Bed File for Masking

    Create a BED file that specifies regions with no or low coverage. Assume that any region with coverage less than a certain threshold (e.g., 1x) should be masked:

    awk '$4 < 1 {print $1 "\t" $2 "\t" $3}' coverage.bed > low_coverage.bed
  6. Generate Consensus Sequence

    Generate a consensus sequence, using bcftools, and mask regions with low or no coverage:

    bcftools mpileup -Ou -f ../../CP059040.fasta sorted.bam | bcftools call -mv --ploidy 1 -Oz -o calls.vcf.gz
    bcftools index calls.vcf.gz
    bcftools consensus -f ../../CP059040.fasta -m low_coverage.bed calls.vcf.gz -o consensus.fasta
    #The site CP059040:4 overlaps with another variant, skipping...
    #The site CP059040:3125036 overlaps with another variant, skipping...
    #Applied 58 variants
    
    bcftools mpileup -Ou -f ../../A6_chr_plasmid.fasta sorted.bam | bcftools call -mv --ploidy 1 -Oz -o calls.vcf.gz
    bcftools index calls.vcf.gz
    bcftools consensus -f ../../A6_chr_plasmid.fasta -m low_coverage.bed calls.vcf.gz -o consensus.fasta
    #The site seq00000000:4 overlaps with another variant, skipping...
    #The site seq00000000:3125036 overlaps with another variant, skipping...
    #Applied 61 variants
    #--> TODO: could report the following regions are not covered in A10 comparing to A6.
    #seq00000000     364666  365765
    #seq00000000     2810907 2813323
    #seq00000000     2813552 2813779
    #seq00000000     2813923 2819663
    #seq00000000     2821839 2831921
    #seq00000000     2832750 2832753
    #seq00000000     2833977 2860354
    #seq00000000     2860505 2861780
    #seq00000000     2861931 2861951
    #seq00000000     2862102 2862234
    #seq00000000     2862385 2863434
    #seq00000000     3124939 3124943
    #seq00000000     3125009 3125010

    In this command, the -m option in bcftools consensus is used to specify a BED file for masking low-coverage regions.

  7. Coverage plot

    for sample in 4132-Leber_CAP28 4132-Leber_CAP45 4132-Leber_NODE328; do
        bowtie2-build ${sample}.fasta ${sample}.fasta
        bowtie2 -1 ../trimmed_paired/4132-Leber_S3_L001_R1.fastq.gz -2 ../trimmed_paired/4132-Leber_S3_L001_R2.fastq.gz -x ${sample}.fasta --fast --threads 16 -S ${sample}.sam
        samtools view -h -Sb ${sample}.sam > ${sample}.bam
        samtools sort ${sample}.bam > ${sample}_sorted.bam
        samtools index ${sample}_sorted.bam
        samtools depth -d 1000000 ${sample}_sorted.bam | gzip > ${sample}.cov.gz
        ~/Tools/damian_extended/lib_py/vipr_cov_pdf_sample.py -c ${sample}.cov.gz -p ${sample}.pdf
    done
    
    #calculate average
    samtools depth pool_rind_9bis26_94_S7_sorted.bam | awk '{sum+=$3} END { print "Average = ",sum/NR}'
    #and with stdev:
    samtools depth pool_rind_9bis26_94_S7_sorted.bam | awk '{sum+=$3; sumsq+=$3*$3} END { print "Average = ",sum/NR; print "Stdev = ",sqrt(sumsq/NR - (sum/NR)**2)}'
  8. SNVs table + plots

    --R drawing plot--
    par(mfrow=c(1,1))
    cl <- rainbow(12)
    #x=c(438382,30718,15216,68712,41092,28916,107922,428720,57002,171788,2458486,113470,21348,276406,13329824,1785322,159416,9282986,68990)
    #y=c(0.96, 0.33, 0.11, 0.62,0.72,0.05,0.86,0.96,0.76,0.19,0.99,0.85,0.29,0.94,0.99,0.98,0.91,0.99,0.80)
    #x=c(581226,238044,151492,305816,185102,249346,269852,603476,203016,167814,2590728,291946,191906,404050,13448328,1938032,295890,9387234,232008)
    #x=c(423036,10004,1682,42520,29618,1460,93110,412024,43440,3320,2422088,95996,6168,260932,13222572,1747544,144448,9199232,55275)
    #y=c(0.73,0.04,0.01,0.14,0.16,  0.01,0.35,0.68,0.21,0.02,  0.93,0.33,0.03,0.65,0.98,  0.90,0.49,0.98,0.24)
    x=c(182419,3769,970,15974,18432,563,25898,188666,13129,479,598522,12672,3272,21948,5832429,121861,942,32889,4851987,25907)
    y=c(0.314,0.016,0.006,0.232,0.099,  0.002,0.096,0.313,0.065,0.003,  0.231,0.043,0.017,0.054,0.434,  0.063,0.005,0.111,0.517,0.112)
    logmod <- lm(log(y)~log(x))
    logypred <- predict(logmod)
    png(filename = "HCV_no_vs_enrichment.png", width = 800, height = 800)
    plot(y~x,log="xy",pch=1,type="p",cex=2,col=cl[1],main="", xlab="Number of HCV reads",ylab="Enrichment rate",las=1,xaxt="n",yaxt="n")
    points(y2~x,pch=8,type="p",cex=2,col=cl[8],las=1,xaxt="n",yaxt="n")
    lines(exp(logypred)~x, col=cl[1], lwd=2)
    
    #mtext(quote(X),1,line=3,cex=2)
    #mtext(quote(P(X)),2,line=4,cex=2)
    sfsmisc::eaxis(1,at=c(10^3,10^4,10^5,10^6,10^7),cex.axis=1.5)
    sfsmisc::eaxis(2,at=c(10^-1,10^0,10^1,10^2,10^3,10^4,10^5),cex.axis=1.5)
    #fit
    #legend(3000,6000, c("PE","SE","PE_unenriched"), lty=c(1,1),col=c(cl[1],cl[8],cl[5]))
    legend(3000,100, c("PE","SE"), lty=c(1,1),col=c(cl[1],cl[8]))
    legend("topright", bty="n", legend=paste("R2 =", format(summary(logmod)$adj.r.squared, digits=4)))
    dev.off()
    
    mkdir phylogenetics; cd phylogenetics
    
    mkdir assembly; cd assembly
    for sample in rsv-on1-h1-e1231-05ng 84660-tsek-50ng; do
        cp ~/rtpd_files/${sample}/idba_ud_assembly/gapped_contig.fa ${sample}.fa
    done
    
    #mkdir fasta_summary; cd fasta_summary
    #for sample in 838_S1 840_S2 820_S3 828_S4 815_S5 834_S6 808_S7 811_S8 837_S9 768_S10 773_S11 767_S12 810_S13 814_S14 10121-16_S15 7510-15_S16   8806-15_S18 9881-16_S19 8981-14_S20; do
    #   cp ../viral-ngs/data/02_assembly/${sample}.fasta ${sample}.fa     #828-17_S17 not inclusive, since they rRNA.
    #done
    cat 838_S1.fa 840_S2.fa 820_S3.fa 828_S4.fa 815_S5.fa 834_S6.fa 808_S7.fa 811_S8.fa 837_S9.fa 768_S10.fa 773_S11.fa 767_S12.fa 810_S13.fa 814_S14.fa 10121-16_S15.fa 7510-15_S16.fa  828-17_S17.fa  8806-15_S18.fa 9881-16_S19.fa 8981-14_S20.fa > all.fa
    cat
    mafft --adjustdirection --clustalout all.fa > all.aln
    cons
    mv all.fasta consensus.fa
    
    #under ~/rtpd_files/
    for sample in rsv-on1-h1-e1231-05ng 84660-tsek-50ng; do
    seqtk comp ${sample}/idba_ud_assembly/gapped_contig.fa | awk '{x=$3+$4+$5+$6;y=$2;print $1,y,x,y-x,(y-x)/y}'
    done
    
    #--
    mkdir interhost_variants_ref_p947; cd interhost_variants_ref_p947
    
    #mkdir multialign_to_ref; cd multialign_to_ref
    #mafft --adjustdirection --clustalout ref_plus_samples.fa > ref_plus_samples.aln
    
    #--
    mkdir intrahost_variants; cd intrahost_variants
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
        cp ~/rtpd_files/${sample}_dedup/vphaser2_cut_filtered_groupref.annot.csv ${sample}_dedu
        cp ~/rtpd_files/${sample}/vphaser2_cut_filtered_groupref.annot.csv ${sample}_du
        #grep "#Chrom" ${sample}_dedu > ${sample}_dedup
        #grep "#Chrom" ${sample}_du > ${sample}_dup
        echo -e "#Chrom\tPosition\tREF\tAllele\tFrequency\tCoverage\tAnnotation\tAnnotation_Impact\tGene_Name\tFeature_Type\tTranscript_BioType\tCodon_Change\tAmino_Acid_Change\tCDS.pos/CDS.length\tAA.pos/AA.length" > ${sample}_dedup
        echo -e "#Chrom\tPosition\tREF\tAllele\tFrequency\tCoverage\tAnnotation\tAnnotation_Impact\tGene_Name\tFeature_Type\tTranscript_BioType\tCodon_Change\tAmino_Acid_Change\tCDS.pos/CDS.length\tAA.pos/AA.length" > ${sample}_dup
        awk 'length($3) == 1 && length($4) == 1' ${sample}_dedu >> ${sample}_dedup
    awk 'length($3) == 1 && length($4) == 1' ${sample}_du >> ${sample}_dup
    done
    mv p938_dedup _p938_dedup
    ~/Tools/csv2xls-0.4/csv_to_xls.py p946_dup p954_dup p952_dup p948_dup p945_dup p947_dup p955_dup p943_dup p951_dup p942_dup  p944_dup p938_dup p953_dup p940_dup  p946_dedup p954_dedup p952_dedup p948_dedup p945_dedup p947_dedup p955_dedup p943_dedup p951_dedup p942_dedup  p944_dedup _p938_dedup p953_dedup p940_dedup  -d$'\t' -o  SNVs.xls
    
    #---- collect plots and bams for final results ----
    #under ~/DATA/Data_Pietschmann_RSV_Probe/
    # replot plot if vphaser2_cut_filtered_groupref.vcf is empty.
    gzip vphaser2_cut_filtered_groupref.vcf
    ~/Tools/damian_extended/lib_py/vipr_af_vs_cov_pdf_1sample.py --vcf vphaser2_cut_filtered_groupref.vcf.gz --cov cov_groupref.gz --plot af-vs-cov_groupref.svg
    inkscape -z -e af-vs-cov_groupref.png af-vs-cov_groupref.svg -w 1600
    gunzip vphaser2_cut_filtered_groupref.vcf.gz
    
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
    cp ~/rtpd_files/${sample}_dedup/af-vs-cov_groupref.png ${sample}_dedup.png
    cp ~/rtpd_files/${sample}/af-vs-cov_groupref.png ${sample}_dup.png
    done
    
    #under DIR results
    mkdir bams; cd bams
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
    cp ~/rtpd_files/${sample}_dedup/mapped.bam ${sample}_mapped_dedup.bam
    done
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
    cp ~/rtpd_files/${sample}/mapped.bam ${sample}_mapped_dup.bam
    done
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
    samtools index ${sample}_mapped_dedup.bam
    samtools index ${sample}_mapped_dup.bam
    done
    
    #---- phylogenetic tree using ML ----
    "" > all.fa
    for sample in p946 p954 p952 p948 p945 p947 p955 p943 p951 p942  p944 p938 p953 p940; do
    cp ~/rtpd_files/${sample}/idba_ud_assembly/polished_contig.fa ${sample}.fa
    cp ../data/02_assembly/REF${sample}/REF${sample}.gbf ${sample}.gbk
    cat ~/rtpd_files/${sample}/idba_ud_assembly/polished_contig.fa >> all.fa
    done
    mafft --adjustdirection all.fa > all_aln.fa
    raxml-ng --all --model GTR+G --prefix RSV_GTR_G --threads 1 --msa all_aln.fa --bs-trees 200 --redo
    raxml-ng --all --model GTR+G+I --prefix RSV_GTR_G_I --threads 1 --msa all_aln.fa --bs-trees 1000 --redo
    #GTR+G+I --> GTR+FO+I+G4m
    #GTR+G -->  GTR+FO+G4m
    
    -- python merging plots--
    #under viral3
    import cv2 as cv
    from matplotlib import pyplot as plt
    import numpy as np
    import subprocess
    image1 = cv.imread('p955_dup.png')
    image2 = cv.imread('p943_dup.png')
    image3 = cv.imread('p954_dup.png')
    image4 = cv.imread('p946_dup.png')
    image5 = cv.imread('p942_dup.png')
    image6 = cv.imread('p945_dup.png')
    image7 = cv.imread('p948_dup.png')
    image8 = cv.imread('p947_dup.png')
    image9 = cv.imread('p951_dup.png')
    image10 = cv.imread('p952_dup.png')
    image11 = cv.imread('p944_dup.png')
    image12 = cv.imread('p938_dup.png')
    image13 = cv.imread('p953_dup.png')
    image14 = cv.imread('p940_dup.png')
    final = np.concatenate((image1, image2, image3, image4, image5, image6, image7, image8, image9, image10, image11, image12, image13, image14), axis = 0)
    cv.imwrite("coverages_and_SNVs_dup.png", final)
    
    import cv2 as cv
    from matplotlib import pyplot as plt
    import numpy as np
    import subprocess
    image1 = cv.imread('p3/af-vs-cov_groupref.png')
    image2 = cv.imread('p4/af-vs-cov_groupref.png')
    image3 = cv.imread('p5_700ng/af-vs-cov_groupref.png')
    final = np.concatenate((image1, image2, image3), axis = 0)
    cv.imwrite("coverages_and_SNVs_dedup_HEV.png", final)
    
    import cv2 as cv
    from matplotlib import pyplot as plt
    import numpy as np
    import subprocess
    image1 = cv.imread('p955_dedup.png')
    image2 = cv.imread('p943_dedup.png')
    image3 = cv.imread('p954_dedup.png')
    image4 = cv.imread('p946_dedup.png')
    image5 = cv.imread('p942_dedup.png')
    image6 = cv.imread('p945_dedup.png')
    image7 = cv.imread('p948_dedup.png')
    image8 = cv.imread('p947_dedup.png')
    image9 = cv.imread('p951_dedup.png')
    image10 = cv.imread('p952_dedup.png')
    image11 = cv.imread('p944_dedup.png')
    image12 = cv.imread('p938_dedup.png')
    image13 = cv.imread('p953_dedup.png')
    image14 = cv.imread('p940_dedup.png')
    final = np.concatenate((image1, image2, image3, image4, image5, image6, image7, image8, image9, image10, image11, image12, image13, image14), axis = 0)
    cv.imwrite("coverages_and_SNVs_dedup.png", final)
    
    rm p*dup.png
    
    image1 = cv.imread('838_S1.png')
    image2 = cv.imread('840_S2.png')
    image3 = cv.imread('837_S9.png')
    final = np.concatenate((image1, image2, image3), axis = 0)
    cv.imwrite("genotype_4d.png", final)
    
    image1 = cv.imread('820_S3.png')
    image2 = cv.imread('808_S7.png')
    image3 = cv.imread('811_S8.png')
    image4 = cv.imread('810_S13.png')
    image5 = cv.imread('10121-16_S15.png')
    image6 = cv.imread('7510-15_S16.png')
    image7 = cv.imread('9881-16_S19.png')
    final = np.concatenate((image1, image2, image3, image4, image5, image6, image7), axis = 0)
    cv.imwrite("genotype_3a.png", final)
    
    image1 = cv.imread('768_S10.png')
    image2 = cv.imread('773_S11.png')
    image3 = cv.imread('814_S14.png')
    image4 = cv.imread('8806-15_S18.png')
    final = np.concatenate((image1, image2, image3, image4), axis = 0)
    cv.imwrite("genotype_1a.png", final)

Co-Authorship Network Visualization in Python

co_author_network_cropped_2

The Python script creates a co-authorship network using NetworkX, where:

  • Nodes are authors.
  • Edges represent co-authorship.
  1. It visualizes the network using matplotlib.

    import networkx as nx
    import matplotlib.pyplot as plt
    import bibtexparser
    import re
    
    # Helper function to clean special characters from strings
    def clean_string(s):
        s = s.replace('.', '')  # Remove periods
        s = re.sub(r'[{}]', '', s)  # Remove curly braces used in BibTeX formatting
        s = re.sub(r'\\[a-zA-Z]{1,2}', '', s)  # Remove LaTeX commands (e.g., \textcopyright)
        return ' '.join([n for n in s.split(' ') if len(n) > 1])  # Remove single-letter names
    
    # Load the .bib file
    with open('Pure_publikationen_19.09.24_simpfied.bib', 'r') as bibtex_file:
        bib_database = bibtexparser.load(bibtex_file)
    
    internal_authors = ["Jiabin Huang", "Nicole Fischer", "Denise Ohnezeit", "Jiabin Huang", "Ute Westerkamp", "Veronika Brinschwitz", "Claudia Schmidt", "Manja Czech-Sioli", "Samira Weißelberg", "Tabea Schlemeyer", "Nicole Fischer", "Laura Berneking", "Indra Bekere", "Sören Rob", "Marie Schnapp", "Jiabin Huang", "Klaus Ruckdeschel", "Martin Aepfelbacher", "Anna Both", "Jiabin Huang", "Martin Aepfelbacher", "Holger Rohde", "Martin Christner Anna Both", "Jiabin Huang", "Martin Christner", "T. O. Klatte", "Martin Aepfelbacher", "Holger Rohde", "Holger Rohde", "Jiabin Huang", "Luise Brakert", "Laura Berneking", "Anna Both", "Benjamin Berinson", "Jiabin Huang", "Martin Aepfelbacher", "Christine Wolschke", "Dominic Wichmann", "Holger Rohde", "Holger Rohde", "Jiabin Huang", "Swantje Gundlach", "Jiabin Huang", "Marc Lütgehetmann", "Nicole Fischer Anna Both", "Florian Kruse", "Nadine Mirwald", "Gefion Franke", "Martin Christner", "Jiabin Huang", "Jan Lennart Hansen", "Nicolaus-Martin Kröger", "Laura Berneking", "H. Lellek", "Martin Aepfelbacher", "Holger Rohde", "Jiabin Huang", "Nicole Fischer", "Jiabin Huang", "Nicole Fischer", "Jiabin Huang", "Nicole Fischer", "Jiabin Huang", "Nicole Fischer", "Jiabin Huang", "Anna Both", "Jiabin Huang", "Minyue Qi", "Samira Weißelberg", "Henning Büttner", "S. Lezius", "Antonio Failla", "Martin Christner", "Malik Alawi", "Martin Aepfelbacher", "Holger Rohde", "Jiabin Huang", "Jiabin Huang", "K. Giersch", "L. Hermanussen", "T. Volz", "A. Volmari", "L. Allweiss", "Jiabin Huang", "Nicole Fischer", "Marc Lütgehetmann", "M. Dandri", "I. Stelzer", "C. Urbschat", "S. Schepanski", "K. Thiele", "I. Triviai", "A. Wieczorek", "Malik Alawi", "Denise Ohnezeit", "J. Kottlau", "Jiabin Huang", "Nicole Fischer", "H-W. Mittrücker", "M. E. Solano", "B. Fehse", "A. Diemert", "F. Stahl", "P. Arck", "Indra Bekere", "Jiabin Huang", "Marie Schnapp", "Maren Rudolph", "Laura Berneking", "Klaus Ruckdeschel", "Nicole Fischer", "Martin Aepfelbacher", "Susanne Pfefferle", "Jiabin Huang", "Dominik Nörz", "Marc Lütgehetmann", "Martin Aepfelbacher", "Nicole Fischer", "Susanne Pfefferle", "Robin Kobbe", "Manja Czech-Sioli", "Dominik Nörz", "R. Santer", "J. Oh", "S. Kluge", "K. Peldschus", "Jiabin Huang", "Martin Aepfelbacher", "Johannes Knobloch", "Marc Lütgehetmann", "Nicole Fischer", "Nicole Fischer", "Jiabin Huang", "Marc Lütgehetmann", "C. Iking-Konert L. Guo", "Jiabin Huang", "M. Chen", "E. Piotrowski", "N. Song", "G. Zahner", "H-J. Paust", "Malik Alawi", "F. Thaiss", "Anna Both", "Henning Büttner", "Jiabin Huang", "M. Perbandt", "C. Belmar Campos", "Martin Christner", "F. P. Maurer", "S. Kluge", "C. König", "Martin Aepfelbacher", "Dominic Wichmann", "Holger Rohde", "C. F. Krebs", "H-J. Paust", "S. Krohn", "T. Koyro", "S. R. Brix", "J-H. Riedel", "Patricia Bartsch", "Thorsten Wiech", "C. Meyer-Schwesinger", "Jiabin Huang", "Nicole Fischer", "C. P. Busch", "H-W. Mittrücker", "L. G. Perez", "U. O. Wenzel", "M. Janneck", "O. M. Steinmetz", "Nicola Gagliani", "Rolf Stahl", "Samuel Huber", "J-E. Turner", "Ulf Panzer", "Anna Both", "Jiabin Huang", "Henning Büttner", "Martin Aepfelbacher", "Holger Rohde", "Moritz Hentschke", "Jiabin Huang", "Jiabin Huang", "Jiabin Huang", "Jiabin Huang", "Björn Voß"]
    internal_authors = list(set(internal_authors))
    
    # Create an empty graph
    G = nx.Graph()
    
    #print("Nodes:", G.nodes())
    #print("Edges:", G.edges())
    
    #The first entry:
    #{'author': 'Sake, Svenja M and Xiaoyu Zhang and Rajak, Manoj Kumar and Melanie Urbanek-Quaing and Arnaud Carpentier and Gunesch, Antonia P and Christina Grethe and Alina Matthaei and Jessica Rückert and Marie Galloux and Thibaut Larcher and Le Goffic, Ronan and Fortune Hontonnou and Chatterjee, Arnab K and Kristen Johnson and Kaycie Morwood and Katharina Rox and Elgaher, Walid A M and Jiabin Huang and Martin Wetzke and Gesine Hansen and Nicole Fischer and Jean-Francois Elouët and Marie-Anne Rameix-Welti and Hirsch, Anna K H and Elisabeth Herold and Martin Empting and Chris Lauber and Thomas Krey and Sibylle Haid and Thomas Pietschmann', 'title': 'Drug repurposing screen identifies lonafarnib as respiratory syncytial virus fusion protein inhibitor', 'ENTRYTYPE': 'article', 'ID': '23fb542b9ca640f791bac65fcc137b9e'}
    
    # Iterate through each entry in the bibtex file
    for entry in bib_database.entries:
        title = entry.get('title', '').replace(':', ' ')
        #title = clean_string(f"Paper/{title}")
    
        authors = entry.get('author', '').split(' and ')  # Authors are separated by 'and' in BibTeX
    
        for author in authors:
            #author = clean_string(f"Author/{author}")
            if author in internal_authors:
                print(author)
                G.add_edge(author, title)
    
    ## Try different layout engines if 'sfdp' is problematic
    #try:
    #    pos = nx.nx_pydot.graphviz_layout(G, prog='sfdp')
    #except AssertionError:
    #    print("Error with sfdp layout, switching to 'dot' layout.")
    #    pos = nx.nx_pydot.graphviz_layout(G, prog='dot')  # Fallback to 'dot'
    try:
        pos = nx.nx_pydot.graphviz_layout(G, prog='sfdp')
    except Exception as e:
        print("Error generating layout:", e)
        pos = nx.spring_layout(G)  # Fallback to another layout
    
    for node in G.nodes():
        if isinstance(node, str):
            G.nodes[node]['label'] = node.replace(' ', '_').replace('/', '_')
    
    print("Nodes in the graph:", G.nodes())
    # Determine maximum length for author nodes
    max_len = max([len(n) for n in G.nodes() if n in internal_authors])
    print(max_len)
    
    plt.figure(figsize=(48, 36))
    
    #plot nodes for authors
    nx.draw_networkx_nodes(G, pos,
        #nodelist=[n for n in G.nodes() if n.startswith('Author/')],
        nodelist=[n for n in G.nodes() if n in internal_authors],
        node_size=max_len*200)
    
    #plot nodes for publications
    nx.draw_networkx_nodes(G, pos,
        nodelist=[n for n in G.nodes() if n not in internal_authors],
        node_color='y',
        node_size=100)
    
    nx.draw_networkx_edges(G, pos)
    nx.draw_networkx_labels(G, pos,
        labels={n: n.split('/')[-1].replace(' ', '\n') for n in G.nodes() if n in internal_authors},
        font_color='w', font_size=10, font_weight='bold', font_family='serif') #font_family='sans-serif')
    #'serif': Uses a serif typeface (e.g., Times New Roman).
    #'sans-serif': Uses a sans-serif typeface (e.g., Helvetica, Arial).
    #'monospace': Uses a monospace typeface (e.g., Courier New).
    #'DejaVu Sans': A popular sans-serif typeface available in many environments.
    #'Arial': A widely available sans-serif typeface.
    #'Times New Roman': A classic serif typeface.
    #'Comic Sans MS': A casual sans-serif typeface.
    
    plt.axis('off')
    
    # Save the plot as a PNG file
    #, bbox_inches="tight"
    plt.savefig("co_author_network.png", format="png")
    #convert Figure_2.png -crop 1340x750+315+135 co_author_network_cropped_2.png
    
    plt.show()
  2. Imported bib-file

    @article{23fb542b9ca640f791bac65fcc137b9e,
      title     = "Drug repurposing screen identifies lonafarnib as respiratory syncytial virus fusion protein inhibitor",
      author    = "Sake, Svenja M and Xiaoyu Zhang and Rajak, Manoj Kumar and Melanie Urbanek-Quaing and Arnaud Carpentier and Gunesch, Antonia P and Christina Grethe and Alina Matthaei and Jessica Rückert and Marie Galloux and Thibaut Larcher and Le Goffic, Ronan and Fortune Hontonnou and Chatterjee, Arnab K and Kristen Johnson and Kaycie Morwood and Katharina Rox and Elgaher, Walid A M and Jiabin Huang and Martin Wetzke and Gesine Hansen and Nicole Fischer and Jean-Francois Elouët and Marie-Anne Rameix-Welti and Hirsch, Anna K H and Elisabeth Herold and Martin Empting and Chris Lauber and Thomas Krey and Sibylle Haid and Thomas Pietschmann",
    }
    
    @article{902563efda5a464b86f9195f4d5ef964,
      title     = "Merkel cell polyomavirus small tumor antigen contributes to immune evasion by interfering with type I interferon signaling",
      author    = "Denise Ohnezeit and Jiabin Huang and Ute Westerkamp and Veronika Brinschwitz and Claudia Schmidt and Thomas Günther and Manja Czech-Sioli and Samira Weißelberg and Tabea Schlemeyer and Jacqueline Nakel and Julia Mai and Sabrina Schreiner and Carola Schneider and Caroline C Friedel and Hella Schwanke and Melanie M Brinkmann and Adam Grundhoff and Nicole Fischer",
    }
    
    @article{c1d64e689be44cfca56d74a33cccac91,
      title     = "A bacterial effector protein promotes nuclear translocation of Stat3 to induce IL-10.",
      author    = "L Berneking and I Bekere and S Rob and M Schnapp and J Huang and K Ruckdeschel and M Aepfelbacher",
    }
    
    @article{9fbe8d2517e44a9e845f077480a8839f,
      title     = "First case of bloodstream infection caused by Mixta hanseatica sp. nov., a novel species within the Mixta genus of the Erwiniaceae family",
      author    = "Anna Both and Jiabin Huang and Philipp Wenzel and Martin Aepfelbacher and Holger Rohde and Martin Christner and Moritz Hentschke",
    }
    
    @article{8d43e070f40045fc946d9b832ac80cf3,
      title     = "Genomics of Invasive Cutibacterium acnes Isolates from Deep-Seated Infections",
      author    = "Anna Both and Jiabin Huang and Moritz Hentschke and David Tobys and Martin Christner and Till Orla Klatte and Harald Seifert and Martin Aepfelbacher and Holger Rohde"
    }
    
    @article{f0ca6606b53d491bbb57f5046e292fc4,
      title     = "IKK1 aggravates ischemia-reperfusion kidney injury by promoting the differentiation of effector T cells",
      author    = "Ning Song and Yang Xu and Hans-Joachim Paust and Ulf Panzer and Maria de las Mercedes Noriega and Linlin Guo and Thomas Renne and Jiabin Huang and Xianglin Meng and Mingyan Zhao and Friedrich Thaiss"
    }
    
    @article{1cb3c347f86446e1b5c4fb0d0703f5d6,
      title     = "Pharmacokinetic/pharmacodynamic evaluation of tigecycline dosing in a hollow fiber infection model against clinical bla-KPC producing Klebsiella Pneumoniae isolates",
      author    = "Lisa F. Amann and Astrid Broeker and Maria Riedner and Holger Rohde and Jiabin Huang and Patrice Nordmann and Jean-Winoc Decousser and Sebastian G. Wicha"
    }
    
    @article{b2f8d96cdd5f4ff6a9d1a713888c4a20,
      title     = "Rapid Development of cefiderocol resistance in a carbapenem-resistant Pseudomonas aeruginosa isolate associated with mutations in the pyoverdine biosynthesis pathway",
      author    = "Luise Brakert and Laura Berneking and Anna Both and Benjamin Berinson and Jiabin Huang and Martin Aepfelbacher and Christine Wolschke and Dominic Wichmann and Holger Rohde"
    }
    
    @article{502b812862474fea916c09646ef1b210,
      title     = "A pharmacokinetic-pharmacodynamic (PKPD) model-based analysis of tedizolid against enterococci using the hollow-fibre infection model",
      author    = "Khalid Iqbal and Holger Rohde and Jiabin Huang and Tjokosela Tikiso and Lisa Amann and Markus Zeitlinger and Sebastian Wicha"
    }
    
    @article{f3abbf64990240d2aec1a98080c70eca,
      title     = "Mechanisms of CD8+ T cell failure in chronic hepatitis E virus infection",
      author    = "Janine Kemming and Swantje Gundlach and Marcus Panning and Daniela Huzly and Jiabin Huang and Marc Lü tgehetmann and Nicole Fischer and Christoph Neumann-Haefelin"
    }
    
    @article{a80f9280e7c041d2aca1897678cb463d,
      title     = "Population dynamics in colonizing vancomycin-resistant Enterococcus faecium isolated from immunosuppressed patients",
      author    = "Anna Both and Florian Kruse and Nadine Mirwald and Gefion Franke and Martin Christner and Jiabin Huang and Jan Lennart Hansen and Nicolaus Kröger and Laura Berneking and Heinrich Lellek and Martin Aepfelbacher and Holger Rohde"
    }
    
    @article{77e10e8b504648729b5480114e0d683b,
      title     = "Respiratory Syncytial Virus Two-Step Infection Screen Reveals Inhibitors of Early and Late Life Cycle Stages",
      author    = "Svenja M Sake and Christina Kosch and Sebastian Blockus and Sibylle Haid and Antonia P Gunesch and Xiaoyu Zhang and Martina Friesland and Sofie B Trummer and Christina Grethe and Anne Kühnel and Jessica Rückert and W Paul Duprex and Jiabin Huang and Marie-Anne Rameix-Welti and Martin Empting and Nicole Fischer and Anna K H Hirsch and Thomas F Schulz and Thomas Pietschmann"
    }
    
    @article{71a7f9b80a5a4d23864696f5cc784dc2,
      title     = "Target capture sequencing reveals a monoclonal outbreak of respiratory syncytial virus B infections among adult hematologic patients",
      author    = "Claas Baier and Jiabin Huang and Kerstin Reumann and Daniela Indenbirken and Felicitas Thol and Christian Koenecke and Ella Ebadi and Albert Heim and Franz-Christoph Bange and Sibylle Haid and Thomas Pietschmann and Nicole Fischer"
    }
    
    @article{302a9b6b270e4d01936fadadb58b7495,
      title     = "An inter-laboratory study to investigate the impact of the bioinformatics component on microbiome analysis using mock communities",
      author    = "Denise O'Sullivan and Ronan Doyle and Sasithon Temisak and Nicholas Redshaw and Alexandra Whale and Grace Logan and Jiabin Huang and Nicole Fischer and Gregory Amos and Mark Preston and Julian Marchesi and Josef Wagner and Julian Parkhill and Yair Motro and Hubert Denise and Robert Finn and Gemma Kay and Justin O'Grady and Emma Ransom-Jones and Huihai Wu and Emma Laing and Ernest Benavente and Jody Phelan and Taane Clark and Jacob Moran-Gilad and Jim Huggett"
    }
    
    @article{162031f95f9b4d5497c91cc64cf27352,
      title     = "Benchmark of thirteen bioinformatic pipelines for metagenomic virus diagnostics using datasets from clinical samples",
      author    = "Jutte J. C. de Vries and Julianne R Brown and Nicole Fischer and Igor A Sidorov and Sofia Morfopoulou and Bas B Oude Munnink and Arzu Sayiner and Alihan Bulgurcu and Christophe Rodriguez and Guillaume Gricourt and Els Keyaerts and Leen Beller and Claudia Bachofen and Jakub Kubacki and Cordey Samuel and Laubscher Florian and Schmitz Dennis and Martin Beer and Dirk Hoeper and Michael Huber and Verena Kufner and Maryam Zaheri and Aitana Lebrand and Anna Papa and Sander van Boheemen and Aloys C M Kroes and Judith Breuer and F Xavier Lopez-Labrador and Eric C J Claas and ESCV Network on Next-Generation Sequencing"
    }
    
    @article{19a7c4e85485417f82eedb697cb06d81,
      title     = "Complete genome sequencing and molecular characterization of SARS-COV-2 from COVID-19 cases in Alborz province in Iran",
      author    = "Amir Kaffashi and Jiabin Huang and Amir Bairami and Mohammad Hossein Fallah Mehrabadi and Somayeh Yaslianifard and Mohsen Bashashati and S Reza Banihashemi and Fatemeh Soleimanifar and Mohsen Lotfi and Morteza Taghizadeh and Alireza Soleimani and Akbar Khorasani and Farzaneh Moshiri and Sayed-Hamidreza Mozhgani"
    }
    
    @article{654190298b7a4bfcaefae17efe06ea16,
      title     = "Distinct clonal lineages and within-host diversification shape invasive Staphylococcus epidermidis populations",
      author    = "Anna Both and Jiabin Huang and Minyue Qi and Christian Lausmann and Samira Weißelberg and Henning Büttner and Susanne Lezius and Antonio Virgilio Failla and Martin Christner and Marc Stegger and Thorsten Gehrke and Sharmin Baig and Mustafa Citak and Malik Alawi and Martin Aepfelbacher and Holger Rohde"
    }
    
    @inbook{be430697e7534557a04be7d46a3b6e7d,
      title     = "Reducing the search space in RNA helix based folding. European Conference on Computational Biology",
      author    = "Jiabin Huang and Björn Voß"
    }
    
    @article{aa6df25b09cc415f9d8afff369459721,
      title     = "Simulation of Folding Kinetics for Aligned RNAs",
      author    = "Jiabin Huang and Björn Voß"
    }
    
    @article{eba612f0e5dc43d29e0b97077aa08002,
      title     = "Strong Replication Interference Between Hepatitis Delta Viruses in Human Liver Chimeric Mice",
      author    = "Katja Giersch and Lennart Hermanussen and Tassilo Volz and Annika Volmari and Lena Allweiss and Camille Sureau and John Casey and Jiabin Huang and Nicole Fischer and Marc Lütgehetmann and Maura Dandri"
    }
    
    @article{80dcc4d4b01b477fafc6b2e761338ffe,
      title     = "Vertically transferred maternal immune cells promote neonatal immunity against early life infections",
      author    = "Ina Stelzer and Christopher Urbschat and Steven Schepanski and Kristin Thiele and Ioanna Triviai and Agnes Wieczorek and Malik Alawi and Denise Ohnezeit and Julian Kottlau and Jiabin Huang and Nicole Fischer and Hans-Willi Mittrücker and Maria Emilia Solano and Boris Fehse and Anke Diemert and Felix Stahl and Petra Arck"
    }
    
    @article{b53edc510f6b45febd12ab5121cb9c09,
      title     = "Yersinia remodels epigenetic histone modifications in human macrophages",
      author    = "Indra Bekere and Jiabin Huang and Marie Schnapp and Maren Rudolph and Laura Berneking and Klaus Ruckdeschel and Adam Grundhoff and Thomas Günther and Nicole Fischer and Martin Aepfelbacher"
    }
    
    @article{66dbdc2fad114d628c8d295875ae8aec,
      title     = "Complete Genome Sequence of a SARS-CoV-2 Strain Isolated in Northern Germany",
      author    = "Susanne Pfefferle and Jiabin Huang and Dominik Nörz and Daniela Indenbirken and Marc Lütgehetmann and Lisa Oestereich and Thomas Günther and Adam Grundhoff and Martin Aepfelbacher and Nicole Fischer"
    }
    
    @article{7c73f3bcc9e94845a52a78194e3cf1d8,
      title     = "SARS Coronavirus-2 variant tracing within the first Coronavirus Disease 19 clusters in northern Germany",
      author    = "Susanne Pfefferle and Thomas Günther and Robin Kobbe and Manja Czech-Sioli and Dominic Nörz and René Santer and Jun Oh and Stefan Kluge and Lisa Oestereich and Kersten Peldschus and Daniela Indenbirken and Jiabin Huang and Adam Grundhoff and Martin Aepfelbacher and Johannes K. Knobloch and Marc Lütgehetmann and Nicole Fischer"
    }
    
    @article{cb56e81ed4fd48689aa6f91d5c5b4d5e,
      title     = "Changes in the composition of the upper respiratory tract microbial community in granulomatosis with polyangiitis",
      author    = "Peter Lamprecht and Nicole Fischer and Jiabin Huang and Lia Burkhardt and Marc Lütgehetmann and Fabian Arndt and Ida Rolfs and Anja Kerstein and Christof Iking-Konert and Martin Laudien"
    }
    
    @article{65d6baf2bd174db3826e0457f0613ef0,
      title     = "T-lymphocyte-specific knockout of IKK-2 or NEMO induces T17 cells in an experimental nephrotoxic nephritis mouse model",
      author    = "Linlin Guo and Jiabin Huang and Meilan Chen and Eveline Piotrowski and Ning Song and Gunther Zahner and Hans-Joachim Paust and Malik Alawi and Robert Geffers and Friedrich Thaiss"
    }
    
    @article{bcd9fc94dd6c4754bd285780a86d8e20,
      title     = "Emergence of ceftazidime/avibactam non-susceptibility in an MDR Klebsiella pneumoniae isolate",
      author    = "Anna Both and Henning Büttner and Jiabin Huang and Markus Perbandt and Cristina Belmar Campos and Martin Christner and Florian P. Maurer and Stefan Kluge and Christina König and Martin Aepfelbacher and Dominic Wichmann and Holger Rohde"
    }
    
    @article{3730964a0c4a41f58967b564e0c417bc,
      title     = "Autoimmune Renal Disease Is Exacerbated by S1P-Receptor-1-Dependent Intestinal Th17 Cell Migration to the Kidney",
      author    = "Christian F. Krebs and Hans-Joachim Paust and Sonja Krohn and Tobias Koyro and Silke R. Brix and Jan-Hendrik Riedel and Patricia Bartsch and Thorsten Wiech and Catherine Meyer-Schwesinger and Jiabin Huang and Nicole Fischer and Christoph Philipp Busch and Hans-Willi Mittrücker and Ulrich Steinhoff and Brigitta Stockinger and Laura Garcia Perez and Ulrich O. Wenzel and Matthias Janneck and Oliver M. Steinmetz and Nicola Gagliani and Rolf A. K. Stahl and Samuel Huber and Jan-Eric Turner and Ulf Panzer"
    }
    
    @article{d4c1b6c9a0e24abba33787715bc0854e,
      title     = "First report of Escherichia coli co-producing NDM-1 and OXA-232",
      author    = "Anna Both and Jiabin Huang and Martin Kaase and Julia Hezel and Daniel Wertheimer and Ines Fenner and Thomas Günther and Adam Grundhoff and Henning Büttner and Martin Aepfelbacher and Holger Rohde and Moritz Hentschke"
    }
    
    @article{1c9b5596739048cb871ab0c64d3c5cb8,
      title     = "Analysing RNA-kinetics based on folding space abstraction",
      author    = "Jiabin Huang and Björn Voß"
    }
    
    @book{694490818fa14f23bb737e07c6b4791f,
      title     = "RNA folding space analysis using structure abstraction",
      author    = "Jiabin Huang"
    }
    
    @article{eb70223e307f4b059e560298ccd944ce,
      title     = "Abstract folding space analysis based on helices",
      author    = "Jiabin Huang and Rolf Backofen and Björn Voß"
    }
    
    @inbook{fd3c3deb16cf43bb9ed22c13a0dac284,
      title     = "RNAHeliCes -- Folding space analysis based on position aware structure abstraction",
      author    = "Jiabin Huang and Björn Voß"
    }

Phyloseq for GPA vs RA vs control

http://xgenes.com/course/phyloseq2/

---
title: "Phyloseq microbiome"
author: ""
date: '`r format(Sys.time(), "%d %m %Y")`'
header-includes:
- \usepackage{color, fancyvrb}
output:
rmdformats::readthedown:
    highlight: kate
    number_sections : yes
pdf_document:
    toc: yes
    toc_depth: 2
    number_sections : yes
---
```{r, echo=FALSE, warning=FALSE}
## Global options
# IMPORTANT NOTE: needs before "mkdir figures"
# gunzip table_mc1300.biom.gz
#rmarkdown::render('Phyloseq.Rmd',output_file='Phyloseq.html')
#tmp/course/scripts.html, tmp/course/Phyloseq_GPA_RA.html, crs/urls
```

```{r load-packages, include=FALSE}
library(knitr)
library(rmdformats)
library(readxl)
library(dplyr)
library(kableExtra)
options(max.print="75")
knitr::opts_chunk$set(fig.width=8,
                    fig.height=6,
                    eval=TRUE,
                    cache=TRUE,
                    echo=TRUE,
                    prompt=FALSE,
                    tidy=TRUE,
                    comment=NA,
                    message=FALSE,
                    warning=FALSE)
opts_knit$set(width=85)
```

# Data
Import raw data and assign sample key:
```{r, echo=TRUE, warning=FALSE}
map_corrected <- read.csv("../map_corrected.txt", sep="\t", row.names=1)
knitr::kable(map_corrected) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
```
# Prerequisites to be installed
* R : https://pbil.univ-lyon1.fr/CRAN/
* R studio : https://www.rstudio.com/products/rstudio/download/#download
```R
install.packages("dplyr")     # To manipulate dataframes
install.packages("readxl")    # To read Excel files into R
install.packages("ggplot2")   # for high quality graphics
install.packages("heatmaply")
source("https://bioconductor.org/biocLite.R")
biocLite("phyloseq")
```
```{r libraries, echo=TRUE, message=FALSE}
library("readxl") # necessary to import the data from Excel file
library("ggplot2") # graphics
library("picante")
library("microbiome") # data analysis and visualisation
library("phyloseq") # also the basis of data object. Data analysis and visualisation
library("ggpubr") # publication quality figures, based on ggplot2
library("dplyr") # data handling, filter and reformat data frames
library("RColorBrewer") # nice color options
library("heatmaply")
library(vegan)
library(gplots)
```
# Read the data and create phyloseq objects
Three tables are needed
* OTU
* Taxonomy
* Samples
```{r, echo=TRUE, warning=FALSE}
    #Change your working directory to where the files are located
    ps.ng.tax <- import_biom("./table_mc1300.biom", "../clustering/rep_set.tre")
    sample <- read.csv("../map_corrected.txt", sep="\t", row.names=1)
    SAM = sample_data(sample, errorIfNULL = T)
    #rownames(SAM) <-
    #c("1","2","3","5","6","7","8","9","10","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","46","47","48","49","50","51","52","53","55")
    ps.ng.tax <- merge_phyloseq(ps.ng.tax, SAM)
    print(ps.ng.tax)
    colnames(tax_table(ps.ng.tax)) <- c("Domain","Phylum","Class","Order","Family","Genus","Species")
    saveRDS(ps.ng.tax, "./ps.ng.tax.rds")
```
Visualize data
```{r, echo=TRUE, warning=FALSE}
sample_names(ps.ng.tax)
rank_names(ps.ng.tax)
sample_variables(ps.ng.tax)
```
Normalize number of reads in each sample using median sequencing depth.
```{r, echo=TRUE, warning=FALSE}
# RAREFACTION
#set.seed(9242)  # This will help in reproducing the filtering and nomalisation.
#ps.ng.tax <- rarefy_even_depth(ps.ng.tax, sample.size = 42369)
#total <- 42369
# NORMALIZE number of reads in each sample using median sequencing depth.
total = median(sample_sums(ps.ng.tax))
#> total
#[1] 42369
standf = function(x, t=total) round(t * (x / sum(x)))
ps.ng.tax = transform_sample_counts(ps.ng.tax, standf)
ps.ng.tax_rel <- microbiome::transform(ps.ng.tax, "compositional")
saveRDS(ps.ng.tax, "./ps.ng.tax.rds")
hmp.meta <- meta(ps.ng.tax)
hmp.meta$sam_name <- rownames(hmp.meta)
```
# Heatmaps
We consider the most abundant OTUs for heatmaps. For example one can only take OTUs that represent at least 1% of reads in at least one sample. Remember we normalized all the sampples to median number of reads (total).  We are left with only 168 OTUS which makes the reading much more easy.
```{r, echo=TRUE, warning=FALSE}
# Custom function to plot a heatmap with the specified sample order
ps.ng.tax_abund <- phyloseq::filter_taxa(ps.ng.tax, function(x) sum(x > total*0.01) > 0, TRUE)
kable(otu_table(ps.ng.tax_abund)) %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
# Calculate the relative abundance for each sample
ps.ng.tax_abund_rel <- transform_sample_counts(ps.ng.tax_abund, function(x) x / sum(x))
datamat_ = as.data.frame(otu_table(ps.ng.tax_abund))
#datamat <- datamat_[c("8","9","10","12","13","14",    "21","22","23","24","25","26","27","28",    "33","34","35","36","37","38","39","51",    "47","48","49","50","52","53","55")]
#--take all columns--
datamat <- datamat_
hr <- hclust(as.dist(1-cor(t(datamat), method="pearson")), method="complete")
hc <- hclust(as.dist(1-cor(datamat, method="spearman")), method="complete")
mycl = cutree(hr, h=max(hr$height)/1.08)
mycol = c("YELLOW", "DARKBLUE", "DARKORANGE", "DARKMAGENTA", "DARKCYAN", "DARKRED",  "MAROON", "DARKGREEN", "LIGHTBLUE", "PINK", "MAGENTA", "LIGHTCYAN","LIGHTGREEN", "BLUE", "ORANGE", "CYAN", "RED", "GREEN");
mycol = mycol[as.vector(mycl)]
sampleCols <- rep('GREY',ncol(datamat))
#Colors: '#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#cab2d6', '#6a3d9a'
#Control (19)
sampleCols[colnames(datamat)=='kg001'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg002'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg003'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg004'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg005'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg007'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg009'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg015'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg016'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg019'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg020'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg021'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg022'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg023'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg025'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg026'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg027'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg028'] <- '#1f78b4'
sampleCols[colnames(datamat)=='kg029'] <- '#1f78b4'
#GPA (21)
sampleCols[colnames(datamat)=='micro1'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro3'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro4'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro6'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro7'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro12'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro13'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro16'] <- '#33a02c'
sampleCols[colnames(datamat)=='micro17'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw001'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw004'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw005'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw006'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw007'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw009'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw010'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw013'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw014'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw015'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw017'] <- '#33a02c'
sampleCols[colnames(datamat)=='mw021'] <- '#33a02c'
# RA (20)
sampleCols[colnames(datamat)=='ra002'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra003'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra004'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra005'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra006'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra007'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra008'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra009'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra010'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra013'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra014'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra015'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra017'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra018'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra019'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra020'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra022'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra023'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra024'] <- '#e31a1c'
sampleCols[colnames(datamat)=='ra025'] <- '#e31a1c'

library(RColorBrewer)
custom_palette <- colorRampPalette(brewer.pal(9, "Blues"))
heatmap_colors <- custom_palette(100)
png("figures/heatmap.png", width=1200, height=2400)
heatmap.2(as.matrix(datamat),Rowv=as.dendrogram(hr),Colv = NA, dendrogram = 'row',
            scale='row',trace='none',col=heatmap_colors, cexRow=1.2, cexCol=1.5,
            RowSideColors = mycol, ColSideColors = sampleCols, srtCol=15, labRow=row.names(datamat), key=TRUE, margins=c(10, 15), lhei=c(0.7, 15), lwid=c(1,8))
dev.off()
```

```{r, echo=TRUE, warning=FALSE, fig.cap="Heatmap", out.width = '100%', fig.align= "center"}
knitr::include_graphics("./figures/heatmap.png")
```

\pagebreak
# Taxonomic summary
## Bar plots in phylum level
```{r, echo=TRUE, warning=FALSE}
library(ggplot2)
geom.text.size = 6
theme.size = 8 #(14/5) * geom.text.size
ps.ng.tax_most = phyloseq::filter_taxa(ps.ng.tax_rel, function(x) mean(x) > 0.001, TRUE)
ps.ng.tax_most_ = transform_sample_counts(ps.ng.tax_most, function(x) x / sum(x))
```

```{r, echo=FALSE, warning=FALSE}
##--Creating 100% stacked bar plots with less abundant taxa in a sub-category #901--
##https://github.com/joey711/phyloseq/issues/901
##ps.ng.tax_most_df <- psmelt(ps.ng.tax_most_)  #5986x19
#glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Phylum')
#tax_table(glom) # should list # taxa as # phyla
#data <- psmelt(glom) # create dataframe from phyloseq object
#data$Phylum <- as.character(data$Phylum) #convert to character
##simple way to rename phyla with < 1% abundance
#data$Phylum[data$Abundance < 0.001] <- "< 0.1% abund."
#
#library(plyr)
#medians <- ddply(data, ~Phylum, function(x) c(median=median(x$Abundance)))
#remainder <- medians[medians$median <= 0.001,]$Phylum
#data[data$Phylum %in% remainder,]$Phylum <- "Phyla < 0.1% abund."
#data$Phylum[data$Abundance < 0.001] <- "Phyla < 0.1% abund."
##--> data are not used!
#
##in class level
#glom <- tax_glom(ps.ng.tax_most_, taxrank = 'Class')
#tax_table(glom) # should list # taxa as # phyla
#data <- psmelt(glom) # create dataframe from phyloseq object
#data$Class <- as.character(data$Class) #convert to character
#
##simple way to rename phyla with < 1% abundance
#data$Class[data$Abundance < 0.001] <- "< 0.1% abund."
#Count = length(unique(data$Class))
#
##unique(data$Class)
##data$Class <- factor(data$Class, levels = c("Bacilli", "Bacteroidia", "Verrucomicrobiae", "Clostridia", "Gammaproteobacteria", "Alphaproteobacteria", "Actinobacteria", "Negativicutes", "Erysipelotrichia", "Methanobacteria", "< 0.1% abund."))
##------- Creating 100% stacked bar plots END --------
library(stringr)
#FITTING_1:

#ps.ng.tax_most_
#OTU Table:          [63 taxa and 60 samples]
# tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2]
# ... ...
# tax_table(ps.ng.tax_most_)[63,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[167,"Species"], "__")[[1]][2]
#for id in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63; do
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Domain\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Domain\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Phylum\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Phylum\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Class\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Class\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Order\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Order\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Family\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Family\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Genus\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Genus\"], \"__\")[[1]][2]"
#  echo "tax_table(ps.ng.tax_most_)[${id},\"Species\"] <- str_split(tax_table(ps.ng.tax_most_)[${id},\"Species\"], \"__\")[[1]][2]"
#done

tax_table(ps.ng.tax_most_)[1,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[1,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[1,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[2,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[2,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[3,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[3,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[4,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[4,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[5,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[5,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[6,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[6,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[7,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[7,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[8,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[8,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[9,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[9,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[10,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[10,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[11,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[11,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[12,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[12,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[13,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[13,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[14,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[14,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[15,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[15,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[16,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[16,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[17,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[17,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[18,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[18,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[19,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[19,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[20,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[20,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[21,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[21,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[22,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[22,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[23,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[23,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[24,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[24,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[25,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[25,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[26,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[26,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[27,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[27,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[28,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[28,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[29,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[29,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[30,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[30,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[31,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[31,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[32,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[32,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[33,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[33,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[34,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[34,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[35,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[35,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[36,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[36,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[37,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[37,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[38,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[38,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[39,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[39,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[40,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[40,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[41,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[41,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[42,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[42,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[43,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[43,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[44,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[44,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[45,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[45,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[46,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[46,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[47,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[47,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[48,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[48,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[49,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[49,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[50,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[50,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[51,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[51,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[52,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[52,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[53,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[53,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[54,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[54,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[55,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[55,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[56,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[56,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[57,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[57,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[58,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[58,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[59,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[59,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[60,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[60,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[61,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[61,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[62,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[62,"Species"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Domain"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Phylum"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Class"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Order"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Family"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Genus"], "__")[[1]][2]
tax_table(ps.ng.tax_most_)[63,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[63,"Species"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Domain"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Domain"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Phylum"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Phylum"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Class"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Class"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Order"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Order"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Family"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Family"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Genus"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Genus"], "__")[[1]][2]
#tax_table(ps.ng.tax_most_)[64,"Species"] <- str_split(tax_table(ps.ng.tax_most_)[64,"Species"], "__")[[1]][2]
```

```{r, echo=TRUE, warning=FALSE}
plot_bar(ps.ng.tax_most_, fill="Phylum") + geom_bar(aes(), stat="identity", position="stack") +
scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=2))

ps.ng.tax_most_copied <- data.table::copy(ps.ng.tax_most_)
```

## Bar plots in class level
```{r, echo=TRUE, warning=FALSE}
plot_bar(ps.ng.tax_most_copied, fill="Class") + geom_bar(aes(), stat="identity", position="stack") +
scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=3))
```

## Bar plots in order level
```{r, echo=TRUE, warning=FALSE}
plot_bar(ps.ng.tax_most_copied, fill="Order") + geom_bar(aes(), stat="identity", position="stack") +
scale_fill_manual(values = c("darkblue", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "lightskyblue", "darkgreen", "deeppink", "khaki2", "firebrick", "brown1", "darkorange1", "cyan1", "royalblue4", "darksalmon", "darkblue","royalblue4", "dodgerblue3", "steelblue1", "lightskyblue", "darkseagreen", "darkgoldenrod1", "darkseagreen", "darkorchid", "darkolivegreen1", "brown1", "darkorange1", "cyan1", "darkgrey")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=4))
```

## Bar plots in family level
```{r, echo=TRUE, warning=FALSE}
plot_bar(ps.ng.tax_most_copied, fill="Family") + geom_bar(aes(), stat="identity", position="stack") +
scale_fill_manual(values = c("#FF0000", "#000000", "#0000FF", "#C0C0C0", "#FFFFFF", "#FFFF00", "#00FFFF", "#FFA500", "#00FF00", "#808080", "#FF00FF", "#800080", "#FDD017", "#0000A0", "#3BB9FF", "#008000", "#800000", "#ADD8E6", "#F778A1", "#800517", "#736F6E", "#F52887", "#C11B17", "#5CB3FF", "#A52A2A", "#FF8040", "#2B60DE", "#736AFF", "#1589FF", "#98AFC7", "#8D38C9", "#307D7E", "#F6358A", "#151B54", "#6D7B8D", "#FDEEF4", "#FF0080", "#F88017", "#2554C7", "#FFF8C6", "#D4A017", "#306EFF", "#151B8D", "#9E7BFF", "#EAC117", "#E0FFFF", "#15317E", "#6C2DC7", "#FBB917", "#FCDFFF", "#15317E", "#254117", "#FAAFBE", "#357EC7")) + theme(axis.text = element_text(size = 5, colour="black")) + theme(legend.position="bottom") + guides(fill=guide_legend(nrow=8))
```

\pagebreak
# Alpha diversity
Plot Chao1 richness estimator, Observed OTUs, Shannon index, and Phylogenetic diversity.
Regroup together samples from the same group.
```{r, echo=FALSE, warning=FALSE}
# using rarefied data
#FITTING_2 (under CONSOLE):
#gunzip table_even4753.biom.gz
#alpha_diversity.py -i table_even42369.biom --metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering/rep_set.tre
#alpha_diversity.py -i table_mc1300.biom --metrics chao1,observed_otus,shannon,PD_whole_tree -o adiv_even.txt -t ../clustering/rep_set.tre
```

```{r, echo=TRUE, warning=FALSE}
hmp.div_qiime <- read.csv("adiv_even.txt", sep="\t")
colnames(hmp.div_qiime) <- c("sam_name", "chao1", "observed_otus", "shannon", "PD_whole_tree")
row.names(hmp.div_qiime) <- hmp.div_qiime$sam_name
div.df <- merge(hmp.div_qiime, hmp.meta, by = "sam_name")
div.df2 <- div.df[, c("SampleType", "chao1", "shannon", "observed_otus", "PD_whole_tree")]
colnames(div.df2) <- c("Group", "Chao-1", "Shannon", "OTU", "Phylogenetic Diversity")
options(max.print=999999)
knitr::kable(div.df2) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
#https://uc-r.github.io/t_test
#We can perform the test with t.test and transform our data and we can also perform the nonparametric test with the wilcox.test function.
stat.test.Shannon <- compare_means(
Shannon ~ Group, data = div.df2,
method = "t.test"
)
knitr::kable(stat.test.Shannon) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
div_df_melt <- reshape2::melt(div.df2)
#head(div_df_melt)
#https://plot.ly/r/box-plots/#horizontal-boxplot
#http://www.sthda.com/english/wiki/print.php?id=177
#https://rpkgs.datanovia.com/ggpubr/reference/as_ggplot.html
#http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/82-ggplot2-easy-way-to-change-graphical-parameters/
#https://plot.ly/r/box-plots/#horizontal-boxplot
#library("gridExtra")
#par(mfrow=c(4,1))
p <- ggboxplot(div_df_melt, x = "Group", y = "value",
            facet.by = "variable",
            scales = "free",
            width = 0.5,
            fill = "gray", legend= "right")
#ggpar(p, xlab = FALSE, ylab = FALSE)

lev <- levels(factor(div_df_melt$Group)) # get the variables
#Using my_stat_compare_means (see https://stackoverflow.com/questions/47839988/indicating-significance-with-ggplot2-in-a-boxplot-with-multiple-groups)
L.pairs <- combn(seq_along(lev), 2, simplify = FALSE, FUN = function(i) lev[i]) #%>% filter(p.signif != "ns")
my_stat_compare_means  <- function (mapping = NULL, data = NULL, method = NULL, paired = FALSE,
    method.args = list(), ref.group = NULL, comparisons = NULL,
    hide.ns = FALSE, label.sep = ", ", label = NULL, label.x.npc = "left",
    label.y.npc = "top", label.x = NULL, label.y = NULL, tip.length = 0.03,
    symnum.args = list(), geom = "text", position = "identity",
    na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
{
    if (!is.null(comparisons)) {
        method.info <- ggpubr:::.method_info(method)
        method <- method.info$method
        method.args <- ggpubr:::.add_item(method.args, paired = paired)
        if (method == "wilcox.test")
            method.args$exact <- FALSE
        pms <- list(...)
        size <- ifelse(is.null(pms$size), 0.3, pms$size)
        color <- ifelse(is.null(pms$color), "black", pms$color)
        map_signif_level <- FALSE
        if (is.null(label))
            label <- "p.format"
        if (ggpubr:::.is_p.signif_in_mapping(mapping) | (label %in% "p.signif")) {
            if (ggpubr:::.is_empty(symnum.args)) {
                map_signif_level <- c(`****` = 1e-04, `***` = 0.001,
                `**` = 0.01, `*` = 0.05, ns = 1)
            } else {
            map_signif_level <- symnum.args
            }
            if (hide.ns)
                names(map_signif_level)[5] <- " "
        }
        step_increase <- ifelse(is.null(label.y), 0.12, 0)
        ggsignif::geom_signif(comparisons = comparisons, y_position = label.y,
            test = method, test.args = method.args, step_increase = step_increase,
            size = size, color = color, map_signif_level = map_signif_level,
            tip_length = tip.length, data = data)
    } else {
        mapping <- ggpubr:::.update_mapping(mapping, label)
        layer(stat = StatCompareMeans, data = data, mapping = mapping,
            geom = geom, position = position, show.legend = show.legend,
            inherit.aes = inherit.aes, params = list(label.x.npc = label.x.npc,
                label.y.npc = label.y.npc, label.x = label.x,
                label.y = label.y, label.sep = label.sep, method = method,
                method.args = method.args, paired = paired, ref.group = ref.group,
                symnum.args = symnum.args, hide.ns = hide.ns,
                na.rm = na.rm, ...))
    }
}

#FITTING_3: #> Using lev ("control", "GPA", "RA") for definition of the following comparisons.
  #comparisons = L.pairs,
  #symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05), symbols = c("****", "***", "**", "*")),
p3 <- p +
stat_compare_means(
  method="t.test",
  comparisons = list(c("GPA", "control"), c("RA", "control"), c("GPA", "RA")),
  label = "p.signif",
  symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns"))
)
#stat_pvalue_manual
#print(p2)
#https://stackoverflow.com/questions/20500706/saving-multiple-ggplots-from-ls-into-one-and-separate-files-in-r
#FITTING_4: mkdir figures
ggsave("./figures/alpha_diversity_SampleType.png", device="png", height = 10, width = 12)
ggsave("./figures/alpha_diversity_SampleType.svg", device="svg", height = 10, width = 12)
```

# Selected alpha diversity
```{r, echo=TRUE, warning=FALSE, fig.cap="Alpha diversity", out.width = '100%', fig.align= "center"}
knitr::include_graphics("./figures/alpha_diversity_SampleType.png")
#FITTING_5: Preparing the file selected_alpha_diversities.txt
#selected_alpha_diversities<-read.csv("selected_alpha_diversities.txt",sep="\t")
#knitr::kable(selected_alpha_diversities) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
```

# Beta diversity (weighted_unifrac)
```{r, echo=TRUE, warning=FALSE, fig.cap="Beta diversity", out.width = '100%', fig.align= "center"}
# The tests of significance were performed using a two-sided Student's two-sample t-test.
# Alternative hypothesis: Group 1 mean != Group 2 mean
# The nonparametric p-values were calculated using 999 Monte Carlo permutations.
# The nonparametric p-values contain the correct number of significant digits.
# Entries marked with "N/A" could not be calculated because at least one of the groups
# of distances was empty, both groups each contained only a single distance, or
# the test could not be performed (e.g. no variance in groups with the same mean).
# PREPARING_FILES: cp bdiv_even1300_SampleType/weighted_unifrac_boxplots/SampleType_Stats.txt bdiv_even1300_SampleType/weighted_unifrac_boxplots/SampleType_Stats_.txt and delete all headers, add # before "Group 1".
#                  cp bdiv_even1300_SampleType/unweighted_unifrac_boxplots/SampleType_Stats.txt bdiv_even1300_SampleType/unweighted_unifrac_boxplots/SampleType_Stats_.txt and delete all headers, add # before "Group 1".
#file:///home/jhuang/DATA/Data_Marius_16S/core_diversity_e42369/bdiv_even42369_Group/unweighted_unifrac_boxplots/Group_Stats.txt
weighted_unifrac_stats<-read.csv(file="bdiv_even1300_SampleType/weighted_unifrac_boxplots/SampleType_Stats_.txt", sep="\t")
knitr::kable(weighted_unifrac_stats) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
#BUG:How to generate the plot?  knitr::include_graphics("./figures/PCoA_weighted_unifrac.png")
```

# Beta diversity (unweighted_unifrac)
```{r, echo=TRUE, warning=FALSE, fig.cap="Beta diversity", out.width = '100%', fig.align= "center"}
#file:///home/jhuang/DATA/Data_Marius_16S/core_diversity_e42369/bdiv_even42369_Group/unweighted_unifrac_boxplots/Group_Stats.txt
unweighted_unifrac_stats<-read.csv(file="bdiv_even1300_SampleType/unweighted_unifrac_boxplots/SampleType_Stats_.txt", sep="\t")
knitr::kable(unweighted_unifrac_stats) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
#BUG:How to generate the plot?  knitr::include_graphics("./figures/PCoA_unweighted_unifrac.png")
```

# Differential abundance analysis
Differential abundance analysis aims to find the differences in the abundance of each taxa between two groups of samples, assigning a significance value to each comparison.
## GPA vs control
```{r, echo=TRUE, warning=FALSE}
library("DESeq2")
#ALTERNATIVE using ps.ng.tax_most_copied: ps.ng.tax (40594) vs. ps.ng.tax_most_copied (166)
ps.ng.tax_sel <- ps.ng.tax
#FITTING5: correct the id of the group members, see FITTING6
otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("micro1", "micro3", "micro4", "micro6", "micro7", "micro12", "micro13", "micro16", "micro17", "mw001", "mw004", "mw005", "mw006", "mw007", "mw009", "mw010", "mw013", "mw014", "mw015", "mw017", "mw021",    "kg001", "kg002", "kg003", "kg004", "kg005", "kg007", "kg009", "kg015", "kg016", "kg019", "kg020", "kg021", "kg022", "kg023", "kg025", "kg026", "kg027", "kg028", "kg029")]
diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~SampleType)
diagdds$SampleType <- relevel(diagdds$SampleType, "control")

## Filter out rows where all values are zero --> from 631 to 551
#keep <- rowSums(counts(diagdds) > 0) > 0 #
#diagdds <- diagdds[keep,]

# The poscounts method uses a modified geometric mean that excludes zero values from the calculation, which should prevent the error.
#counts(diagdds) <- as.matrix(round(counts(diagdds) + 1))
diagdds <- estimateSizeFactors(diagdds, type = "poscounts")
diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
resultsNames(diagdds)
res = results(diagdds, cooksCutoff = FALSE)
alpha = 0.05
sigtab = res[which(res$padj < alpha), ]
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
kable(sigtab) %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
#rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied))
write.xlsx(sigtab, file = "sigtab_GPA_vs_control.xlsx")
#subv %in% v
### returns a vector TRUE FALSE
#is.element(subv, v)
### returns a vector TRUE FALSE
library("ggplot2")
theme_set(theme_bw())
scale_fill_discrete <- function(palname = "Set1", ...) {
    scale_fill_brewer(palette = palname, ...)
}
x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
x = sort(x)
sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
x = sort(x)
sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
#Error in checkForExperimentalReplicates(object, modelMatrix) :
#  The design matrix has the same number of samples and coefficients to fit,
#  so estimation of dispersion is not possible. Treating samples
#  as replicates was deprecated in v1.20 and no longer supported since v1.22.
```

## RA vs control
```{r, echo=TRUE, warning=FALSE}
ps.ng.tax_sel <- ps.ng.tax
otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("ra002", "ra003", "ra004", "ra005", "ra006", "ra007", "ra008", "ra009", "ra010", "ra013", "ra014", "ra015", "ra017", "ra018", "ra019", "ra020", "ra022", "ra023", "ra024", "ra025",    "kg001", "kg002", "kg003", "kg004", "kg005", "kg007", "kg009", "kg015", "kg016", "kg019", "kg020", "kg021", "kg022", "kg023", "kg025", "kg026", "kg027", "kg028", "kg029")]
diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~SampleType)
diagdds$SampleType <- relevel(diagdds$SampleType, "control")
diagdds <- estimateSizeFactors(diagdds, type = "poscounts")
diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
resultsNames(diagdds)
res = results(diagdds, cooksCutoff = FALSE)
alpha = 2.0
sigtab = res[which(res$padj < alpha), ]
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
kable(sigtab) %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
library("ggplot2")
theme_set(theme_bw())
scale_fill_discrete <- function(palname = "Set1", ...) {
    scale_fill_brewer(palette = palname, ...)
}
x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
x = sort(x)
sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
x = sort(x)
sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
```

## GPA vs RA
```{r, echo=TRUE, warning=FALSE}
ps.ng.tax_sel <- ps.ng.tax
otu_table(ps.ng.tax_sel) <- otu_table(ps.ng.tax)[,c("micro1", "micro3", "micro4", "micro6", "micro7", "micro12", "micro13", "micro16", "micro17", "mw001", "mw004", "mw005", "mw006", "mw007", "mw009", "mw010", "mw013", "mw014", "mw015", "mw017", "mw021",    "ra002", "ra003", "ra004", "ra005", "ra006", "ra007", "ra008", "ra009", "ra010", "ra013", "ra014", "ra015", "ra017", "ra018", "ra019", "ra020", "ra022", "ra023", "ra024", "ra025")]
diagdds = phyloseq_to_deseq2(ps.ng.tax_sel, ~SampleType)
diagdds$SampleType <- relevel(diagdds$SampleType, "RA")
diagdds <- estimateSizeFactors(diagdds, type = "poscounts")
diagdds = DESeq(diagdds, test="Wald", fitType="parametric")
resultsNames(diagdds)
res = results(diagdds, cooksCutoff = FALSE)
alpha = 0.05
sigtab = res[which(res$padj < alpha), ]
sigtab = cbind(as(sigtab, "data.frame"), as(tax_table(ps.ng.tax_sel)[rownames(sigtab), ], "matrix"))
sigtab <- sigtab[rownames(sigtab) %in% rownames(tax_table(ps.ng.tax_most_copied)), ]
kable(sigtab) %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
library("ggplot2")
theme_set(theme_bw())
scale_fill_discrete <- function(palname = "Set1", ...) {
    scale_fill_brewer(palette = palname, ...)
}
x = tapply(sigtab$log2FoldChange, sigtab$Order, function(x) max(x))
x = sort(x)
sigtab$Order = factor(as.character(sigtab$Order), levels=names(x))
x = tapply(sigtab$log2FoldChange, sigtab$Family, function(x) max(x))
x = sort(x)
sigtab$Family = factor(as.character(sigtab$Family), levels=names(x))
ggplot(sigtab, aes(x=log2FoldChange, y=Family, color=Order)) + geom_point(aes(size=padj)) + scale_size_continuous(name="padj",range=c(8,4))+
theme(axis.text.x = element_text(angle = -25, hjust = 0, vjust=0.5))
```

Typing of S. epidermidis samples (HDMx samples)

SCCmec_HDMs

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2786320/

Classification of Staphylococcal Cassette Chromosome mec (SCCmec): Guidelines for Reporting Novel SCCmec Elements

mec gene complex.

IS1272 is part of the IS1182 family of insertion sequences

  • The mec gene complex is composed of mecA, its regulatory genes, and associated insertion sequences.
  • The class A mec gene complex (class A mec) is the prototype complex, which contains mecA, the complete mecR1 and mecI regulatory genes upstream of mecA, and the hypervariable region (HVR) and insertion sequence IS431 downstream of mecA.
    • The class B mec gene complex is composed of mecA, a truncated mecR1 resulting from the insertion of IS1272 upstream of mecA, and [HVR and IS431 downstream of mecA].
  • The class C mec gene complex contains mecA and truncated mecR1 by the insertion of IS431 upstream of mecA and HVR and IS431 downstream of mecA.
  • There are two distinct class C mec gene complexes; in the class C1 mec gene complex, the IS431 upstream of mecA has the same orientation as the IS431 downstream of mecA (next to HVR), while in the class C2 mec gene complex, the orientation of IS431 upstream of mecA is reversed.
  • C1 and C2 are regarded as different mec gene complexes since they have likely evolved independently.
  • The class D mec gene complex is composed of mecA and ΔmecR1 but does not carry an insertion sequence downstream of ΔmecR1 (as determined by PCR analysis).
  • Several variants within the major classes of the mec gene complex have been described, including insertions of IS431 or IS1182 upstream of mecA in the class A mec gene complex or insertion of Tn4001 upstream of mecA in the class B mec complex.
  1. run with bengal3

    cd ~/DATA/Data_Denise_CalCov1
    cp bacto-0.1.json ../Data_Denise_CalCov2
    cp cluster.json ../Data_Denise_CalCov2
    cp Snakefile ../Data_Denise_CalCov2
    ln -s /home/jhuang/Tools/bacto/local .
    ln -s /home/jhuang/Tools/bacto/db .
    ln -s /home/jhuang/Tools/bacto/envs .
    mkdir raw_data; cd raw_data
    ln -s ../Alignment_Imported_1/20240913_174420/Fastq/HDM7_S1_L001_R1_001.fastq.gz HDM7_R1.fastq.gz
    ln -s ../Alignment_Imported_1/20240913_174420/Fastq/HDM7_S1_L001_R2_001.fastq.gz HDM7_R2.fastq.gz
    ln -s ../Alignment_Imported_1/20240913_174420/Fastq/HDM10_S2_L001_R1_001.fastq.gz HDM10_R1.fastq.gz
    ln -s ../Alignment_Imported_1/20240913_174420/Fastq/HDM10_S2_L001_R2_001.fastq.gz HDM10_R2.fastq.gz
    
    ln -s ../20240812_FS10003086_50_BSB09416-2831/Alignment_Imported_1/20240813_202730/Fastq/HDM1_S1_L001_R1_001.fastq.gz HDM1_R1.fastq.gz
    ln -s ../20240812_FS10003086_50_BSB09416-2831/Alignment_Imported_1/20240813_202730/Fastq/HDM1_S1_L001_R2_001.fastq.gz HDM1_R2.fastq.gz
    ln -s ../20240913/Alignment_Imported_1/20240913_174420/Fastq/HDM7_S1_L001_R1_001.fastq.gz HDM7_R1.fastq.gz
    ln -s ../20240913/Alignment_Imported_1/20240913_174420/Fastq/HDM7_S1_L001_R2_001.fastq.gz HDM7_R2.fastq.gz
    ln -s ../20240913/Alignment_Imported_1/20240913_174420/Fastq/HDM10_S2_L001_R1_001.fastq.gz HDM10_R1.fastq.gz
    ln -s ../20240913/Alignment_Imported_1/20240913_174420/Fastq/HDM10_S2_L001_R2_001.fastq.gz HDM10_R2.fastq.gz
    ln -s ../20240919_FS10003086_61_BSB09416-2735/Alignment_Imported_1/20240920_173408/Fastq/HDM11-SF1_S1_L001_R1_001.fastq.gz HDM11-SF1_R1.fastq.gz
    ln -s ../20240919_FS10003086_61_BSB09416-2735/Alignment_Imported_1/20240920_173408/Fastq/HDM11-SF1_S1_L001_R2_001.fastq.gz HDM11-SF1_R2.fastq.gz
    ln -s ../20240919_FS10003086_61_BSB09416-2735/Alignment_Imported_1/20240920_173408/Fastq/HDM15-SF2_S2_L001_R1_001.fastq.gz HDM15-SF2_R1.fastq.gz
    ln -s ../20240919_FS10003086_61_BSB09416-2735/Alignment_Imported_1/20240920_173408/Fastq/HDM15-SF2_S2_L001_R2_001.fastq.gz HDM15-SF2_R2.fastq.gz
    
    # only activate the steps assembly and mlst in bacto-0.1.json.
    (bengal3_ac3) jhuang@WS-2290C:~/Documents$ /home/jhuang/miniconda3/envs/snakemake_4_3_1/bin/snakemake --printshellcmds
    
    # -- Results --
    shovill/HDM1/contigs.fa sepidermidis    5       arcC(1) aroE(1) gtr(1)  mutS(2) pyrR(2) tpiA(1) yqiL(1)
    HDM10.mlst.txt:shovill/HDM10/contigs.fa sepidermidis    59      arcC(2) aroE(1) gtr(1)  mutS(1) pyrR(2) tpiA(1) yqiL(1)
    HDM7.mlst.txt:shovill/HDM7/contigs.fa   sepidermidis    59      arcC(2) aroE(1) gtr(1)  mutS(1) pyrR(2) tpiA(1) yqiL(1)
  2. run with bakta

    #under env (bakta)
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
        bakta --db /mnt/nvme0n1p1/bakta_db shovill/${sample}/contigs.fa --prefix ${sample}
    done
  3. mapping on assembly to calculate the coverage

    #samtools depth input.bam > depth.txt
    #samtools depth input.bam | awk '{sum+=$3} END { print "Average coverage:",sum/NR}'
    #bedtools coverage -a regions.bed -b input.bam > coverage.txt
    #bedtools coverage -a regions.bed -b input.bam -d > coverage_per_base.txt
    
    bwa index ./shovill/HDM1/contigs.fa
    bwa mem ./shovill/HDM1/contigs.fa fastq/HDM1_1.fastq fastq/HDM1_2.fastq > aligned.sam
    samtools view -Sb aligned.sam > aligned.bam
    samtools sort aligned.bam -o sorted.bam
    samtools index sorted.bam
    samtools depth sorted.bam > depth.txt
    awk '{sum+=$3} END { print "Average coverage:",sum/NR}' depth.txt
    bedtools coverage -a regions.bed -b sorted.bam > coverage.txt
    bedtools genomecov -ibam sorted.bam -d > coverage_per_base.txt
    
    # Step 1: Calculate depth using samtools
    samtools depth sorted.bam > depth.txt
    # Step 2: Calculate average depth using awk
    awk '{sum+=$3; count++} END {print "Average Coverage:", sum/count}' depth.txt
    
    # Step 1: Calculate coverage with bedtools for a BED file
    #bedtools coverage -a regions.bed -b input.bam > coverage.txt
    # Step 2: Process the output with awk
    #awk '{ sum+=$7 } END { print "Average coverage depth:", sum/NR }' coverage.txt
    
    bwa index ./shovill/HDM7/contigs.fa
    bwa mem ./shovill/HDM7/contigs.fa fastq/HDM7_1.fastq fastq/HDM7_2.fastq > aligned_HDM7.sam
    samtools view -Sb aligned_HDM7.sam > aligned_HDM7.bam
    samtools sort aligned_HDM7.bam -o sorted_HDM7.bam
    samtools index sorted_HDM7.bam
    # Step 1: Calculate depth using samtools
    samtools depth sorted_HDM7.bam > depth_HDM7.txt
    # Step 2: Calculate average depth using awk
    awk '{sum+=$3; count++} END {print "Average Coverage:", sum/count}' depth_HDM7.txt
    #Average Coverage: 380.079
    
    bwa index ./shovill/HDM10/contigs.fa
    bwa mem ./shovill/HDM10/contigs.fa fastq/HDM10_1.fastq fastq/HDM10_2.fastq > aligned_HDM10.sam
    samtools view -Sb aligned_HDM10.sam > aligned_HDM10.bam
    samtools sort aligned_HDM10.bam -o sorted_HDM10.bam
    samtools index sorted_HDM10.bam
    # Step 1: Calculate depth using samtools
    samtools depth sorted_HDM10.bam > depth_HDM10.txt
    # Step 2: Calculate average depth using awk
    awk '{sum+=$3; count++} END {print "Average Coverage:", sum/count}' depth_HDM10.txt
    #Average Coverage: 254.704
  4. SCCmec typing and drawing with clinker

    #1. -- HDM1_contigs.fa --
    
    One SCCmec element detected.
    
    Prediction based on genes:
    Predicted SCCmec element: SCCmec_type_IV(2B)
    
    Prediction based on homology to whole cassette:
    Predicted whole cassette and %template coverage: SCCmec_type_IV(2B) 79.92%
    
    Predicted genes:
    Fasta header % Identity Query/HSP Length Contig Position in contig
    
    ccrA2:7:81108:AB096217  100.00  1350/1350   contig00032 3770..5119
    ccrB2:9:JCSC4469:AB097677   99.94   1650/1650   contig00032 5120..6769
    IS1272:3:AM292304   99.95   1844/1843   contig00032 8611..10454
    dmecR1:1:AB033763   100.00  987/987 contig00032 10443..11429
    mecA:12:AB505628    100.00  2010/2010   contig00032 11526..13535
    
    samtools faidx shovill/HDM1_contigs.fa
    samtools faidx shovill/HDM1_contigs.fa contig00032:1-13635 > HDM1_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM1_sub.fna
    
    #2. -- HDM7_contigs.fa --
    
    One SCCmec element detected.
    
    Prediction based on genes:
    Predicted SCCmec element: SCCmec_type_IVa(2B)
    
    Prediction based on homology to whole cassette:
    Predicted whole cassette and %template coverage: SCCmec_type_IVa(2B) 84.24%
    
    Predicted genes:
    Fasta header % Identity Query/HSP Length Contig Position in contig
    
    mecA:12:AB505628    100.00  2010/2010   contig00014 2800..4809
    dmecR1:1:AB033763   99.90   987/987 contig00014 4906..5892
    IS1272:3:AM292304   100.00  1843/1843   contig00014 5881..7723
    ccrB2:3:CA05:AB063172   100.00  1629/1629   contig00014 9565..11193
    ccrA2:3:CA05:AB063172   100.00  1350/1350   contig00014 11215..12564
    subtype-IVa(2B):1:CA05:AB063172 100.00  1491/1491   contig00014 16461..17951
    #IS1272:2:AB033763  91.06   1577/1585   contig00001 369260..370836
    
    samtools faidx shovill/HDM7_contigs.fa
    samtools faidx shovill/HDM7_contigs.fa contig00014:2700-18051 > HDM7_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM7_sub.fna
    
    mecA
    dmecR1
    Type I restriction enzyme HindI endonuclease subunit-like C-terminal domain-containing protein
    IS1272
    DUF1643 domain-containing protein
    Pyridoxal phosphate-dependent enzyme
    hypothetical protein
    ccrB2
    ccrA2
    DUF927 domain-containing protein
    hypothetical protein
    ACP synthase
    AAA family ATPase (= subtype-IVa(2B))
    
    #3. -- HDM10_contigs.fa --
    
    Prediction based on genes:
    Predicted SCCmec element: SCCmec_type_IV(2B&5)
    
    Prediction based on homology to whole cassette:
    Predicted whole cassette and % template coverage: SCCmec_type_IV(2B) 84.37%
    
    Predicted genes:
    
    Fasta header % Identity Query/HSP Length Contig Position in contig
    
    subtype-IVa(2B):1:CA05:AB063172 100.00  1491/1491   contig00020 4152..5642
    ccrA2:3:CA05:AB063172   100.00  1350/1350   contig00020 9539..10888
    ccrB2:3:CA05:AB063172   100.00  1629/1629   contig00020 10910..12538
    IS1272:3:AM292304   100.00  1843/1843   contig00020 14380..16222
    dmecR1:1:AB033763   100.00  987/987 contig00020 16211..17197
    mecA:12:AB505628    100.00  2010/2010   contig00020 17294..19303
    #IS1272:2:AB033763  90.75   1579/1585   contig00033 2..1580
    #ccrC1-allele-2:1:AB512767  90.95   1680/1680   contig00022 9836..11515
    
    samtools faidx shovill/HDM10_contigs.fa
    samtools faidx shovill/HDM10_contigs.fa contig00020:4052-19403 > HDM10_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM10_sub.fna
    
    #4. -- HDM11-SF1_contigs.fa --
    
    No SCCmec element was detected
    
    Prediction based on genes:
    Predicted SCCmec element: none
    
    Prediction based on homology to whole cassette:
    Predicted whole cassette and %template coverage: none
    
    #5. -- HDM15-SF2_contigs.fa --
    
    SCCmec_type_IV(2B)
    SCCmec_type_VI(4B)
    Following gene complexes based on prediction of genes was detected :
    ccr class 2
    ccr class 4
    mec class B
    
    Predicted genes:
    Fasta header % Identity Query/HSP Length Contig Position in contig
    
    ccrA2:7:81108:AB096217  100.00  1350/1350   contig00004 3823..5172
    ccrB2:9:JCSC4469:AB097677   99.94   1650/1650   contig00004 5173..6822
    IS1272:3:AM292304   99.95   1844/1843   contig00004 8664..10507
    dmecR1:1:AB033763   100.00  987/987 contig00004 10496..11482
    mecA:12:AB505628    100.00  2010/2010   contig00004 11579..13588
    
    subtyppe-Vc(5C2&5):10:AB505629  99.84   1935/1935   contig00004 20148..22082
    
    ccrA4:2:BK20781:FJ670542    90.53   1362/1362   contig00004 24570..25931
    ccrB4:2:BK20781:FJ670542    91.68   1635/1629   contig00004 25928..27562
    
    subtype-IVa(2B):1:CA05:AB063172 100.00  1491/1491   contig00015 52228..53718
    
    samtools faidx shovill/HDM7_contigs.fa
    samtools faidx shovill/HDM7_contigs.fa contig00014:2700-18051 > HDM7_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM7_sub.fna
    
    samtools faidx shovill/HDM10_contigs.fa
    samtools faidx shovill/HDM10_contigs.fa contig00020:4052-19403 > HDM10_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM10_sub.fna
    
    samtools faidx shovill/HDM15-SF2_contigs.fa
    samtools faidx shovill/HDM15-SF2_contigs.fa contig00004:1-27662 > HDM15-SF2_sub.fna
    samtools faidx shovill/HDM15-SF2_contigs.fa contig00015:52128-53818 >> HDM15-SF2_sub.fna
    bakta --db /mnt/nvme0n1p1/bakta_db HDM15-SF2_sub.fna
    
    #END
    #172.104.140.19
    
    mkdir gbff_sub
    mv *_sub.gbff gbff_sub
    cd gbff_sub
    for f in *_sub.gbff; do mv "$f" "${f/_sub.gbff/.gbff}"; done
    #mv HDM1_sub.gbff HDM1.gbff
    #mv HDM7_sub.gbff HDM7.gbff
    #mv HDM10_sub.gbff HDM10.gbff
    #mv HDM15-SF2_sub.gbff HDM15-SF2.gbff
    
    rm *.json
    clinker *.gbff -p plot_HDRNA.html --dont_set_origin -s session_HDRNA.json -o alignments_HDRNA.csv -dl "," -dc 4
    
    cp ./gbff_HDRNA_01/clinker.png HDRNA_01_clinker.png
  5. Arg typing

    grep "agrD" *.gbff | sort
    
    HDM1.gbff:                     /gene="agrD"
    HDM1.gbff:                     /gene="agrD"
    HDM7.gbff:                     /gene="agrD"
    HDM7.gbff:                     /gene="agrD"
    HDM10.gbff:                     /gene="agrD"
    HDM10.gbff:                     /gene="agrD"
    HDM11-SF1.gbff:                     /gene="agrD"
    HDM11-SF1.gbff:                     /gene="agrD"
    HDM15-SF2.gbff:                     /gene="agrD"
    HDM15-SF2.gbff:                     /gene="agrD"
    
    MNLLGGLLLKIFSNFMAVIGNASKYNPCSNYLDEPQVPEELTKLDE
    MENIFNLFIKFFTTILEFIGTVAGDSVCASYFDEPEVPEELTKLYE
    MENIFNLFIKFFTTILEFIGTVAGDSVCASYFDEPEVPEELTKLYE
    MNLLGGLLLKIFSNFMAVIGNASKYNPCSNYLDEPQVPEELTKLDE
    MNLLGGLLLKIFSNFMAVIGNASKYNPCSNYLDEPQVPEELTKLDE
    
    #* The agr typing is not defined, as I have compared the sequence with the amino acid sequences of ArgD described in the paper available at https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4187671/. It does not correspond to Type I, Type II, or Type III. (For more details, see below).
    
    -- AgrD I --
    Query  1       MENIFNLFIKFFTTILEFIGTVAGDSVCASYFDEPEVPEELTKLYE  46
            M  +  L +K F+  +  IG  +  + C  Y DEP+VPEELTKL E
    Sbjct  926825  MNLLGGLLLKIFSNFMAVIGNASKYNPCVMYLDEPQVPEELTKLDE  926688
    
    -- AgrD II --
    Query  1       MNLLGGLLLKIFSNFMAVIGNASKYNPCSNYLDEPQVPEELTKLDE  46
            MNLLGGLLLKIFSNFMAVIGNASKYNPC  YLDEPQVPEELTKLDE
    Sbjct  926825  MNLLGGLLLKIFSNFMAVIGNASKYNPCVMYLDEPQVPEELTKLDE  926688
    
    -- AgrD III --
    Query  1       MNLLGGLLLKLFSNFMAVIGNAAKYNPCASYLDEPQVPEELTKLDE  46
            MNLLGGLLLK+FSNFMAVIGNA+KYNPC  YLDEPQVPEELTKLDE
    Sbjct  926825  MNLLGGLLLKIFSNFMAVIGNASKYNPCVMYLDEPQVPEELTKLDE  926688
  6. calulate the presence-absence-matrix for predefined gene list

    #start codon: ATG, GTG und TTG
    #stop codon: 5'-UAA-3', 5'-UGA-3' und 5'-UAG-3' --> TAA, TGA, TAG
    
    ./Staphylococcus_aureus_MRSA252.fasta
    ./Staphylococcus_epidermidis_RP62A.fasta
    ./Enterococcus_faecium_isolate_E300_pathogenicity_island.fasta
    
    # -- Hause keeper: gyrB --
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":2609812-2611743 > gyrB.fasta
    #revcomp gyrB.fasta > gyrB_revcomp.fasta
    gyrB_revcomp.fasta
    
    # -- Metabolic genes: fumC, gltA, icd --
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1444326-1445711 > fumC.fasta
    #revcomp fumC.fasta > fumC_revcomp.fasta
    ./fumC_revcomp.fasta
    ./gltA.fasta
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1296195-1297463 > icd.fasta
    #revcomp icd.fasta > icd_revcomp.fasta
    icd_revcomp.fasta
    
    # -- Virulence regulartors: apsS, sigB, sarA, agrC, yycG --
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":316151-317191 > apsS.fasta
    apsS.fasta
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1722805-1723575 > sigB.fasta
    #revcomp sigB.fasta > sigB_revcomp.fasta
    sigB_revcomp.fasta
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":279424-279798 > sarA.fasta
    #revcomp sarA.fasta > sarA_revcomp.fasta
    sarA_revcomp.fasta
    ./agrC.fasta
    ./yycG.fasta
    
    # -- Toxins: psmβ1, hlb --
    ./psm-beta.fasta
    #psm-beta1.fasta
    ./hlb_.fasta
    #./hlb.fasta
    
    # -- Biofilm formation: atlE, sdrG, sdrH, ebh, ebp, tagB --
    ./atlE.fasta
    ./sdrG.fasta
    
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1555024-1556469 > sdrH.fasta
    #revcomp sdrH.fasta > sdrH_revcomp.fasta
    sdrH_revcomp.fasta
    
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1023531-1053980 > ebh.fasta
    #revcomp ebh.fasta > ebh_revcomp.fasta
    ebh_revcomp.fasta
    
    #https://www.ncbi.nlm.nih.gov/gene/?term=(Elastin-binding+protein)+AND+%22Staphylococcus+aureus%22%5Bporgn%3A__txid1282%5D
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":1094204-1095586 > ebpS.fasta
    #revcomp ebpS.fasta > ebpS_revcomp.fasta
    ebpS_revcomp.fasta
    ./tagB.fasta
    
    # -- Immune evasion & colonization: capC, sepA, dltA, fmtC, lipA, sceD, SE0760 --
    
    ./capC.fasta
    #./capBCA_ywtC.fasta
    ./sepA.fasta
    #./ORF123_sepA_ORF5.fasta
    
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":503173-504630 > dltA.fasta
    dltA.fasta
    ./fmtC.fasta
    #samtools faidx Staphylococcus_epidermidis_RP62A.fasta "gi|57865352|ref|NC_002976.3|":498445-499359 > lipA.fasta
    lipA.fasta
    ./sceD.fasta
    #./sceDAE.fasta
    ./SE0760.fasta
    
    # -- Serine protease: esp, ecpA --
    ./esp.fasta
    ./ecpA_.fasta
    #./ecpA.fasta
    
    # -- Phage: PhiSepi-HH1, PI-Sepi-HH2, PhiSepi-HH3 (#HH1-HP1, HH3-HP2, HH3-TreR) --
    ./MT880870.fasta
    ./MT880871.fasta
    ./MT880872.fasta
    
    #Note that write a message to Holger, say "ebp gene does not exist, instead of it only ebpS gene exists!"
    
    makeblastdb -in HDM1_contigs.fa -dbtype nucl
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query gyrB_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > gyrB_on_${sample}.blastn
    done
    
    ./fumC_revcomp.fasta
    ./gltA.fasta
    icd_revcomp.fasta
    
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query fumC_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > fumC_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query gltA.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > gltA_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query icd_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > icd_on_${sample}.blastn
    done
    
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query apsS.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > apsS_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sigB_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sigB_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sarA_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sarA_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query agrC.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > agrC_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query yycG.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > yycG_on_${sample}.blastn
    done
    
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query psm-beta.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > psm-beta_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query psm-beta1.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > psm-beta1_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query hlb_.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > hlb_on_${sample}.blastn
    done
    
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query atlE.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > atlE_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sdrG.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sdrG_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sdrH_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sdrH_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query ebh_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ebh_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query ebpS_revcomp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ebpS_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query tagB.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > tagB_on_${sample}.blastn
    done
    
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query capC.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > capC_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sepA.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sepA_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query dltA.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > dltA_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query fmtC.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > fmtC_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query lipA.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > lipA_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query sceD.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > sceD_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query SE0760.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > SE0760_on_${sample}.blastn
    done
    
    # -- Serine protease: esp, ecpA --
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query esp.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ./esp_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query ecpA_.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ecpA_on_${sample}.blastn
    done
    
    # -- Phage: PhiSepi-HH1, PI-Sepi-HH2, PhiSepi-HH3 (#HH1-HP1, HH3-HP2, HH3-TreR) --
    #34053 (3000,2510) 36164 (500) 147057 (6618, 15237+3812, 15237+3812, 15233+3814, 15230+3812)
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query MT880870.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ./MT880870_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query MT880871.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > ./MT880871_on_${sample}.blastn
    done
    for sample in HDM1 HDM7 HDM10 HDM11-SF1 HDM15-SF2; do
      blastn -db ../shovill/${sample}_contigs.fa -query MT880872.fasta -evalue 1e-50 -num_threads 15 -outfmt 6 -strand both -max_target_seqs 1 > MT880872_on_${sample}.blastn
    done