<jupyter_start><jupyter_text>Fig 9: The RNA velocity count processing and inference workflow, applied to data generated by stochastic simulation In this notebook, we simulate data from the $ABA$ topology and process it using the _velocyto_ pipeline. It appears that imputation does not accurately recapitulate the underlying process average, and induces biases (but note they are less severe if normalization is omitted). However, we may be able to bypass the entire pipeline and directly fit occupation measures; here, we demonstrate an example.  Dependencies and functions<jupyter_code>import time
t1 = time.time()
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 13})
%%capture
!pip install --upgrade git+https://github.com/meichenfang/velocyto.py.git
%%capture
!pip install scanpy
!pip install umap-learn
from vis import *<jupyter_output>/usr/local/lib/python3.7/dist-packages/numba/np/ufunc/parallel.py:363: NumbaWarning: The TBB threading layer requires TBB version 2019.5 or later i.e., TBB_INTERFACE_VERSION >= 11005. Found TBB_INTERFACE_VERSION = 9107. The TBB threading layer is disabled.
  warnings.warn(problem)<jupyter_text>Simulation Generate simulation data.<jupyter_code>!mkdir -p data
nCells,nGenes,T,tau,topo =  2000,100,10,[0,3,7],"aba"
name="data/simdata_aba"
meta = nCells,nGenes,T,tau,topo
simdata = simulate_occup_meas(nCells,nGenes,T,tau,topo,seed=42)
sim_export(simdata,meta,name)
vlm = vcy.VelocytoLoom(loom_filepath=name+".loom")
preprocess(vlm,sim=True,meta=meta,filter=False,sz_normalize=True)
fig,ax=plt.subplots(1,1,figsize=(6,4))
plotEmbed(ax,vlm,"ps",sim=True)
fig=simValidPlots(vlm,tau,meta,geneind=2)
fig.tight_layout()
!mkdir -p figure
fig.savefig('figure/fig_aba_valid_raw.png',dpi=600)
t2 = time.time()
print('Notebook runtime: {:.1f} seconds.'.format(t2-t1))<jupyter_output>Notebook runtime: 129.3 seconds.
{'fraction_non_alphanumeric': 0.11331901181525242, 'fraction_numerical': 0.028464017185821696, 'mean_word_length': 7.064935064935065, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '119077', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 692, 'n_tokens_neox': 629, 'n_words': 164, 'path': 'notebooks/occup_meas_sim.ipynb', 'repo_name': 'pachterlab/GFCP_2022', 'size': '1862'}