ChewC


NameChewC JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/cjgo/ChewC
SummaryPytorch Breeding
upload_time2024-06-12 07:28:05
maintainerNone
docs_urlNone
authorColton J. Gowan
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChewC


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

In short, this will be a GPU-enabled stochastic simulation for breeding
programs with an emphasis on cost-benefit-analysis for novel breeding
tools and creating a suitable interface for RL agents.

------------------------------------------------------------------------

We will also incorporate an emphasis on budget and costs associated with
each action to manage long-term breeding budgets. As well as model
theoretical tools in the plant breeder’s toolbox. e.g.

> a treatment which increases crossover rates

> a treatment which reduces flowering time

> a treatment which enables gene drive at select loci

Each treatment will cost \$\$ ultimately helping guide the
implementation in real-world breeding programs.

## Install

``` sh
pip install chewc
```

## How to use

First, define the genome of your crop

``` python
import torch
```

``` python
ploidy = 2
n_chr = 10
n_loci = 100
n_Ind = 333
g = Genome(ploidy, n_chr, n_loci)
population = Population()
population.create_random_founder_population(g, n_founders=n_Ind)
init_pop = population.get_dosages().float()  # gets allele dosage for calculating trait values

# multi_traits
target_means = torch.tensor([0, 5, 20])
target_vars = torch.tensor([1, 1, 0.5])  # Note: I'm assuming you want a variance of 1 for the second trait
correlation_matrix = [
        [1.0, 0.2, 0.58],
        [0.2, 1.0, -0.37],
        [0.58, -0.37, 1.0],
    ]
correlation_matrix = torch.tensor(correlation_matrix)

ta = TraitModule(g, population, target_means, target_vars, correlation_matrix,100)
ta(population.get_dosages()).shape
```

    Created genetic map

    torch.Size([333, 3])

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cjgo/ChewC",
    "name": "ChewC",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nbdev jupyter notebook python",
    "author": "Colton J. Gowan",
    "author_email": "cltngwn@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/eb/f6/7691d7397bcb7e006beb94ba1b46af03295b86bf5a2373e76f4ed1557c9f/ChewC-0.0.7.tar.gz",
    "platform": null,
    "description": "# ChewC\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\nIn short, this will be a GPU-enabled stochastic simulation for breeding\nprograms with an emphasis on cost-benefit-analysis for novel breeding\ntools and creating a suitable interface for RL agents.\n\n------------------------------------------------------------------------\n\nWe will also incorporate an emphasis on budget and costs associated with\neach action to manage long-term breeding budgets. As well as model\ntheoretical tools in the plant breeder\u2019s toolbox. e.g.\n\n> a treatment which increases crossover rates\n\n> a treatment which reduces flowering time\n\n> a treatment which enables gene drive at select loci\n\nEach treatment will cost \\$\\$ ultimately helping guide the\nimplementation in real-world breeding programs.\n\n## Install\n\n``` sh\npip install chewc\n```\n\n## How to use\n\nFirst, define the genome of your crop\n\n``` python\nimport torch\n```\n\n``` python\nploidy = 2\nn_chr = 10\nn_loci = 100\nn_Ind = 333\ng = Genome(ploidy, n_chr, n_loci)\npopulation = Population()\npopulation.create_random_founder_population(g, n_founders=n_Ind)\ninit_pop = population.get_dosages().float()  # gets allele dosage for calculating trait values\n\n# multi_traits\ntarget_means = torch.tensor([0, 5, 20])\ntarget_vars = torch.tensor([1, 1, 0.5])  # Note: I'm assuming you want a variance of 1 for the second trait\ncorrelation_matrix = [\n        [1.0, 0.2, 0.58],\n        [0.2, 1.0, -0.37],\n        [0.58, -0.37, 1.0],\n    ]\ncorrelation_matrix = torch.tensor(correlation_matrix)\n\nta = TraitModule(g, population, target_means, target_vars, correlation_matrix,100)\nta(population.get_dosages()).shape\n```\n\n    Created genetic map\n\n    torch.Size([333, 3])\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Pytorch Breeding",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/cjgo/ChewC"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b3b7f2e3a68ff55e721f474f24512fe561a05c6a49fba42aa74e935571b9a0c",
                "md5": "e13ec33337ea503cd7118e0d3b6f1f89",
                "sha256": "fbd0bcbf937c202101af379a30384aca01e21181395e281d1aca74dcee0d0cd0"
            },
            "downloads": -1,
            "filename": "ChewC-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e13ec33337ea503cd7118e0d3b6f1f89",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15509,
            "upload_time": "2024-06-12T07:28:04",
            "upload_time_iso_8601": "2024-06-12T07:28:04.467738Z",
            "url": "https://files.pythonhosted.org/packages/8b/3b/7f2e3a68ff55e721f474f24512fe561a05c6a49fba42aa74e935571b9a0c/ChewC-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebf67691d7397bcb7e006beb94ba1b46af03295b86bf5a2373e76f4ed1557c9f",
                "md5": "d52f4b51a4348bd4ac075b75e28d4e8c",
                "sha256": "6f22df8b311348dfa8a583adff802793d22cde3f23adbce47ff3c3f7c2e74ec8"
            },
            "downloads": -1,
            "filename": "ChewC-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "d52f4b51a4348bd4ac075b75e28d4e8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14506,
            "upload_time": "2024-06-12T07:28:05",
            "upload_time_iso_8601": "2024-06-12T07:28:05.837834Z",
            "url": "https://files.pythonhosted.org/packages/eb/f6/7691d7397bcb7e006beb94ba1b46af03295b86bf5a2373e76f4ed1557c9f/ChewC-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 07:28:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cjgo",
    "github_project": "ChewC",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "chewc"
}
        
Elapsed time: 0.41670s