等量抽样标准化
最后发布时间 : 2022-11-04 11:40:49
浏览量 :
Normlize by subsample
使用vegan包进行等量重抽样,输入reads count格式Feature表result/otutab.txt
可指定输入文件、抽样量和随机数,输出抽平表result/otutab_rare.txt和多样性alpha/vegan.txt
mkdir -p results/alpha
Rscript script/otutab_rare.R --input results/otutab.txt \
--depth 10000 --seed 1 \
--normalize results/otutab_rare.txt \
--output results/alpha/vegan.txt
otutab_rare.txt
#OTUID | KO1 | KO2 | KO3 | KO4 | KO5 | KO6 | OE1 | OE2 | OE3 | OE4 | OE5 | OE6 | WT1 | WT2 | WT3 | WT4 | WT5 | WT6 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ASV_1 | 330 | 536 | 214 | 322 | 277 | 323 | 418 | 518 | 430 | 317 | 410 | 320 | 632 | 660 | 489 | 519 | 411 | 406 |
ASV_2 | 584 | 334 | 658 | 598 | 727 | 503 | 210 | 152 | 360 | 379 | 285 | 217 | 361 | 413 | 220 | 311 | 399 | 341 |
ASV_3 | 191 | 139 | 282 | 230 | 320 | 255 | 189 | 135 | 322 | 319 | 258 | 214 | 259 | 507 | 298 | 332 | 320 | 226 |
ASV_4 | 458 | 105 | 140 | 193 | 343 | 144 | 178 | 171 | 117 | 173 | 173 | 115 | 291 | 357 | 157 | 151 | 306 | 232 |
ASV_8 | 167 | 156 | 155 | 107 | 51 | 77 | 117 | 165 | 458 | 257 | 176 | 170 | 176 | 214 | 167 | 279 | 141 | 149 |
ASV_6 | 258 | 190 | 240 | 240 | 380 | 301 | 77 | 82 | 100 | 127 | 109 | 125 | 141 | 154 | 132 | 145 | 125 | 129 |
vegan.txt
SampleID | richness | chao1 | ACE | shannon | simpson | invsimpson |
---|---|---|---|---|---|---|
KO1 | 1210 | 1439.9336492891 | 1433.18771126219 | 5.88030042614566 | 0.98975464 | 97.6051597991676 |
KO2 | 1198 | 1376.43913043478 | 1399.75229527834 | 5.95381577180023 | 0.99172944 | 120.910796850516 |
KO3 | 1051 | 1298.8578680203 | 1318.90880535978 | 5.61028156370725 | 0.98841646 | 86.3293949863341 |
KO4 | 1050 | 1274.95135135135 | 1267.60312612405 | 5.62923484359834 | 0.98911074 | 91.8336048546917 |
KO5 | 968 | 1152.71641791045 | 1191.25655835447 | 5.42149950885837 | 0.98560856 | 69.4857498624182 |
KO6 | 1118 | 1315.3125 | 1328.64990957236 | 5.80703938504695 | 0.99112052 | 112.619207431066 |
抽平前
usearch -otutab_stats results/otutab.txt \
-output results/otutab.stat
220951 Reads (221.0k)
18 Samples
1521 OTUs
27378 Counts
5170 Count =0 (18.9%)
4891 Count =1 (17.9%)
4017 Count >=10 (14.7%)
437 OTUs found in all samples (28.7%)
609 OTUs found in 90% of samples (40.0%)
1426 OTUs found in 50% of samples (93.8%)
Sample sizes: min 11028, lo 11646, med 12434, mean 12275.1, hi 12701, max 13786
抽平后
usearch -otutab_stats results/otutab_rare.txt \
-output results/otutab_rare.stat
180000 Reads (180.0k)
18 Samples
1521 OTUs
27378 Counts
6222 Count =0 (22.7%)
5415 Count =1 (19.8%)
3345 Count >=10 (12.2%)
360 OTUs found in all samples (23.7%)
515 OTUs found in 90% of samples (33.9%)
1386 OTUs found in 50% of samples (91.1%)
Sample sizes: min 10000, lo 10000, med 10000, mean 10000.0, hi 10000, max 10000