-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kraken2 -> Qiime a-diversity
137 lines (107 loc) · 4.63 KB
/
Kraken2 -> Qiime a-diversity
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
Qiime Taxonomic Analysis (after Kraken2)
# Create Alpha Diversity boxplots and metrics (genus level table)
## -------------------------------
## Step 1: Collapse overal freq table to genus level
## -------------------------------
qiime taxa collapse \
--i-table table.qza \
--i-taxonomy taxa.qza \
--p-level 7 \
--o-collapsed-table ovrerall_genus_table.qza
##--------------------------------
## Step 2: Summarize genus level frequency feature table
## -------------------------------
### Summarize feature table
qiime feature-table summarize \
--i-table ovrerall_genus_table.qza \
--o-visualization ovrerall_genus_table_summary
### Export summary and determine what sampling depth is to include all samples
qiime tools export \
--input-path ovrerall_genus_table_summary.qzv \
--output-path ovrerall_genus_table_summary
## -------------------------------
## Step 2: Calculate diversity metrics (no phylogenetic tree)
## -------------------------------
### Determine sampling depth from rarefaction curves/summary table
### Calculate diversity metrics (alpha + beta)
qiime diversity core-metrics \
--i-table ovrerall_genus_table.qza \
--p-sampling-depth 742170 \
--m-metadata-file sample-metadata_2.txt \
--output-dir core-metrics-results_genus
## -------------------------------
## Step 3: Test for relationships between a-diversity and metadata
## -------------------------------
### Change directory
### Evenness metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_genus/evenness_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_genus/evenness-group-significance.qzv
### Shannon metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_genus/shannon_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_genus/shannon_group-significance.qzv
### Observed OTUs metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_genus/observed_otus_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_genus/observed_otus_group-significance.qzv
## -------------------------------
## Step 3: Visualize in qiim2 viewer
## -------------------------------
### View boxplots by metadata
# Create Alpha Diversity boxplots and metrics (species level table)
## -------------------------------
## Step 1: Collapse overal freq table to species level
## -------------------------------
qiime taxa collapse \
--i-table table.qza \
--i-taxonomy taxa.qza \
--p-level 8 \
--o-collapsed-table ovrerall_species_table.qza
##--------------------------------
## Step 2: Summarize species level frequency feature table
## -------------------------------
### Summarize feature table
qiime feature-table summarize \
--i-table ovrerall_species_table.qza \
--o-visualization ovrerall_species_table_summary
### Export summary and determine what sampling depth is to include all samples
qiime tools export \
--input-path ovrerall_species_table_summary.qzv \
--output-path ovrerall_species_table_summary
## -------------------------------
## Step 3: Calculate diversity metrics (no phylogenetic tree)
## -------------------------------
### Determine sampling depth from rarefaction curves/summary table
### Calculate diversity metrics (alpha + beta)
qiime diversity core-metrics \
--i-table ovrerall_species_table.qza \
--p-sampling-depth 730300 \
--m-metadata-file sample-metadata_2.txt \
--output-dir core-metrics-results_species
## -------------------------------
## Step 3: Test for relationships between a-diversity and metadata
## -------------------------------
### Change directory
### Evenness metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_species/evenness_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_species/evenness-group-significance.qzv
### Shannon metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_species/shannon_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_species/shannon_group-significance.qzv
### Observed OTUs metric
qiime diversity alpha-group-significance \
--i-alpha-diversity core-metrics-results_species/observed_otus_vector.qza \
--m-metadata-file sample-metadata_2.txt \
--o-visualization core-metrics-results_species/observed_otus_group-significance.qzv
## -------------------------------
## Step 3: Visualize in qiim2 viewer
## -------------------------------
### View boxplots by metadata