<jupyter_start><jupyter_text>Data import for Shalek_2018/Ordovas-Montanes dataset:<jupyter_code>import os
os.chdir('./../')
import scanpy as sc
import anndata as ad
import preprocessing as pp
import pandas as pd
adata = sc.read('Ordovas-Montanes/ordovas.h5ad')
metadata = pd.read_csv('Ordovas-Montanes/OrdovasMontanes_HumanNasal_covid19_genes.csv').set_index('NAME')
metadata
adata = adata[adata.obs_names.isin(metadata.index)]
adata = adata[~adata.obs_names.duplicated(keep='first')]
adata.obs['sample'] = metadata['biosample_id'].loc[adata.obs_names]
adata.obs['subject_ID'] = metadata['donor_id'].loc[adata.obs_names]
adata.obs['original_celltype_ann'] = metadata['cell_type__ontology_label'].loc[adata.obs_names]
adata.obs['condition'] = metadata['disease__ontology_label'].loc[adata.obs_names]
adata.obs['sex'] = metadata['sex'].loc[adata.obs_names]
adata.obs['age'] = metadata['organism_age'].loc[adata.obs_names]
adata.obs['dataset'] = 'Shalek2018'
adata.obs['study'] = 'Shalek2018'
genes_subset = pd.read_csv('./genes_for_mapping.csv')
genes_subset
adata_subset = pp.subset_and_pad_adata(genes_subset, adata)
adata_subset.write('Ordovas-Montanes/ordovasmontanes_sub_annot.h5ad')
adata.write('Ordovas-Montanes/ordovasmontanes_annot.h5ad')
adata.X<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15276695245518315, 'fraction_numerical': 0.013250194855806703, 'mean_word_length': 9.11023622047244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '467341', 'license': 'MIT', 'n_tokens_mistral': 490, 'n_tokens_neox': 469, 'n_words': 57, 'path': 'notebooks/3_atlas_extension/HLCA_extension_data_preprocessing/Shalek_2018_OrdovasAnnot.ipynb', 'repo_name': 'LungCellAtlas/HLCA_reproducibility', 'size': '1283'}