Sample
Sample#
- class missionbio.mosaic.sample.Sample(name: Optional[str] = None, dna: Optional[missionbio.mosaic.dna.Dna] = None, cnv: Optional[missionbio.mosaic.cnv.Cnv] = None, protein: Optional[missionbio.mosaic.protein.Protein] = None, cnv_raw: Optional[missionbio.mosaic.cnv.Cnv] = None, protein_raw: Optional[missionbio.mosaic.protein.Protein] = None, rna: Optional[missionbio.mosaic.rna.Rna] = None, rna_raw: Optional[missionbio.mosaic.rna.Rna] = None)#
Container for multiple assays.
Just like the
missionbio.mosaic.assay._Assay
object, 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)
Methods
reset
([assay])Resets to the original state.
assays
()Assays present in the sample
Raw reads present in the sample
split
([row])Split the sample by the given row attribute.
Multi-assay visualizations
heatmap
(clusterby[, sortby, drop, flatten, ...])Multi-assay 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.