{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-11-03T18:37:22.223030Z","iopub.execute_input":"2022-11-03T18:37:22.223501Z","iopub.status.idle":"2022-11-03T18:37:22.253273Z","shell.execute_reply.started":"2022-11-03T18:37:22.223405Z","shell.execute_reply":"2022-11-03T18:37:22.252205Z"},"_kg_hide-input":true,"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Alexandro Cuevas (pollicio) me gustó so much your work that I tried to make an english version for me. I hope you don't hate it. And that I haven't made many english mistakes.\n\nhttps://www.kaggle.com/code/pollicio/analisis-unicelular-chile/notebook","metadata":{}},{"cell_type":"markdown","source":"#Install tables to work with h5 files","metadata":{}},{"cell_type":"code","source":"! pip install -q tables ","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:38:44.892128Z","iopub.execute_input":"2022-11-03T18:38:44.892561Z","iopub.status.idle":"2022-11-03T18:38:57.657914Z","shell.execute_reply.started":"2022-11-03T18:38:44.892529Z","shell.execute_reply":"2022-11-03T18:38:57.656728Z"},"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"datafile = \"../input/open-problems-multimodal/train_multi_targets.h5\"","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:44:48.021951Z","iopub.execute_input":"2022-11-03T18:44:48.022778Z","iopub.status.idle":"2022-11-03T18:44:48.028845Z","shell.execute_reply.started":"2022-11-03T18:44:48.022737Z","shell.execute_reply":"2022-11-03T18:44:48.027550Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"datafile","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:45:04.542692Z","iopub.execute_input":"2022-11-03T18:45:04.543113Z","iopub.status.idle":"2022-11-03T18:45:04.553547Z","shell.execute_reply.started":"2022-11-03T18:45:04.543070Z","shell.execute_reply":"2022-11-03T18:45:04.552281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#PBMCs (peripheral blood mononuclear cells)\n\n\"Blood has proven to be a useful resource for molecular analysis in numerous biomedical studies, with peripheral blood mononuclear cells (PBMCs) and whole blood being the major specimen types. However, comparative analyses between these two major compartments (PBMCs and whole blood) are few and far between.\"\n\nCitation: He, D., Yang, C.X., Sahin, B. et al. Whole blood vs PBMC: compartmental differences in gene expression profiling exemplified in asthma. Allergy Asthma Clin Immunol 15, 67 (2019). https://doi.org/10.1186/s13223-019-0382-x\n\nhttps://aacijournal.biomedcentral.com/articles/10.1186/s13223-019-0382-x","metadata":{}},{"cell_type":"code","source":" !mkdir -p data\n!wget http://cf.10xgenomics.com/samples/cell-exp/3.1.0/5k_pbmc_protein_v3_nextgem/5k_pbmc_protein_v3_nextgem_filtered_feature_bc_matrix.h5 -O data/5k_pbmc_protein_v3_nextgem_filtered_feature_bc_matrix.h5","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:45:21.484026Z","iopub.execute_input":"2022-11-03T18:45:21.484405Z","iopub.status.idle":"2022-11-03T18:45:24.482271Z","shell.execute_reply.started":"2022-11-03T18:45:21.484376Z","shell.execute_reply":"2022-11-03T18:45:24.480691Z"},"_kg_hide-output":true,"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"datafile = \"data/5k_pbmc_protein_v3_nextgem_filtered_feature_bc_matrix.h5\"","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:48:49.285532Z","iopub.execute_input":"2022-11-03T18:48:49.285972Z","iopub.status.idle":"2022-11-03T18:48:49.291916Z","shell.execute_reply.started":"2022-11-03T18:48:49.285938Z","shell.execute_reply":"2022-11-03T18:48:49.290654Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Installing Scanpy\n\nScanpy – Single-Cell Analysis in Python\n\n\"Scanpy is a scalable toolkit for analyzing single-cell gene expression data built jointly with anndata. It includes preprocessing, visualization, clustering, trajectory inference and differential expression testing. The Python-based implementation efficiently deals with datasets of more than one million cells.\"\n\nhttps://pypi.org/project/scanpy/","metadata":{}},{"cell_type":"code","source":"!pip install scanpy","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:49:54.701116Z","iopub.execute_input":"2022-11-03T18:49:54.701513Z","iopub.status.idle":"2022-11-03T18:50:10.053159Z","shell.execute_reply.started":"2022-11-03T18:49:54.701483Z","shell.execute_reply":"2022-11-03T18:50:10.051659Z"},"_kg_hide-output":true,"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"![](https://i.ytimg.com/vi/5HuOGZEu2HY/maxresdefault.jpg)youtube.com","metadata":{}},{"cell_type":"code","source":"import scanpy as sc\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib as mpl","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:53:12.177497Z","iopub.execute_input":"2022-11-03T18:53:12.177965Z","iopub.status.idle":"2022-11-03T18:53:14.533565Z","shell.execute_reply.started":"2022-11-03T18:53:12.177928Z","shell.execute_reply":"2022-11-03T18:53:14.532348Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Ignore warnings\nimport warnings\nwarnings.filterwarnings('ignore')","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:55:04.664624Z","iopub.execute_input":"2022-11-03T18:55:04.665023Z","iopub.status.idle":"2022-11-03T18:55:04.670624Z","shell.execute_reply.started":"2022-11-03T18:55:04.664992Z","shell.execute_reply":"2022-11-03T18:55:04.669221Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc = sc.read_10x_h5(datafile, gex_only=False)\npbmc.var_names_make_unique()\npbmc.layers[\"counts\"] = pbmc.X.copy()\nsc.pp.filter_genes(pbmc, min_counts=1)\npbmc","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:55:09.105910Z","iopub.execute_input":"2022-11-03T18:55:09.106723Z","iopub.status.idle":"2022-11-03T18:55:10.173330Z","shell.execute_reply.started":"2022-11-03T18:55:09.106676Z","shell.execute_reply":"2022-11-03T18:55:10.172078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Dividing data (protein and RNA)\n\nAccording to Alexandro Cuevas: to make easier the pre-processing he divided data in protein and RNA. That will allow us to arrive ro high complexity data. The goal is also predict cell behavior.","metadata":{}},{"cell_type":"code","source":"pbmc.var[\"feature_types\"].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:57:11.238217Z","iopub.execute_input":"2022-11-03T18:57:11.238678Z","iopub.status.idle":"2022-11-03T18:57:11.253227Z","shell.execute_reply.started":"2022-11-03T18:57:11.238647Z","shell.execute_reply":"2022-11-03T18:57:11.252095Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Antibody data","metadata":{}},{"cell_type":"code","source":"protein = pbmc[:, pbmc.var[\"feature_types\"] == \"Antibody Capture\"].copy()\nrna = pbmc[:, pbmc.var[\"feature_types\"] == \"Gene Expression\"].copy()","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:58:03.192732Z","iopub.execute_input":"2022-11-03T18:58:03.193175Z","iopub.status.idle":"2022-11-03T18:58:03.504330Z","shell.execute_reply.started":"2022-11-03T18:58:03.193141Z","shell.execute_reply":"2022-11-03T18:58:03.503051Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#RNA content","metadata":{}},{"cell_type":"code","source":"rna.shape","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:58:36.842661Z","iopub.execute_input":"2022-11-03T18:58:36.843085Z","iopub.status.idle":"2022-11-03T18:58:36.851263Z","shell.execute_reply.started":"2022-11-03T18:58:36.843053Z","shell.execute_reply":"2022-11-03T18:58:36.850017Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.logging.print_versions()\nsc.set_figure_params(frameon=False, figsize=(4, 4))","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:55:34.474492Z","iopub.execute_input":"2022-11-03T18:55:34.474920Z","iopub.status.idle":"2022-11-03T18:55:34.704189Z","shell.execute_reply.started":"2022-11-03T18:55:34.474885Z","shell.execute_reply":"2022-11-03T18:55:34.702997Z"},"_kg_hide-output":true,"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc.shape","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:58:53.992482Z","iopub.execute_input":"2022-11-03T18:58:53.992935Z","iopub.status.idle":"2022-11-03T18:58:54.001752Z","shell.execute_reply.started":"2022-11-03T18:58:53.992900Z","shell.execute_reply":"2022-11-03T18:58:54.000362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Leidenalg\n\nLeidenalg is a general algorithm for methods of community detection in large networks.\n\nSource code https://github.com/vtraag/leidenalg\n\nhttps://pypi.org/project/leidenalg/","metadata":{}},{"cell_type":"markdown","source":"![](https://opengraph.githubassets.com/cff0a7a8cd78b9808911dae6c462e3c42613f1c761334586fcc03d8b864904f1/vtraag/leidenalg)github.com","metadata":{}},{"cell_type":"code","source":"!pip3 install leidenalg","metadata":{"execution":{"iopub.status.busy":"2022-11-03T18:59:28.233864Z","iopub.execute_input":"2022-11-03T18:59:28.235114Z","iopub.status.idle":"2022-11-03T18:59:40.549347Z","shell.execute_reply.started":"2022-11-03T18:59:28.235057Z","shell.execute_reply":"2022-11-03T18:59:40.547404Z"},"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"protein.layers[\"counts\"] = protein.X.copy()","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:00:27.695195Z","iopub.execute_input":"2022-11-03T19:00:27.695668Z","iopub.status.idle":"2022-11-03T19:00:27.703389Z","shell.execute_reply.started":"2022-11-03T19:00:27.695630Z","shell.execute_reply":"2022-11-03T19:00:27.702159Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Updating the previous data normalization","metadata":{}},{"cell_type":"code","source":"protein","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:00:42.602438Z","iopub.execute_input":"2022-11-03T19:00:42.602875Z","iopub.status.idle":"2022-11-03T19:00:42.611756Z","shell.execute_reply.started":"2022-11-03T19:00:42.602841Z","shell.execute_reply":"2022-11-03T19:00:42.610334Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pp.log1p(protein)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:01:26.169106Z","iopub.execute_input":"2022-11-03T19:01:26.169618Z","iopub.status.idle":"2022-11-03T19:01:26.180656Z","shell.execute_reply.started":"2022-11-03T19:01:26.169551Z","shell.execute_reply":"2022-11-03T19:01:26.179359Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pp.pca(protein, n_comps=20)\nsc.pp.neighbors(protein, n_neighbors=30) ","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:01:40.939935Z","iopub.execute_input":"2022-11-03T19:01:40.940449Z","iopub.status.idle":"2022-11-03T19:02:09.658310Z","shell.execute_reply.started":"2022-11-03T19:01:40.940364Z","shell.execute_reply":"2022-11-03T19:02:09.657042Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.tl.leiden(protein, key_added=\"protein_leiden\")","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:02:19.747808Z","iopub.execute_input":"2022-11-03T19:02:19.748706Z","iopub.status.idle":"2022-11-03T19:02:20.692416Z","shell.execute_reply.started":"2022-11-03T19:02:19.748661Z","shell.execute_reply":"2022-11-03T19:02:20.690725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"protein.obsp[\"protein_connectivities\"] = protein.obsp[\"connectivities\"].copy()\nsc.tl.umap(protein)\nsc.pl.umap(protein, color=\"protein_leiden\", size=10)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:02:34.282981Z","iopub.execute_input":"2022-11-03T19:02:34.283437Z","iopub.status.idle":"2022-11-03T19:02:48.417337Z","shell.execute_reply.started":"2022-11-03T19:02:34.283400Z","shell.execute_reply":"2022-11-03T19:02:48.415969Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Beautiful grouping of data. Here, we have the different genoma types","metadata":{}},{"cell_type":"code","source":"protein","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:03:34.179628Z","iopub.execute_input":"2022-11-03T19:03:34.180031Z","iopub.status.idle":"2022-11-03T19:03:34.188354Z","shell.execute_reply.started":"2022-11-03T19:03:34.180000Z","shell.execute_reply":"2022-11-03T19:03:34.187022Z"},"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pp.filter_genes(rna, min_counts=1)\n\nrna.var[\"mito\"] = rna.var_names.str.startswith(\"MT-\")\nsc.pp.calculate_qc_metrics(rna, qc_vars=[\"mito\"], inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:19:43.318970Z","iopub.execute_input":"2022-11-03T19:19:43.319368Z","iopub.status.idle":"2022-11-03T19:20:02.443862Z","shell.execute_reply.started":"2022-11-03T19:19:43.319337Z","shell.execute_reply":"2022-11-03T19:20:02.442673Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rna.layers[\"counts\"] = rna.X.copy()\nsc.pp.normalize_total(rna)\nsc.pp.log1p(rna)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:20:25.366878Z","iopub.execute_input":"2022-11-03T19:20:25.367284Z","iopub.status.idle":"2022-11-03T19:20:25.650936Z","shell.execute_reply.started":"2022-11-03T19:20:25.367254Z","shell.execute_reply":"2022-11-03T19:20:25.649854Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pp.pca(rna)\nsc.pp.neighbors(rna, n_neighbors=30)   \nsc.tl.umap(rna)\nsc.tl.leiden(rna, key_added=\"rna_leiden\")","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:20:41.273366Z","iopub.execute_input":"2022-11-03T19:20:41.273817Z","iopub.status.idle":"2022-11-03T19:21:36.337881Z","shell.execute_reply.started":"2022-11-03T19:20:41.273772Z","shell.execute_reply":"2022-11-03T19:21:36.336614Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rna.obsm[\"protein\"] = protein.to_df()\nrna.obsm[\"protein_umap\"] = protein.obsm[\"X_umap\"]\nrna.obs[\"protein_leiden\"] = protein.obs[\"protein_leiden\"]\nrna.obsp[\"rna_connectivities\"] = rna.obsp[\"connectivities\"].copy()\nrna.obsp[\"protein_connectivities\"] = protein.obsp[\"protein_connectivities\"]","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:21:46.225070Z","iopub.execute_input":"2022-11-03T19:21:46.225480Z","iopub.status.idle":"2022-11-03T19:21:46.235968Z","shell.execute_reply.started":"2022-11-03T19:21:46.225445Z","shell.execute_reply":"2022-11-03T19:21:46.234644Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction","metadata":{}},{"cell_type":"code","source":"sc.tl.umap(rna)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:22:01.806471Z","iopub.execute_input":"2022-11-03T19:22:01.806943Z","iopub.status.idle":"2022-11-03T19:22:15.418142Z","shell.execute_reply.started":"2022-11-03T19:22:01.806896Z","shell.execute_reply":"2022-11-03T19:22:15.416862Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#RNA\n\n\"Ribonucleic acid (abbreviated RNA) is a nucleic acid present in all living cells that has structural similarities to DNA. Unlike DNA, however, RNA is most often single-stranded. An RNA molecule has a backbone made of alternating phosphate groups and the sugar ribose, rather than the deoxyribose found in DNA. \"\n\nhttps://www.genome.gov/genetics-glossary/RNA-Ribonucleic-Acid","metadata":{}},{"cell_type":"code","source":"sc.pl.umap(rna, color=[\"rna_leiden\", \"protein_leiden\"], size=10)\nsc.pl.embedding(rna, basis=\"protein_umap\", color=[\"rna_leiden\", \"protein_leiden\"], size=10)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:22:24.839247Z","iopub.execute_input":"2022-11-03T19:22:24.839721Z","iopub.status.idle":"2022-11-03T19:22:27.074494Z","shell.execute_reply.started":"2022-11-03T19:22:24.839680Z","shell.execute_reply":"2022-11-03T19:22:27.073605Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc.X[:, (pbmc.var[\"feature_types\"] == \"Gene Expression\").values] = rna.X","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:22:55.449828Z","iopub.execute_input":"2022-11-03T19:22:55.450228Z","iopub.status.idle":"2022-11-03T19:23:02.826974Z","shell.execute_reply.started":"2022-11-03T19:22:55.450197Z","shell.execute_reply":"2022-11-03T19:23:02.825830Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc.X[:, (pbmc.var[\"feature_types\"] == \"Antibody Capture\").values] = protein.X","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:23:11.059111Z","iopub.execute_input":"2022-11-03T19:23:11.059508Z","iopub.status.idle":"2022-11-03T19:23:11.486320Z","shell.execute_reply.started":"2022-11-03T19:23:11.059478Z","shell.execute_reply":"2022-11-03T19:23:11.485092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc.obsm.update(rna.obsm)","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:23:24.010330Z","iopub.execute_input":"2022-11-03T19:23:24.010857Z","iopub.status.idle":"2022-11-03T19:23:24.017140Z","shell.execute_reply.started":"2022-11-03T19:23:24.010818Z","shell.execute_reply":"2022-11-03T19:23:24.015768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc.obs[rna.obs.columns] = rna.obs","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:23:38.129461Z","iopub.execute_input":"2022-11-03T19:23:38.129884Z","iopub.status.idle":"2022-11-03T19:23:38.142739Z","shell.execute_reply.started":"2022-11-03T19:23:38.129851Z","shell.execute_reply":"2022-11-03T19:23:38.141619Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pbmc","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:23:52.170645Z","iopub.execute_input":"2022-11-03T19:23:52.171043Z","iopub.status.idle":"2022-11-03T19:23:52.178657Z","shell.execute_reply.started":"2022-11-03T19:23:52.171012Z","shell.execute_reply":"2022-11-03T19:23:52.177396Z"},"_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sc.pl.umap(pbmc, color=\"protein_leiden\", legend_loc=\"on data\")","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:24:13.892583Z","iopub.execute_input":"2022-11-03T19:24:13.893712Z","iopub.status.idle":"2022-11-03T19:24:14.178744Z","shell.execute_reply.started":"2022-11-03T19:24:13.893660Z","shell.execute_reply":"2022-11-03T19:24:14.177650Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Counts by number of Genes.","metadata":{}},{"cell_type":"code","source":"sc.pl.umap(pbmc, color=\"n_genes_by_counts\", legend_loc=\"on data\")","metadata":{"execution":{"iopub.status.busy":"2022-11-03T19:24:31.847275Z","iopub.execute_input":"2022-11-03T19:24:31.847820Z","iopub.status.idle":"2022-11-03T19:24:32.144745Z","shell.execute_reply.started":"2022-11-03T19:24:31.847774Z","shell.execute_reply":"2022-11-03T19:24:32.143609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Acknowledgements:\n\nAlexandro Cuevas  https://www.kaggle.com/code/pollicio/analisis-unicelular-chile/notebook\n\nSource code Vincent Traag https://github.com/vtraag/leidenalg\n\nhttps://pypi.org/project/scanpy/","metadata":{}}]}