flipbook


Nameflipbook JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/broadinstitute/flipbook
SummaryStarts a simple image server that lets you quickly flip through image files from a local directory using your web browser and optionally answering customizable questions about each one
upload_time2024-01-09 02:43:50
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords curation ngs sequencing strs reviewer read visualization machine learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## FlipBook

This tool provides a simple user interface for quickly flipping through images stored in some directory on your computer.
It also optionally shows a form where you can take notes or answer questions about each image or set of images.

### Example uses:
- manual curation / review of sequencing data visualization images such as those generated by [REViewer](https://www.illumina.com/science/genomics-research/reviewer-visualizing-alignments-short-reads-long-repeat.html) for short tandem repeat loci
- machine learning training set creation
- reviewing a pile of photos

### Features:

- simple way to flip through many local image files using your web browser
- crawls a top-level directory to find .png, .jpeg, or .svg image files
- browser interface: home page lists all images
- browser interface: image pages show the image, an optional customizable form where you can take notes or answer questions about the image, next/previous page links, and optional other customizable info for context
- use subdirectories to group images. Any images found in the same subdirectory will be shown on the same page  
- optionally generate a static html website to share your images and form responses publicly. Example @ [https://broadinstitute.github.io/StrPileups/index.html](https://broadinstitute.github.io/StrPileups/index.html)

-------

[![PyPI version](https://img.shields.io/pypi/v/flipbook.svg?style=flat)](https://pypi.org/project/flipbook/)  [![Supported Python versions](https://img.shields.io/pypi/pyversions/flipbook.svg)](https://shields.io/)


### Install:

```
python3 -m pip install flipbook  
```

### Run:

```
python3 -m flipbook    # start server for all images in the current directory and subdirectories
```

Below are more example command lines. Run with `--help` to see all available options and their descriptions.

```
python3 -m flipbook -x temp -x keyword2  /path/dir-with-images    #  -x are keyword(s) of paths to skip and /path/dir-with-images is the top level dir to search instead of the current dir

python3 -m flipbook -t /path/user_responses.xls    #  change where user responses get saved (default: flipbook_form_responses.tsv)

python3 -m flipbook -m /path/metadata.tsv          #  provide a metadata table 
```

After the server is running, open your web browser to [http://localhost:8080](http://localhost:8080) to start reviewing images.


### Screenshots

Image page:

<img width="1781" alt="image" src="https://user-images.githubusercontent.com/6240170/208694093-b5e7c97d-d2a4-46ab-9852-5db7157a2a3d.png">


Home page:

<img width="1786" alt="image" src="https://user-images.githubusercontent.com/6240170/208694216-0a550c82-cca2-4212-b22f-134844da95a5.png">


### Options:

- metadata table (`-m`)
  
  It's often useful to add extra info to the image pages to help with review - such as image descriptions, quality scores, etc.
  To enable this, there are several ways to specify arbitrary key-value pairs to add to specific image pages.
  The 1st way is to put a file called `flipbook_metadata.json` next to the image(s). All keys and values from this file
  will appear on that image page. The 2nd way is to use `-m` to pass in a metadata table 
  (`.tsv` or `.xls`) with a `Path` column + arbitrary other columns. If the `Path` value matches the relative directory containing 
  the image(s), entries from that row will be added to this image page.  
  
  Since the keys and values are treated as html, they can be used to add more complex info - such as
  colors, text formatting, <img ..> tags with images from other web pages, iframes containing entire sections of external pages, etc. 

- responses table (`-t`)

  As you fill in the forms at the top of the image pages, the responses are written to this table. If you later restart flipbook with the same `-t`, it will reload previous responses. You can also optionally use this table to provide additional columns to display - sometimes this can be more convenient than using `-m`. 
  
  *Default*: `flipbook_form_responses.tsv`

- custom form schema (`--form-schema-json`)  
   
  If you'd like to use non-default questions in the image page forms, you can specify the path or url of a .json file containing a custom form schema. For examples of the expected format see [main/form_schema_examples](https://github.com/broadinstitute/flipbook/tree/main/form_schema_examples)
  
- config file (`~/.flipbook_config`)

  Most settings that can be provided on the command line can also be set via this YAML config file instead. For example:

  *~/.flipbook_config*
  ```
  form-schema-json: /path/to/my-schema.json
  hide-metadata-on-home-page: true
  host: 127.0.0.1
  port: 8080
  ```

  
For more details, run:   
```
python3 -m flipbook --help
```

### Comparing reviews:

If 2 or more people review the same images, the reviews can be compared using the `compare_form_response_tables` script.  

For example:
```
python3 -m compare_form_response_tables egor_flipbook_form_responses.tsv  ben_flipbook_form_responses.tsv -o combined_responses.tsv -s1 egor -s2 ben
```

This script will print concordance stats, and output a `combined_responses.tsv` table that contains one image per row as well as each person's review of the image.  
  
To see the full list of args and descriptions, run `python3 -m compare_form_response_tables --help`

### Development:

To create a local dev instance, run

```
git clone git@github.com:broadinstitute/flipbook.git
cd flipbook

# start server in dev mode so it reloads code on change
python3 -m flipbook /path/dir-with-images --dev-mode
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/broadinstitute/flipbook",
    "name": "flipbook",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "curation,NGS,sequencing,STRs,REviewer,read visualization,machine learning",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/73/e8/d09de8374e0a163bfdd00a57b66e8fd8d83a85db1f66cb4e10c67be0968a/flipbook-1.0.1.tar.gz",
    "platform": null,
    "description": "## FlipBook\n\nThis tool provides a simple user interface for quickly flipping through images stored in some directory on your computer.\nIt also optionally shows a form where you can take notes or answer questions about each image or set of images.\n\n### Example uses:\n- manual curation / review of sequencing data visualization images such as those generated by [REViewer](https://www.illumina.com/science/genomics-research/reviewer-visualizing-alignments-short-reads-long-repeat.html) for short tandem repeat loci\n- machine learning training set creation\n- reviewing a pile of photos\n\n### Features:\n\n- simple way to flip through many local image files using your web browser\n- crawls a top-level directory to find .png, .jpeg, or .svg image files\n- browser interface: home page lists all images\n- browser interface: image pages show the image, an optional customizable form where you can take notes or answer questions about the image, next/previous page links, and optional other customizable info for context\n- use subdirectories to group images. Any images found in the same subdirectory will be shown on the same page  \n- optionally generate a static html website to share your images and form responses publicly. Example @ [https://broadinstitute.github.io/StrPileups/index.html](https://broadinstitute.github.io/StrPileups/index.html)\n\n-------\n\n[![PyPI version](https://img.shields.io/pypi/v/flipbook.svg?style=flat)](https://pypi.org/project/flipbook/)  [![Supported Python versions](https://img.shields.io/pypi/pyversions/flipbook.svg)](https://shields.io/)\n\n\n### Install:\n\n```\npython3 -m pip install flipbook  \n```\n\n### Run:\n\n```\npython3 -m flipbook    # start server for all images in the current directory and subdirectories\n```\n\nBelow are more example command lines. Run with `--help` to see all available options and their descriptions.\n\n```\npython3 -m flipbook -x temp -x keyword2  /path/dir-with-images    #  -x are keyword(s) of paths to skip and /path/dir-with-images is the top level dir to search instead of the current dir\n\npython3 -m flipbook -t /path/user_responses.xls    #  change where user responses get saved (default: flipbook_form_responses.tsv)\n\npython3 -m flipbook -m /path/metadata.tsv          #  provide a metadata table \n```\n\nAfter the server is running, open your web browser to [http://localhost:8080](http://localhost:8080) to start reviewing images.\n\n\n### Screenshots\n\nImage page:\n\n<img width=\"1781\" alt=\"image\" src=\"https://user-images.githubusercontent.com/6240170/208694093-b5e7c97d-d2a4-46ab-9852-5db7157a2a3d.png\">\n\n\nHome page:\n\n<img width=\"1786\" alt=\"image\" src=\"https://user-images.githubusercontent.com/6240170/208694216-0a550c82-cca2-4212-b22f-134844da95a5.png\">\n\n\n### Options:\n\n- metadata table (`-m`)\n  \n  It's often useful to add extra info to the image pages to help with review - such as image descriptions, quality scores, etc.\n  To enable this, there are several ways to specify arbitrary key-value pairs to add to specific image pages.\n  The 1st way is to put a file called `flipbook_metadata.json` next to the image(s). All keys and values from this file\n  will appear on that image page. The 2nd way is to use `-m` to pass in a metadata table \n  (`.tsv` or `.xls`) with a `Path` column + arbitrary other columns. If the `Path` value matches the relative directory containing \n  the image(s), entries from that row will be added to this image page.  \n  \n  Since the keys and values are treated as html, they can be used to add more complex info - such as\n  colors, text formatting, <img ..> tags with images from other web pages, iframes containing entire sections of external pages, etc. \n\n- responses table (`-t`)\n\n  As you fill in the forms at the top of the image pages, the responses are written to this table. If you later restart flipbook with the same `-t`, it will reload previous responses. You can also optionally use this table to provide additional columns to display - sometimes this can be more convenient than using `-m`. \n  \n  *Default*: `flipbook_form_responses.tsv`\n\n- custom form schema (`--form-schema-json`)  \n   \n  If you'd like to use non-default questions in the image page forms, you can specify the path or url of a .json file containing a custom form schema. For examples of the expected format see [main/form_schema_examples](https://github.com/broadinstitute/flipbook/tree/main/form_schema_examples)\n  \n- config file (`~/.flipbook_config`)\n\n  Most settings that can be provided on the command line can also be set via this YAML config file instead. For example:\n\n  *~/.flipbook_config*\n  ```\n  form-schema-json: /path/to/my-schema.json\n  hide-metadata-on-home-page: true\n  host: 127.0.0.1\n  port: 8080\n  ```\n\n  \nFor more details, run:   \n```\npython3 -m flipbook --help\n```\n\n### Comparing reviews:\n\nIf 2 or more people review the same images, the reviews can be compared using the `compare_form_response_tables` script.  \n\nFor example:\n```\npython3 -m compare_form_response_tables egor_flipbook_form_responses.tsv  ben_flipbook_form_responses.tsv -o combined_responses.tsv -s1 egor -s2 ben\n```\n\nThis script will print concordance stats, and output a `combined_responses.tsv` table that contains one image per row as well as each person's review of the image.  \n  \nTo see the full list of args and descriptions, run `python3 -m compare_form_response_tables --help`\n\n### Development:\n\nTo create a local dev instance, run\n\n```\ngit clone git@github.com:broadinstitute/flipbook.git\ncd flipbook\n\n# start server in dev mode so it reloads code on change\npython3 -m flipbook /path/dir-with-images --dev-mode\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Starts a simple image server that lets you quickly flip through image files from a local directory using your web browser and optionally answering customizable questions about each one",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/broadinstitute/flipbook"
    },
    "split_keywords": [
        "curation",
        "ngs",
        "sequencing",
        "strs",
        "reviewer",
        "read visualization",
        "machine learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39c8569ea69aa854a1412ad1cdb357dc0781502a652dde439d8e5a373d92dcc7",
                "md5": "25f9cd12a3377f08a1972742f79f6dcd",
                "sha256": "34f0296975f6334bdcadd66c7d18a29a14fa0b77872fbc34e0c4317ac0187f1d"
            },
            "downloads": -1,
            "filename": "flipbook-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25f9cd12a3377f08a1972742f79f6dcd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 1321407,
            "upload_time": "2024-01-09T02:43:48",
            "upload_time_iso_8601": "2024-01-09T02:43:48.162990Z",
            "url": "https://files.pythonhosted.org/packages/39/c8/569ea69aa854a1412ad1cdb357dc0781502a652dde439d8e5a373d92dcc7/flipbook-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73e8d09de8374e0a163bfdd00a57b66e8fd8d83a85db1f66cb4e10c67be0968a",
                "md5": "f9a7985d977fb9bff59de95b03bb5d70",
                "sha256": "47a173cd8071aea3b3993ac444bbdf02c5292eaae650c286f8f325de78a74c90"
            },
            "downloads": -1,
            "filename": "flipbook-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f9a7985d977fb9bff59de95b03bb5d70",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 1317398,
            "upload_time": "2024-01-09T02:43:50",
            "upload_time_iso_8601": "2024-01-09T02:43:50.732935Z",
            "url": "https://files.pythonhosted.org/packages/73/e8/d09de8374e0a163bfdd00a57b66e8fd8d83a85db1f66cb4e10c67be0968a/flipbook-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-09 02:43:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "broadinstitute",
    "github_project": "flipbook",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flipbook"
}
        
Elapsed time: 0.18366s