Perform single cell analysis, integrate with CRISPRa screen

import lamindb as ln
import scanpy as sc
ln.track("lB3IyPLQSmvt0000")

Access the output files of bfx pipeline and previous analysis

# access the output files of bfx pipeline and previous analysis
file_ps = ln.Artifact.get(description__icontains="perturbseq")
adata = file_ps.load()
adata
file_hits = ln.Artifact.get(description="hits from schmidt22 crispra GWS")
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()