# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['data', 'data.aisnps', 'data.models', 'data.samples', 'ezancestry']

package_data = \
{'': ['*']}

install_requires = \
['cmake>=3.21.2,<4.0.0',
 'cyvcf2>=0.30.11,<0.31.0',
 'loguru>=0.5.3,<0.6.0',
 'numpy>=1.21.2,<2.0.0',
 'pandas>=1.3.2,<2.0.0',
 'plotly>=5.3.1,<6.0.0',
 'scikit-learn>=0.24.2,<0.25.0',
 'snps>=2.3.0,<3.0.0',
 'streamlit>=0.87.0,<0.88.0',
 'typer>=0.4.0,<0.5.0',
 'umap-learn>=0.5.1,<0.6.0']

entry_points = \
{'console_scripts': ['ezancestry = ezancestry.commands:app']}

setup_kwargs = {
    'name': 'ezancestry',
    'version': '0.0.3',
    'description': 'Easily predict and visualize genetic ancestry. Evaluate custom ancestry-informative SNP sets.',
    'long_description': '# ezancestry\n\nEasily visualize your direct-to-consumer genetics next to 2500+ samples from the 1000 genomes project. Evaluate the performance of a custom set of ancestry-informative snps (AISNPs) at classifying the genetic ancestry of the 1000 genomes samples using a machine learning model. \n\nA subset of 1000 Genomes Project samples\' single nucleotide polymorphism(s), or, SNP(s) have been parsed from the [publicly available `.bcf` files](ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/supporting/bcf_files/).  \nThe subset of `SNPs`, AISNPs (ancestry-informative snps), were chosen from two publications:\n  * Set of 55 AISNPs. [Progress toward an efficient panel of SNPs for ancestry inference](https://www.ncbi.nlm.nih.gov/pubmed?db=pubmed&cmd=Retrieve&dopt=citation&list_uids=24508742). Kidd et al. 2014\n  * Set of 128 AISNPs. [Ancestry informative marker sets for determining continental origin and admixture proportions in common populations in America.](https://www.ncbi.nlm.nih.gov/pubmed?cmd=Retrieve&dopt=citation&list_uids=18683858). Kosoy et al. 2009 (Seldin Lab)\n\nezancestry ships with pretrained k-nearest neighbor models for all combinations of following:\n\n    * Kidd (55 AISNPs)\n    * Seldin (128 AISNPs)\n    \n    * continental-level population (superpopulation)\n    * regional population (population)\n \n    * principal componentanalysis (PCA)\n    * neighborhood component analysis (NCA)\n    * uniform manifold approximation and projection (UMAP)\n\n![image](images/ezancestry.gif)\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Config](#config)\n* [Usage](#usage)\n    * [command line tool](#command-line-interface)\n        * [predict](#predict)\n        * [plot](#plot)\n        * [generate-dependencies](#generate-dependencies)\n        * [build-model](#build-model)\n    * [Python API](#python-api)\n* [Visualization](#visualization)\n* [Contributing](#contributing)\n\n\n## Installation\n\nInstall ezancestry with pip:\n\n```shell\npip install ezancestry\n```\n\nOr clone the repository and run `pip install` from the directory:\n\n```shell\ngit clone git@github.com:arvkevi/ezancestry.git\ncd ezancestry\npip install .\n```\n\n## Config\n\nThe first time `ezancestry` is run it will generate a `config.ini` file and `data/` directory in your home directory under `${HOME}/.ezancestry`.\nYou can edit `conf.ini` to change the default settings, but it is not necessary to use ezancestry. The settings are just a utility for the user so they don\'t have to be verbose when interacting with the software. The settings are also keyword arguments to each of the commands in the ezancestry API, so you can always override the default settings.  \n\nThese will be created in your home directory:\n\n```shell\n${HOME}/.ezancestry/conf.ini\n${HOME}/.ezancestry/data/\n```\n\nExplanations of each setting is described in the Options section of the `--help` of each command, for example:\n\n```shell\nezancestry predict --help\n\nUsage: ezancestry predict [OPTIONS] INPUT_DATA\n\n  Predict ancestry from genetic data.\n\n  * Default arguments are from the ~/.ezancestry/conf.ini file. *\n\nArguments:\n  INPUT_DATA  Can be a file path to raw genetic data (23andMe, ancestry.com,\n              .vcf) file, a path to a directory containing several raw genetic\n              files, or a (tab or comma) delimited file with sample ids as\n              rows and snps as columns.  [required]\n\n\nOptions:\n  --output-directory TEXT         The directory where to write the prediction\n                                  results file\n\n  --write-predictions / --no-write-predictions\n                                  If True, write the predictions to a file. If\n                                  False, return the predictions as a\n                                  dataframe.  [default: True]\n\n  --models-directory TEXT         The path to the directory where the model\n                                  files are located.\n\n  --aisnps-directory TEXT         The path to the directory where the AISNPs\n                                  files are located.\n\n  --n-components INTEGER          The number of components to use in the PCA\n                                  dimensionality reduction.\n\n  --k INTEGER                     The number of nearest neighbors to use in\n                                  the KNN model.\n\n  --thousand-genomes-directory TEXT\n                                  The path to the 1000 genomes directory.\n  --samples-directory TEXT        The path to the directory containing the\n                                  samples.\n\n  --algorithm TEXT                The dimensionality reduction algorithm to\n                                  use. Choose pca|umap|nca\n\n  --aisnps-set TEXT               The name of the AISNP set to use. To start,\n                                  choose either \'Kidd\' or \'Seldin\'. The\n                                  default value in conf.ini is \'Kidd\'. *If\n                                  using your AISNP set, this value will be the\n                                  in the namingc onvention for all the new\n                                  model files that are created*\n\n  --help                          Show this message and exit.\n```\n\n## Usage\n\nezancestry can be used as a command-line tool or as a Python library. ezancestry `predict` comes with pre-trained models when `--aisnps-set="Kidd"` (default) or `--aisnps-set="Seldin"`.\n\n`build-model` and `generate-dependencies` are for advanced users -- they download large amounts of data and build a new model from a custom AISNPs file.\n\n### command-line interface\n\nThere are four commands available:\n\n1. `predict`: predict the genetic ancestry of a sample or cohort of samples using the nearest neighbors model.\n2. `plot`: plot the genetic ancestry of samples using only the output of `predict`.\n3. `generate-dependencies`: generate the dependencies for `build-model`.\n4. `build-model`: build a nearest neighbors model from the 1000 genomes data using a custom set of AISNPs. Requires: `generate-dependencies` to be run first.\n\nUse the commands in the following way:\n\n\n#### predict\n\nezancestry can predict the genetic ancestry of a sample or cohort of samples using the nearest neighbors model.\nThe `input_data` can be a file path to raw genetic data (23andMe, ancestry.com, .vcf) file, a path to a directory containing several raw genetic files, or a (tab or comma) delimited file with sample ids as rows and snps as columns.\n\nThis writes a file, `predictions.csv` to the `output_directory` (defaults to current directory). This file contains predicted ancestry for each sample.\n\n**Direct-to-consumer genetic data file (23andMe, ancestry.com, etc.)**:\n\n```shell\nezancestry predict mygenome.txt\n```\n\n**Directory of direct-to-consumer genetic data files or .vcf files**:\n\n```shell\nezancestry predict /path/to/genetic_datafiles\n```\n\n**comma-separated file with sample ids as rows and snps as columns, filled with genotypes as values**\n\n```shell\nezancestry predict ${HOME}/.ezancestry/data/aisnps/thousand_genomes.KIDD.dataframe.csv\n```\n\n#### plot\n\nVisualize the output of `predict` using the `plot` command. This will open a 3d scatter plot in a browser.\n\n```shell\nezancestry plot predictions.csv\n```\n\n#### generate-dependencies\n\nThis command will download all of the data required to build a new nearest neighbors model for a custom set of AISNPs. \n**This command will attempt to download all the .bcf files from The 1000 Genomes Project.** If you want to use existing models, see `predict` and `plot`.\n\nWithout any arguments this command will download all necessary data to build new models and put it in the `${HOME}/.ezancestry/data/` directory.\n\n```shell\nezancestry generate-dependencies\n```\n\nNow you are ready to build a new model with `build-model`.\n\n#### build-model\n\nTest the discriminative power of your custom set of AISNPs.\n\nThis command will build all the necessary models to visualize and predict the 1000 genomes samples as well as user-uploaded samples. A model performace evaluation report will be generated for a five-fold cross-validation on the training set of the 1000 genomes samples as well as a report for the holdout set.\n\nCreate a custom AISNP file here: `~/.ezancestry/data/aisnps/custom.AISNP.txt`. The prefix of the filename, `custom`, can be whatever you want. Note that this value is used as the `aisnps-set` keyword argument for other ezancestry commands.\n\nThe file should look like this:\n```\nid      chromosome      position_hg19\nrs731257        7       12669251\nrs2946788       11      24010530\nrs3793451       9       71659280\nrs10236187      7       139447377\nrs1569175       2       201021954\n```\n\n```shell\nezancestry build-model --aisnps-set=custom\n```\n\n### Python API\n\nSee the [notebook](github.com/arvkevi/ezancestry/ezancestry_library_tutorial.ipynb)\n\n### Visualization\n\n[http://ezancestry.herokuapp.com/](http://ezancestry.herokuapp.com/) \n\n[Open in Streamlit](https://share.streamlit.io/arvkevi/ezancestry/streamlit-share/streamlit/app.py)\n\n![image](images/ezancestry.png)\n\n### Contributing\n\nContributions are welcome! Please feel free to create an issue for discussion or make a pull request.\n',
    'author': 'arvkevi',
    'author_email': 'arvkevi@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': None,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<3.11',
}


setup(**setup_kwargs)
