[docs]classChainRepertoireFilter(Filter):""" Removes all repertoires from the RepertoireDataset object which contain at least one sequence with chain different than "keep_chain" parameter. Note that this filter filters out repertoires, not individual sequences, and can thus only be applied to RepertoireDatasets. Since the filter removes repertoires from the dataset (examples in machine learning setting), it cannot be used with :ref:`TrainMLModel` instruction. If you want to filter out repertoires including a given chain, see :ref:`DatasetExport` instruction with preprocessing. **Specification arguments:** - keep_chain (str): Which chain should be kept, valid values are "TRA", "TRB", "IGH", "IGL", "IGK" **YAML specification:** .. indent with spaces .. code-block:: yaml preprocessing_sequences: my_preprocessing: - my_filter: ChainRepertoireFilter: keep_chain: TRB """def__init__(self,keep_chain,result_path:Path=None):super().__init__(result_path)self.keep_chain=Chain.get_chain(keep_chain)