Sample#
missionbio.mosaic.sample.Sample
- class Sample(name: Optional[str] = None, dna: Optional[Dna] = None, cnv: Optional[Cnv] = None, protein: Optional[Protein] = None, cnv_raw: Optional[Cnv] = None, protein_raw: Optional[Protein] = None, rna: Optional[Rna] = None, rna_raw: Optional[Rna] = None, vdj: Optional[Vdj] = None)#
Container for multiple assays.
Just like the
_Assayobject, Sample can also be filtered using Python’s slice notation.It accepts only one key - a list of barcodes, a list of the position of the barcodes, or a Boolean list.
Load the sample.
>>> import missionbio.mosaic.io as mio >>> sample = mio.load('/path/to/h5')
Selecting the first 100 cells (these aren’t necessarily cells with the highest reads, they’re arbitrary cells).
>>> select_bars = sample.dna.barcodes()[:100]
Slice all assays in the sample.
>>> filtered_sample = sample[select_bars]
Once the analysis is complete, it can be saved and shared using:
>>> mio.save(sample)
Functions#
assays([names])Assays present in the sample
reset([assay])Resets to the original state.
Raw reads present in the sample
rename(new_name[, old_name])Modifies the name of the sample.
Returns the union of the names of the samples present in the assays.
split([row])Split the sample by the given row attribute.
Multi-assay visualizations#
heatmap([clusterby, attributes, features, ...])Multi-assay heatmap.
signaturemap([clusterby, attributes, ...])Multi-assay flattened heatmap.
clone_vs_analyte([analyte, plot_width, ...])Set of summary plots to give a run overview.
umaps()Plots umap arrays from assay objects.
Raw count visualizations#
assay_scatter([ax, title, highlight])Plots DNA reads vs Protein reads.
Protein and DNA read distribution.
Plot read statistics of each barcode.