Package: harissa
This is a Python package for both simulation and inference of gene
regulatory networks from single-cell data. Its name comes from
‘HARtree approximation for Inference along with a Stochastic Simulation Algorithm.’
It was implemented in the context of amechanistic approachto gene regulatory network inference from single-cell data,
based upon an underlying stochastic dynamical model driven by thetranscriptional burstingphenomenon.Main functionalities:Network inference interpreted as calibration of a dynamical model;Data simulation (typically scRNA-seq) from the same dynamical model.Other available tools:Basic GRN visualization (directed graphs with positive or negative edge weights);Binarization of scRNA-seq data (using gene-specific thresholds derived from the calibrated dynamical model).The current version of Harissa has benefited from improvements introduced
withinCardamom,
which can be seen as an alternative method for the inference part.
The two inference methods remain complementary at this stage
and may be merged into the same package in the future.
They were both evaluated in arecent benchmark.InstallationHarissa can be installed usingpip:pipinstallharissaThis command will also check for all required dependencies (see below)
and install them if necessary.
If the installation is successful, all scripts in thetestsfolder should run smoothly
(note thatnetwork4.pymust be run beforetest_binarize.py).Basic usagefromharissaimportNetworkModelmodel=NetworkModel()# Inferencemodel.fit(data)# Simulationsim=model.simulate(time)Heredatashould be a two-dimensional array of single-cell gene expression counts,
where each row represents a cell and each column represents a gene,
except for the first column, which contains experimental time points.
A toy example is:importnumpyasnpdata=np.array([#t g1 g2 g3[0,4,1,0],# Cell 1[0,5,0,1],# Cell 2[1,1,2,4],# Cell 3[1,2,0,8],# Cell 4[1,0,0,3],# Cell 5])Thetimeargument for simulations is either a single time or a list of time points.
For example, a single-cell trajectory (not available from scRNA-seq)
fromt= 0h tot= 10h can be simulated using:time=np.linspace(0,10,1000)Thesimoutput stores mRNA and protein levels as attributessim.mandsim.p,
respectively (each row is a time point and each column is a gene).About the dataThe inference algorithm specifically exploits time-course data,
where single-cell profiling is performed at a number of time points after a stimulus
(seethis paperfor an example with real data).
Each group of cells collected at the same experimental timetkforms asnapshotof the biological heterogeneity at timetk.
Due to the destructive nature of the measurement process,
successive snapshots are made of different cells.
Such data is therefore different from so-called ‘pseudotime’ trajectories,
which attempt to reorder cells according to some smoothness hypotheses.TutorialPlease see thenotebooksfor introductory examples, or thetestsfolder for basic usage scripts.
To get an idea of the main features, you can start by running the notebooks in order:Notebook 1:
simulate a basic repressilator network with 3 genes;Notebook 2:
perform network inference from a small dataset with 4 genes;Notebook 3:
compare two branching pathways with 4 genes from both ‘single-cell’ and ‘bulk’ viewpoints.DependenciesThe package depends on standard scientific librariesnumpyandscipy.
Optionally, it can loadnumbafor accelerating the inference procedure (used by default)
and the simulation procedure (not used by default).
It also depends optionally onmatplotlibandnetworkxfor network visualization.