qiime2/q2-fmt

BUG: group_timepoints fails when using Beta Diversity with a single donor

lizgehret opened this issue · 1 comments

The following code within _engraftment.py needs to be modified to allow for single donor within the metadata and diversity measure:

# HELPER FUNCTION FOR GroupDists[Unordered, Independent]
def _independent_dists(diversity_measure, metadata,
                       used_references, is_beta, used_controls):
    unique_references = sorted(used_references.unique())

    if is_beta:
        try:
            ref_idx = pd.MultiIndex.from_tuples(
                itertools.combinations(unique_references, 2))
        except TypeError:
            raise TypeError('Single reference value detected. More than one'
                            ' unique reference must be provided for'
                            ' successful grouping.')

The approach we'll take is not producing rows for the reference group in the reference distribution. This may result in an empty table if there are also no controls.