Sample.split
Sample.split#
- Sample.split(row: Union[str, Sequence] = 'sample_name') List[missionbio.mosaic.sample.Sample] #
Split the sample by the given row attribute.
Certain visualizations are only available for SampleGroup objects. Since those visualizations are only applicable for multi-sample analysis. If those have to be created for a single sample assay, the following can be done.
>>> import missionbio.mosaic as ms >>> sample = ms.load_example_dataset("3 cell mix") >>> samples = sample.split("label") # List of 4 samples for each `label` >>> ms.SampleGroup(samples) Group of 4 samples
- Parameters
- row:
The row attribute by which to split. If a string is provided, the row attribute must be present in all the assays, and its value must be the same in all of them.
- Returns
- List:
samples for each unique value in the row attribute
- Raises
- KeyError:
If row attribute is not present in one of the assays
- ValueError:
If row attribute does not match across all assays