Perform single cell analysis, integrate with CRISPRa screen#

import lamindb as ln
import scanpy as sc
ln.settings.transform.stem_uid = "lB3IyPLQSmvt"
ln.settings.transform.version = "1"
ln.track()

Access the output files of bfx pipeline and previous analysis#

# access the output files of bfx pipeline and previous analysis
file_ps = ln.Artifact.filter(description__icontains="perturbseq").one()
adata = file_ps.load()
adata
file_hits = ln.Artifact.filter(description="hits from schmidt22 crispra GWS").one()
screen_hits = file_hits.load()
screen_hits

Perform analysis and register output plot files#

sc.tl.score_genes(adata, adata.var_names.intersection(screen_hits.index).tolist())
filesuffix = "_fig1_score-wgs-hits.png"
sc.pl.umap(adata, color="score", show=False, save=filesuffix)
filepath = f"figures/umap{filesuffix}"
artifact = ln.Artifact(filepath, key=filepath)
artifact.save()
filesuffix = "fig2_score-wgs-hits-per-cluster.png"
sc.pl.matrixplot(
    adata, groupby="cluster_name", var_names=["score"], show=False, save=filesuffix
)
filepath = f"figures/matrixplot_{filesuffix}"
artifact = ln.Artifact(filepath, key=filepath)
artifact.save()
#ln.finish()