Package: cellex
CELLEXCELLEX (CELL-type EXpression-specificity) is a tool for computing cell-type Expression Specificity (ES) profiles. It employs a "wisdom of the crowd"-approach by integrating multiple ES metrics, thus combining complementary cell-type ES profiles, to capture multiple aspects of ES and obtain improved robustness.ContentsDocumentationQuick StartTutorialsContact and ReferencesDocumentationThe documentation for CELLEX can be accessed in the following ways:CELLEX Wiki: main documentation on the usage of CELLEXCELLEX API docs: documentation of CELLEX API/functionsPublication: technical details on the CELLEX method.Genetic mapping of etiologic brain cell types for obesity(Timshel eLife, 2020, Appendix)We are continually updating the documentation for CELLEX. If some information is missing, please submit your request or question via ourissue tracker.Quick startThis brief tutorial showcases the core features of CELLEX.TL;DRimportnumpyasnpimportpandasaspdimportcellexdata=pd.read_csv("./data.csv",index_col=0)metadata=pd.read_csv("./metadata.csv",index_col=0)eso=cellex.ESObject(data=data,annotation=metadata,verbose=True)eso.compute(verbose=True)eso.results["esmu"].to_csv("mydataset.esmu.csv.gz")WalkthroughSetupOption A: Install the latest release from PyPipip install cellexOption B: Install the development version from this repoClone the development repo and install from source usingpip. The development version may contain bug fixes that have not been released, as well as experimental features.git clone https://github.com/perslab/CELLEX.git --branch develop --single-branch
cd CELLEX
pip install -e .Import modulesimportnumpyasnp# needed for formatting data for this tutorialimportpandasaspd# needed for formatting data for this tutorialimportcellexLoad input data and metadatadata=pd.read_csv("./data.csv",index_col=0)metadata=pd.read_csv("./metadata.csv",index_col=0)Data formatData may consist of UMI counts (integer) for eachgeneandcell.cell_1...cell_9gene_x0...4............gene_z3...1Shape:mgenes byncells.Metadata formatMetadata should consist ofuniquecell id's and matching annotation (string).cell_idcell_typecell_1type_A......cell_9type_CShape:ncells by 2.Create ESObject and compute ESmueso=cellex.ESObject(data=data,annotation=metadata,verbose=True)eso.compute(verbose=True)View Expression Specificity scoresAll results are accessible via theresultsattribute of theESObject.eso.results["esmu"]Save result(s)Pro-tip: Using CELLEX with CELLECTThe ESmu scores may be used withCELLECT. CELLECT requires that genes are in theHuman Ensembl Gene IDformat. CELLEX provides a simple renaming utility for this purpose:cellex.utils.mapping.mouse_ens_to_human_ens(eso.results["esmu"],drop_unmapped=True,verbose=True)Save ESmueso.results["esmu"].to_csv("mydataset.esmu.csv.gz")Save all or specific resultseso.save_as_csv(keys=["all"],verbose=True)Output formatOutput consist of Expression Specificity Weights (float) for eachgeneandcell-type. ESmu values lie in the range [0,1].type_A...type_Cgene_x0.0...0.9............gene_z0.1...0.2Shape:mgenes byxunique annotations. N.B. a number of genes may be removed during preprocessing.TutorialsVarious tutorials and walkthroughs will be made available here, while the Wiki is in the making. These Jupyter Notebooks cover everything from downloading CELLEX and data to analysis and plotting.Demo: Downloading and running CELLEX with sample Mousebrain Atlas dataDemo: Downloading and running CELLEX with sample MOCA dataAboutDevelopersTobias Overlund Stannius (University of Copenhagen)@TobiasStanniusPascal Nordgren Timshel (University of Copenhagen)@ptimshelContactPlease create anissuein this repo, if you encounter any problems using CELLEX. Alternatively, you may write an email to timshel(at)sund.ku.dkReferencesIf you find CELLEX useful for your research, please consider citing:Timshel (eLife, 2020):Genetic mapping of etiologic brain cell types for obesity