@experimental(as_of="0.4.0")
    def __init__(self, coords, prop_expl, metadata_map,
                 trajectory_categories=None, sort_category=None, axes=3,
                 weighted=False):
        if not trajectory_categories:
            # If trajectory_categories is not provided, use all the categories
            # present in the metadata map
            trajectory_categories = metadata_map.keys()
        else:
            # Check that trajectory_categories are in metadata_map
            for category in trajectory_categories:
                if category not in metadata_map:
                    raise ValueError("Category %s not present in metadata."
                                     % category)

        # Check that sort_categories is in metadata_map
        if sort_category and sort_category not in metadata_map:
            raise ValueError("Sort category %s not present in metadata."
                             % sort_category)

        if axes == 0:
            # If axes == 0, we should compute the trajectories for all axes
            axes = len(prop_expl)
        elif axes > len(prop_expl) or axes < 0:
            # Axes should be 0 <= axes <= len(prop_expl)
            raise ValueError("axes should be between 0 and the max number of "
                             "axes available (%d), found: %d "
                             % (len(prop_expl), axes))

        # Restrict coordinates to those axes that we actually need to compute
        self._coords = coords.ix[:, :axes-1]
        self._prop_expl = prop_expl[:axes]
        self._metadata_map = metadata_map
        self._weighted = weighted

        # Remove any samples from coords not present in mapping file
        # and remove any samples from metadata_map not present in coords
        self._normalize_samples()

        # Create groups
        self._make_groups(trajectory_categories, sort_category)

        # Compute the weighting_vector
        self._weighting_vector = None
        if weighted:
            if not sort_category:
                raise ValueError("You should provide a sort category if you "
                                 "want to weight the trajectories")
            try:
                self._weighting_vector = \
                    self._metadata_map[sort_category].astype(np.float64)
            except __HOLE__:
                raise ValueError("The sorting category must be numeric")

        # Initialize the message buffer
        self._message_buffer = []
dataset/ETHPy150Open biocore/scikit-bio/skbio/stats/gradient.py/GradientANOVA.__init__