lyscripts


Namelyscripts JSON
Version 0.7.3 PyPI version JSON
download
home_page
SummaryPackage containing scripts used in lynference pipelines
upload_time2023-08-29 11:51:59
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords scripts lymph inference
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://raw.githubusercontent.com/rmnldwg/lyscripts/main/github-social-card.png" alt="social card" style="width:830px;"/>

[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rmnldwg/lyscripts/blob/main/LICENSE)
[![GitHub repo](https://img.shields.io/badge/rmnldwg%2Flymph-grey.svg?style=flat&logo=github)](https://github.com/rmnldwg/lyscripts)
[![build badge](https://github.com/rmnldwg/lyscripts/actions/workflows/build.yml/badge.svg?style=flat)](https://pypi.org/project/lyscripts/)
[![docs badge](https://github.com/rmnldwg/lyscripts/actions/workflows/docs.yml/badge.svg?style=flat)](https://rmnldwg.github.io/lyscripts/)
[![tests badge](https://github.com/rmnldwg/lyscripts/actions/workflows/tests.yml/badge.svg?style=flat)](https://rmnldwg.github.io/lyscripts/)

## What are these `lyscripts`?

This package provides convenient scripts for performing inference and learning regarding the lymphatic spread of head & neck cancer. Essentially, it provides a *command line interface* (CLI) to the [`lymph`](https://github.com/rmnldwg/lymph) library.

We are making these "convenience" scripts public, because doing so is one necessary requirement to making our research easily and fully reproducible. There exists another repository, [`lynference`](https://github.com/rmnldwg/lynference), where we store the pipelines that produce(d) our published results in a persistent way. Head over there to learn more about how to reproduce our work.

## Installation

These scripts can be installed via `pip`:

```bash
pip install lyscripts
```

or installed from source by cloning this repo

```bash
git clone https://github.com/rmnldwg/lyscripts.git
cd lyscripts
pip install .
```

## Usage

After installing the package, run `lyscripts --help` to see the following output:

```
USAGE: lyscripts [-h] [-v]
                 {app,data,evaluate,plot,predict,sample,temp_schedule} ...

Utility for performing common tasks w.r.t. the inference and prediction tasks one
can use the `lymph` package for.

POSITIONAL ARGUMENTS:
  {app,data,evaluate,plot,predict,sample,temp_schedule}
    app                 Module containing scripts to run different `streamlit`
                        applications.
    data                Provide a range of commands related to datasets on
                        patterns of lymphatic progression. Currently, the
                        following modules provide additional commands: 1. The
                        `lyscripts.data.clean` module that converts a LyProX-style
                        table of patient information into a simplified format that
                        is used by the `lymph` model. 2. `lyscripts.data.enhance`,
                        a module for computing consensus diagnoses and to ensure
                        that super- and sublevels are consistently reported. 3.
                        The module `lyscripts.data.generate` for creating
                        synthetic datasets with certain characteristics. 4.
                        Submodule `lyscripts.data.join` to concatenate two
                        datasets, e.g. from different institutions. 5.
                        `lyscripts.data.split`, a module with which datasets may
                        be split into random sets of patient data. The split data
                        may then be used e.g. for cross-validation.
    evaluate            Evaluate the performance of the trained model by computing
                        quantities like the Bayesian information criterion (BIC)
                        or (if thermodynamic integration was performed) the actual
                        evidence (with error) of the model.
    plot                Provide various plotting utilities for displaying results
                        of e.g. the inference or prediction process. At the
                        moment, three subcommands are grouped under
                        `lyscripts.plot`: 1. `lyscripts.plot.corner`, which simply
                        outputs a corner plot with nice labels for a set of drawn
                        samples. 2. The module `lyscripts.plot.histograms` can be
                        used to draw histograms, e.g. the ones over risks and
                        prevalences as computed by the `lyscripts.predict` module.
                        3. Module `lyscripts.plot.thermo_int` allows comparing
                        rounds of thermodynamic integration for different models.
    predict             This module provides functions and scripts to predict the
                        risk of hidden involvement, given observed diagnoses, and
                        prevalences of patterns for diagnostic modalities. The
                        submodules for prediction are currently: 1. The
                        `lyscripts.predict.prevalences` module for computing
                        prevalences of certain involvement patterns that may also
                        be compared to observed prevalences. 2. A module
                        `lyscripts.predict.risks` for predicting the risk of any
                        specific pattern of involvement given any particular
                        diagnosis.
    sample              Learn the spread probabilities of the HMM for lymphatic
                        tumor progression using the preprocessed data as input and
                        MCMC as sampling method. This is the central script
                        performing for our project on modelling lymphatic spread
                        in head & neck cancer. We use it for model comparison via
                        the thermodynamic integration functionality and use the
                        sampled parameter estimates for risk predictions. This
                        risk estimate may in turn some day guide clinicians to
                        make more objective decisions with respect to defining the
                        *elective clinical target volume* (CTV-N) in radiotherapy.
    temp_schedule       Generate inverse temperature schedules for thermodynamic
                        integration using various different methods. Thermodynamic
                        integration is quite sensitive to the specific schedule
                        which is used. I noticed in my models, that within the
                        interval $[0, 0.1]$, the increase in the expected
                        log-likelihood is very steep. Hence, the inverse
                        temparature $\beta$ must be more densely spaced in the
                        beginning. This can be achieved by using a power sequence:
                        Generate $n$ linearly spaced points in the interval $[0,
                        1]$ and then transform each point by computing $\beta_i^k$
                        where $k$ could e.g. be 5.

OPTIONAL ARGUMENTS:
  -h, --help            show this help message and exit
  -v, --version         Display the version of lyscripts (default: False)
```

Each of the individual subcommands provides a help page like this respectively that detail the positional and optional arguments along with their function.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lyscripts",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "scripts,lymph,inference",
    "author": "",
    "author_email": "Roman Ludwig <roman.ludwig@usz.ch>",
    "download_url": "https://files.pythonhosted.org/packages/1e/17/9bae7d8615e2034ea494e523f6eaf649efe2e6e005e46af15926a544f690/lyscripts-0.7.3.tar.gz",
    "platform": null,
    "description": "<img src=\"https://raw.githubusercontent.com/rmnldwg/lyscripts/main/github-social-card.png\" alt=\"social card\" style=\"width:830px;\"/>\n\n[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rmnldwg/lyscripts/blob/main/LICENSE)\n[![GitHub repo](https://img.shields.io/badge/rmnldwg%2Flymph-grey.svg?style=flat&logo=github)](https://github.com/rmnldwg/lyscripts)\n[![build badge](https://github.com/rmnldwg/lyscripts/actions/workflows/build.yml/badge.svg?style=flat)](https://pypi.org/project/lyscripts/)\n[![docs badge](https://github.com/rmnldwg/lyscripts/actions/workflows/docs.yml/badge.svg?style=flat)](https://rmnldwg.github.io/lyscripts/)\n[![tests badge](https://github.com/rmnldwg/lyscripts/actions/workflows/tests.yml/badge.svg?style=flat)](https://rmnldwg.github.io/lyscripts/)\n\n## What are these `lyscripts`?\n\nThis package provides convenient scripts for performing inference and learning regarding the lymphatic spread of head & neck cancer. Essentially, it provides a *command line interface* (CLI) to the [`lymph`](https://github.com/rmnldwg/lymph) library.\n\nWe are making these \"convenience\" scripts public, because doing so is one necessary requirement to making our research easily and fully reproducible. There exists another repository, [`lynference`](https://github.com/rmnldwg/lynference), where we store the pipelines that produce(d) our published results in a persistent way. Head over there to learn more about how to reproduce our work.\n\n## Installation\n\nThese scripts can be installed via `pip`:\n\n```bash\npip install lyscripts\n```\n\nor installed from source by cloning this repo\n\n```bash\ngit clone https://github.com/rmnldwg/lyscripts.git\ncd lyscripts\npip install .\n```\n\n## Usage\n\nAfter installing the package, run `lyscripts --help` to see the following output:\n\n```\nUSAGE: lyscripts [-h] [-v]\n                 {app,data,evaluate,plot,predict,sample,temp_schedule} ...\n\nUtility for performing common tasks w.r.t. the inference and prediction tasks one\ncan use the `lymph` package for.\n\nPOSITIONAL ARGUMENTS:\n  {app,data,evaluate,plot,predict,sample,temp_schedule}\n    app                 Module containing scripts to run different `streamlit`\n                        applications.\n    data                Provide a range of commands related to datasets on\n                        patterns of lymphatic progression. Currently, the\n                        following modules provide additional commands: 1. The\n                        `lyscripts.data.clean` module that converts a LyProX-style\n                        table of patient information into a simplified format that\n                        is used by the `lymph` model. 2. `lyscripts.data.enhance`,\n                        a module for computing consensus diagnoses and to ensure\n                        that super- and sublevels are consistently reported. 3.\n                        The module `lyscripts.data.generate` for creating\n                        synthetic datasets with certain characteristics. 4.\n                        Submodule `lyscripts.data.join` to concatenate two\n                        datasets, e.g. from different institutions. 5.\n                        `lyscripts.data.split`, a module with which datasets may\n                        be split into random sets of patient data. The split data\n                        may then be used e.g. for cross-validation.\n    evaluate            Evaluate the performance of the trained model by computing\n                        quantities like the Bayesian information criterion (BIC)\n                        or (if thermodynamic integration was performed) the actual\n                        evidence (with error) of the model.\n    plot                Provide various plotting utilities for displaying results\n                        of e.g. the inference or prediction process. At the\n                        moment, three subcommands are grouped under\n                        `lyscripts.plot`: 1. `lyscripts.plot.corner`, which simply\n                        outputs a corner plot with nice labels for a set of drawn\n                        samples. 2. The module `lyscripts.plot.histograms` can be\n                        used to draw histograms, e.g. the ones over risks and\n                        prevalences as computed by the `lyscripts.predict` module.\n                        3. Module `lyscripts.plot.thermo_int` allows comparing\n                        rounds of thermodynamic integration for different models.\n    predict             This module provides functions and scripts to predict the\n                        risk of hidden involvement, given observed diagnoses, and\n                        prevalences of patterns for diagnostic modalities. The\n                        submodules for prediction are currently: 1. The\n                        `lyscripts.predict.prevalences` module for computing\n                        prevalences of certain involvement patterns that may also\n                        be compared to observed prevalences. 2. A module\n                        `lyscripts.predict.risks` for predicting the risk of any\n                        specific pattern of involvement given any particular\n                        diagnosis.\n    sample              Learn the spread probabilities of the HMM for lymphatic\n                        tumor progression using the preprocessed data as input and\n                        MCMC as sampling method. This is the central script\n                        performing for our project on modelling lymphatic spread\n                        in head & neck cancer. We use it for model comparison via\n                        the thermodynamic integration functionality and use the\n                        sampled parameter estimates for risk predictions. This\n                        risk estimate may in turn some day guide clinicians to\n                        make more objective decisions with respect to defining the\n                        *elective clinical target volume* (CTV-N) in radiotherapy.\n    temp_schedule       Generate inverse temperature schedules for thermodynamic\n                        integration using various different methods. Thermodynamic\n                        integration is quite sensitive to the specific schedule\n                        which is used. I noticed in my models, that within the\n                        interval $[0, 0.1]$, the increase in the expected\n                        log-likelihood is very steep. Hence, the inverse\n                        temparature $\\beta$ must be more densely spaced in the\n                        beginning. This can be achieved by using a power sequence:\n                        Generate $n$ linearly spaced points in the interval $[0,\n                        1]$ and then transform each point by computing $\\beta_i^k$\n                        where $k$ could e.g. be 5.\n\nOPTIONAL ARGUMENTS:\n  -h, --help            show this help message and exit\n  -v, --version         Display the version of lyscripts (default: False)\n```\n\nEach of the individual subcommands provides a help page like this respectively that detail the positional and optional arguments along with their function.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Package containing scripts used in lynference pipelines",
    "version": "0.7.3",
    "project_urls": {
        "documentation": "https://rmnldwg.github.io/lyscripts",
        "source": "https://github.com/rmnldwg/lyscripts"
    },
    "split_keywords": [
        "scripts",
        "lymph",
        "inference"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e38eb38f88b90c0ea04080df65ffd296e20313a3c3c50a6bf479ef942ee97322",
                "md5": "7153923714cf62ada5421a9ea05a127d",
                "sha256": "cf75a0080cf72e64d98ab3ec7b7faba9848513e0f5bb657d261562376a7370f3"
            },
            "downloads": -1,
            "filename": "lyscripts-0.7.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7153923714cf62ada5421a9ea05a127d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 65524,
            "upload_time": "2023-08-29T11:51:57",
            "upload_time_iso_8601": "2023-08-29T11:51:57.573076Z",
            "url": "https://files.pythonhosted.org/packages/e3/8e/b38f88b90c0ea04080df65ffd296e20313a3c3c50a6bf479ef942ee97322/lyscripts-0.7.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e179bae7d8615e2034ea494e523f6eaf649efe2e6e005e46af15926a544f690",
                "md5": "f4dd4a8d24bfd0b0e75b5ee055f49a9c",
                "sha256": "f0d158019c850453eff24cfa8f7ac285e82ab279c06aad1c437405f8b5f483ed"
            },
            "downloads": -1,
            "filename": "lyscripts-0.7.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f4dd4a8d24bfd0b0e75b5ee055f49a9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 335217,
            "upload_time": "2023-08-29T11:51:59",
            "upload_time_iso_8601": "2023-08-29T11:51:59.699525Z",
            "url": "https://files.pythonhosted.org/packages/1e/17/9bae7d8615e2034ea494e523f6eaf649efe2e6e005e46af15926a544f690/lyscripts-0.7.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-29 11:51:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rmnldwg",
    "github_project": "lyscripts",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lyscripts"
}
        
Elapsed time: 0.10414s