MGS relative abundance calculation
For each MGS, a signature gene set was defined as 100 genes optimized for accurate abundance profiling. An MGS count table was created by counting the number of reads mapped to MGS signature genes per sample. An MGS was considered to be detected if reads from a sample mapped to at least three of its signature genes; measurements that did not satisfy this criterion were set to zero. Such a threshold resulted in 99.6% specificity. The MGS count table was normalized according to the effective gene length, and then normalized sample-wise to a sum of 100%, resulting in relative abundance estimates for each MGS.Downsampled (rarefied) MGS abundance profiles were calculated by random sampling, without replacement, of a fixed number of signature gene counts per sample following the procedure described above. Samples that passed the initial QC and mapping were downsampled to 291,404 reads mapped to the signature genes.