|
1433 | 1433 | "metadata": {}, |
1434 | 1434 | "outputs": [], |
1435 | 1435 | "source": [ |
1436 | | - "#because we have so many drugs, we wont plot the umap here\n", |
| 1436 | + "# because we have so many drugs, we wont plot the umap here\n", |
1437 | 1437 | "# sc.pl.umap(\n", |
1438 | 1438 | "# subset_adata,\n", |
1439 | 1439 | "# color=[\"drug\"],\n", |
|
1536 | 1536 | "metadata": {}, |
1537 | 1537 | "outputs": [], |
1538 | 1538 | "source": [ |
1539 | | - "#sc.pl.umap(\n", |
| 1539 | + "# sc.pl.umap(\n", |
1540 | 1540 | "# subset_adata2,\n", |
1541 | 1541 | "# color=[\"plate\", \"Cell_ID_Cellosaur\"],\n", |
1542 | 1542 | "# frameon=False,\n", |
1543 | | - "#)" |
| 1543 | + "# )" |
1544 | 1544 | ] |
1545 | 1545 | }, |
1546 | 1546 | { |
|
1785 | 1785 | "metadata": {}, |
1786 | 1786 | "outputs": [], |
1787 | 1787 | "source": [ |
1788 | | - "#tahoe_scanvi.train(max_epochs=5,batch_size=64) #this fails in the workstation" |
| 1788 | + "# tahoe_scanvi.train(max_epochs=5,batch_size=64) #this fails in the workstation" |
1789 | 1789 | ] |
1790 | 1790 | }, |
1791 | 1791 | { |
|
1805 | 1805 | "source": [ |
1806 | 1806 | "predictions = tahoe_scanvi.predict(subset_adata)\n", |
1807 | 1807 | "subset_adata.obs[\"predictions_scanvi\"] = predictions\n", |
1808 | | - "#predictions" |
| 1808 | + "# predictions" |
1809 | 1809 | ] |
1810 | 1810 | }, |
1811 | 1811 | { |
|
1851 | 1851 | } |
1852 | 1852 | ], |
1853 | 1853 | "source": [ |
1854 | | - "print(f\"The overall Accuracy is:\",np.round(np.trace(norm_df),2))" |
| 1854 | + "print(\"The overall Accuracy is:\", np.round(np.trace(norm_df), 2))" |
1855 | 1855 | ] |
1856 | 1856 | }, |
1857 | 1857 | { |
|
1870 | 1870 | "outputs": [], |
1871 | 1871 | "source": [ |
1872 | 1872 | "SCANVI_LATENT_KEY = \"X_scanVI\"\n", |
1873 | | - "#latent_scanvi = tahoe_scanvi.get_latent_representation(subset_adata2)\n", |
1874 | | - "#subset_adata2.obsm[SCANVI_LATENT_KEY] = latent_scanvi" |
| 1873 | + "# latent_scanvi = tahoe_scanvi.get_latent_representation(subset_adata2)\n", |
| 1874 | + "# subset_adata2.obsm[SCANVI_LATENT_KEY] = latent_scanvi" |
1875 | 1875 | ] |
1876 | 1876 | }, |
1877 | 1877 | { |
|
1882 | 1882 | "outputs": [], |
1883 | 1883 | "source": [ |
1884 | 1884 | "# use scVI latent space for UMAP generation\n", |
1885 | | - "#sc.pp.neighbors(subset_adata2, use_rep=SCANVI_LATENT_KEY)\n", |
1886 | | - "#sc.tl.umap(subset_adata2, min_dist=0.3)" |
| 1885 | + "# sc.pp.neighbors(subset_adata2, use_rep=SCANVI_LATENT_KEY)\n", |
| 1886 | + "# sc.tl.umap(subset_adata2, min_dist=0.3)" |
1887 | 1887 | ] |
1888 | 1888 | }, |
1889 | 1889 | { |
|
1893 | 1893 | "metadata": {}, |
1894 | 1894 | "outputs": [], |
1895 | 1895 | "source": [ |
1896 | | - "#sc.pl.umap(\n", |
| 1896 | + "# sc.pl.umap(\n", |
1897 | 1897 | "# subset_adata2,\n", |
1898 | 1898 | "# color=[\"plate\", \"Cell_ID_Cellosaur\"],\n", |
1899 | 1899 | "# ncols=2,\n", |
1900 | 1900 | "# frameon=False,\n", |
1901 | | - "#)" |
| 1901 | + "# )" |
1902 | 1902 | ] |
1903 | 1903 | }, |
1904 | 1904 | { |
|
2016 | 2016 | " subset_adata2,\n", |
2017 | 2017 | " batch_key=\"plate\",\n", |
2018 | 2018 | " label_key=\"Cell_ID_Cellosaur\",\n", |
2019 | | - " embedding_obsm_keys=[\"X_pca\",\"X_scVI\"],\n", |
| 2019 | + " embedding_obsm_keys=[\"X_pca\", \"X_scVI\"],\n", |
2020 | 2020 | " n_jobs=-1,\n", |
2021 | 2021 | ")\n", |
2022 | 2022 | "bm.benchmark()" |
|
2614 | 2614 | ], |
2615 | 2615 | "source": [ |
2616 | 2616 | "import plotnine as p9\n", |
| 2617 | + "\n", |
2617 | 2618 | "(\n", |
2618 | 2619 | " p9.ggplot(de_change, p9.aes(\"lfc_mean\", \"-log10_pscore\", color=\"Biotype\"))\n", |
2619 | 2620 | " + p9.geom_point(\n", |
|
2746 | 2747 | "outputs": [], |
2747 | 2748 | "source": [ |
2748 | 2749 | "# get the generated expression from the minified model (will take very long time)\n", |
2749 | | - "#tahoe.adata[:, upregulated_genes.index] = tahoe.get_normalized_expression(\n", |
| 2750 | + "# tahoe.adata[:, upregulated_genes.index] = tahoe.get_normalized_expression(\n", |
2750 | 2751 | "# gene_list=list(upregulated_genes.index), n_samples=10\n", |
2751 | | - "#)" |
| 2752 | + "# )" |
2752 | 2753 | ] |
2753 | 2754 | }, |
2754 | 2755 | { |
|
0 commit comments