Mosaic¶
A basic tutorial on how to use Mosaic to analyse DNA + Protein data can be found here.
Loading a sample¶
Any .h5 file can be loaded as a Sample
object using:
>>> import missionbio.mosaic.io as mio
>>> sample = mio.load('/path/to/h5')
>>> sample
<missionbio.mosaic.sample.Sample>
Once the analysis is complete, it can be saved using:
>>> mio.save(sample, '/path/to/save/h5')
Data structure¶
missionbio.h5.assay.Assay
(h5 reader and writer)
|
|
missionbio.mosaic.assay._Assay
(basic interactivity and plotting)
|
|
---------------------------
| | |
| | |
| | |
Dna Cnv Protein
(Sample-specific functionality, such as normalization)
missionbio.h5.assay.Assay
is a module for reading and writing .h5 files.
It stores the information of the assay using:
- metadata (add_metadata / del_metadata):
Dictionary containing the metrics of the assay.
- row_attrs (add_row_attr / del_row_attr):
Dictionary containing ‘barcode’ as one of the keys. All the values must be of the same length, i.e., match the number of barcodes. This is the attribute where ‘label’, ‘pca’, and ‘umap’ values are added.
- col_attrs (add_col_attr / del_col_attr)):
Dictionary containing ‘ids’ as one of the keys. All the values must be of the same length, i.e., match the number of ids. ‘ids’ contains variants for DNA assays and antibodies for Protein assays.
- layers (add_layer / del_layer):
Dictionary containing ‘read_counts’ as one of the metrics. All the values have the shape (num barcodes) x (num ids). This is the attribute where ‘normalized_counts’ will be added.
_Assay
builds on top of the h5 assay to incorporate
functionality specific to tertiary analysis. It also provides generic functions for
visualizing the data.
Dna
, Cnv
, and
Protein
are subclasses of the above class.
Therefore, they inherit all the plotting and interactive functionality from the
_Assay
class. Each one includes methods specific to the assay, such
as normalization and cell type identification.
Sample
|
|-- dna
|-- cnv
|-- protein
|-- cnv_raw
|-- protein_raw
Sample
object contains all three of the above assays
along with the raw counts for the same. The raw counts are also stored as the respective
assay objects.
Interface¶
Modules
Module to read and write h5 files |
|
Utility functions |
|
Colors and keys for layers and attributes |
Classes
Abstract class for all assays |
|
Container for DNA data. |
|
Container for CNV data. |
|
Container for Protein data |
|
Container for multiple assays. |