def write_rarefy(qza: str, qza_out: str, depth: int) -> str:
    """
    Subsample frequencies from all samples so that the sum of frequencies in
    each sample is equal to sampling-depth.
    https://docs.qiime2.org/2019.10/plugins/available/feature-table/rarefy/

    :param qza: The feature table from which samples should be rarefied.
    :param qza_out: The resulting rarefied feature table in qza format.
    :param depth: The rarefaction depth.
    """
    cmd = 'qiime feature-table rarefy \\\n'
    cmd += '--i-table %s \\\n' % qza
    cmd += '--p-sampling-depth %s \\\n' % str(depth)
    cmd += '--o-rarefied-table %s\n' % qza_out
    return cmd