@_log<EOL><INDENT>def make_subset(self, samples=None, name=None):<DEDENT>
<EOL>for k, v in self.subsets.items():<EOL><INDENT>if set(v) == set(samples) and k != '<STR_LIT>':<EOL><INDENT>return k<EOL><DEDENT><DEDENT>if isinstance(samples, str):<EOL><INDENT>samples = [samples]<EOL><DEDENT>not_exists = [s for s in samples if s not in self.subsets['<STR_LIT>']]<EOL>if len(not_exists) > <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT:U+002CU+0020>'.join(not_exists) + '<STR_LIT>')<EOL><DEDENT>if name is None:<EOL><INDENT>name = max([-<NUM_LIT:1>] + [x for x in self.subsets.keys() if isinstance(x, int)]) + <NUM_LIT:1><EOL><DEDENT>self._subset_names.append(name)<EOL>if samples is not None:<EOL><INDENT>self.subsets[name] = samples<EOL>for s in samples:<EOL><INDENT>try:<EOL><INDENT>self.subsets['<STR_LIT>'].remove(s)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>self._has_subsets = True<EOL>return name<EOL>
Creates a subset of samples, which can be treated independently.

Parameters
----------
samples : str or array - like
    Name of sample, or list of sample names.
name : (optional) str or number
    The name of the sample group. Defaults to n + 1, where n is
    the highest existing group number