https://github.com/czbiohub-sf/simscity
A library to simulate single-cell data
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: biorxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.0%) to scientific vocabulary
Repository
A library to simulate single-cell data
Basic Info
- Host: GitHub
- Owner: czbiohub-sf
- License: mit
- Language: Python
- Default Branch: master
- Size: 358 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Welcome to Sim S(ingle)-C(ellular)ity
The intention of this repo is to factor out code used to simulate scRNA data. Rather than writing it many times for many uses, we can write it one time and incorporate many features into our simulator.
Refer to this preprint for more information.
Examples of data that we might want to generate:
- A particular type of latent space, to test if we can learn it
- A given batch structure, to test if we can correct for it
- Gene counts sampled according to a given model, to test if the underlying model can be recovered
- Data associated with a phenotype, to see if our models can learn that relationship (using the same generative model or otherwise)
Example usage:
```python from simscity import *
import altair as alt import pandas as pd import numpy as np import umap ```
```python nclasses = 5 nlatent = 6 ncells = 5000 nfeatures = 1000 n_conditions = 8
scale = 5 sparsity = 0.8 ```
```python programs = latent.genprograms(nlatent, n_features, sparsity, scale)
classes = latent.genclasses(nlatent, n_classes, sparsity, scale)
latentexp, classlabels = latent.sampleclasses(ncells, classes, cellsperclass=1000)
expression = np.dot(latent_exp, programs)
u = umap.UMAP().fit_transform(expression) ```
UMAP raises a ton of warnings for me but it seems to be working fine.
```python umis = sequencing.umicounts(np.exp(expression), libsize=10000)
u2 = umap.UMAP().fit_transform(umis) ```
More warnings...
python
alt.hconcat(
alt.Chart(
data=pd.DataFrame({'x': u[:,0], 'y': u[:,1], 'c': class_labels})
).mark_point().encode(x='x:Q', y='y:Q', color='c:N'),
alt.Chart(
data=pd.DataFrame({'x': u2[:,0], 'y': u2[:,1], 'c': class_labels})
).mark_point().encode(x='x:Q', y='y:Q', color='c:N')
)

Owner
- Name: Chan Zuckerberg Biohub San Francisco
- Login: czbiohub-sf
- Kind: organization
- Location: San Francisco
- Website: https://www.czbiohub.org/sf/
- Repositories: 1
- Profile: https://github.com/czbiohub-sf