clinker


Nameclinker JSON
Version 0.0.28 PyPI version JSON
download
home_pagehttps://github.com/gamcil/clinker
Summary
upload_time2023-07-14 05:24:35
maintainer
docs_urlNone
authorCameron Gilchrist
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # clinker

>Both cblaster and clinker can now be used without installation on the [CAGECAT webserver](http://cagecat.bioinformatics.nl/).

Gene cluster comparison figure generator

## What is it?
clinker is a pipeline for easily generating publication-quality gene cluster
comparison figures.

<img src="images/figure.png" alt="bua cluster and homologues" width=700>

Given a set of GenBank files, clinker will automatically extract protein translations,
perform global alignments between sequences in each cluster, determine the
optimal display order based on cluster similarity, and generate an interactive
visualisation (using [clustermap.js](https://github.com/gamcil/clustermap.js))
that can be extensively tweaked before being exported as an SVG file.

### A note on scope:
clinker was designed primarily as a simple way to visualise groups of homologous
biosynthetic gene clusters, which are typically small genomic regions with not many genes
(as in the example GIF). It performs pairwise alignments of all genes in all input files using
the [aligner built into BioPython](https://biopython.org/docs/1.76/api/Bio.Align.html#Bio.Align.PairwiseAligner),
then generates an interactive SVG document in the browser.
The alignment stage will scale very poorly to multiple genomes with many genes, and the resulting
visualisation will also be very slow given how many SVG elements it will contain.
If you are looking to align entire genomes, you will likely be better served using 
tools built for that purpose (e.g. [Cactus](https://github.com/ComparativeGenomicsToolkit/cactus)).

![clinker visualisation demo](images/demo.gif)

## Installation
clinker can be installed directly through pip:

`pip install clinker`

By cloning the source code from GitHub:

```
git clone https://github.com/gamcil/clinker.git
cd clinker
pip install .
```

Or, through conda:

```
conda create -n clinker -c conda-forge -c bioconda clinker-py
conda activate clinker
```

## Citation
If you found clinker useful, please cite:
```
clinker & clustermap.js: Automatic generation of gene cluster comparison figures.
Gilchrist, C.L.M., Chooi, Y.-H., 2020.
Bioinformatics. doi: https://doi.org/10.1093/bioinformatics/btab007
```

## Usage
Running clinker can be as simple as:

`clinker clusters/*.gbk`

This will read in all GenBank files inside the folder, align them, and print
the alignments to the terminal. To generate the visualisation, use the `-p/--plot`
argument: 

`clinker clusters/*.gbk -p <optional: file name to save static HTML>`

clinker can also parse GFF3 files:

`clinker cluster1.gff3 cluster2.gff3 -p`

Note: a corresponding FASTA file of the same name (extensions ".fa", ".fsa", ".fna", ".fasta" or ".faa") must
be found in the same directory as the GFF3, i.e. `cluster1.fa` and `cluster2.fa`.

See `-h/--help` for more information:

```
usage: clinker [-h] [--version] [-r RANGES [RANGES ...]] [-gf GENE_FUNCTIONS] [-na] [-i IDENTITY] [-j JOBS] [-s SESSION] [-ji JSON_INDENT] [-f] [-o OUTPUT] [-p [PLOT]] [-dl DELIMITER] [-dc DECIMALS] [-hl] [-ha] [-mo MATRIX_OUT] [-ufo] [files ...]

clinker: Automatic creation of publication-ready gene cluster comparison figures.

clinker generates gene cluster comparison figures from GenBank files. It performs pairwise local or global alignments between every sequence in every unique pair of clusters and generates interactive, to-scale comparison figures using the clustermap.js library.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Input options:
  files                 Gene cluster GenBank files
  -r RANGES [RANGES ...], --ranges RANGES [RANGES ...]
                        Scaffold extraction ranges. If a range is specified, only features within the range will be extracted from the scaffold. Ranges should be formatted like: scaffold:start-end (e.g. scaffold_1:15000-40000)
  -gf GENE_FUNCTIONS, --gene_functions GENE_FUNCTIONS
                        2-column CSV file containing gene functions, used to build gene groups from same function instead of sequence similarity (e.g. GENE_001,PKS-NRPS).

Alignment options:
  -na, --no_align       Do not align clusters
  -i IDENTITY, --identity IDENTITY
                        Minimum alignment sequence identity [default: 0.3]
  -j JOBS, --jobs JOBS  Number of alignments to run in parallel (0 to use the number of CPUs) [default: 0]

Output options:
  -s SESSION, --session SESSION
                        Path to clinker session
  -ji JSON_INDENT, --json_indent JSON_INDENT
                        Number of spaces to indent JSON [default: none]
  -f, --force           Overwrite previous output file
  -o OUTPUT, --output OUTPUT
                        Save alignments to file
  -p [PLOT], --plot [PLOT]
                        Plot cluster alignments using clustermap.js. If a path is given, clinker will generate a portable HTML file at that path. Otherwise, the plot will be served dynamically using Python's HTTP server.
  -dl DELIMITER, --delimiter DELIMITER
                        Character to delimit output by [default: human readable]
  -dc DECIMALS, --decimals DECIMALS
                        Number of decimal places in output [default: 2]
  -hl, --hide_link_headers
                        Hide alignment column headers
  -ha, --hide_aln_headers
                        Hide alignment cluster name headers
  -mo MATRIX_OUT, --matrix_out MATRIX_OUT
                        Save cluster similarity matrix to file

Visualisation options:
  -ufo, --use_file_order
                        Display clusters in order of input files

Example usage
-------------
Align clusters, plot results and print scores to screen:
  $ clinker files/*.gbk

Only save gene-gene links when identity is over 50%:
  $ clinker files/*.gbk -i 0.5

Save an alignment session for later:
  $ clinker files/*.gbk -s session.json

Save alignments to file, in comma-delimited format, with 4 decimal places:
  $ clinker files/*.gbk -o alignments.csv -dl "," -dc 4

Generate visualisation:
  $ clinker files/*.gbk -p

Save visualisation as a static HTML document:
  $ clinker files/*.gbk -p plot.html

Cameron Gilchrist, 2020
```

## Defining gene groups by function

By default, clinker automatically assigns a name and colour for each group of homologous genes.
You can instead pre-assign names (i.e. functions) using the `-gf/--gene_functions` argument, which
takes a 2-column comma-separated file like:

```
GENE_001,Cytochrome P450 
GENE_002,Cytochrome P450 
GENE_003,Methyltransferase
GENE_004,Methyltransferase
```

This will generate two groups, Cytochrome P450 (GENE_001 and 002), and Methyltransferase (GENE_003, GENE_004).
If there any other homologous genes are identified, they will automatically be added to these groups.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gamcil/clinker",
    "name": "clinker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Cameron Gilchrist",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c5/43/7f3b0b7137b30817e608cff68edfc6bc518989f66ebe18c211f21270838b/clinker-0.0.28.tar.gz",
    "platform": null,
    "description": "# clinker\n\n>Both cblaster and clinker can now be used without installation on the [CAGECAT webserver](http://cagecat.bioinformatics.nl/).\n\nGene cluster comparison figure generator\n\n## What is it?\nclinker is a pipeline for easily generating publication-quality gene cluster\ncomparison figures.\n\n<img src=\"images/figure.png\" alt=\"bua cluster and homologues\" width=700>\n\nGiven a set of GenBank files, clinker will automatically extract protein translations,\nperform global alignments between sequences in each cluster, determine the\noptimal display order based on cluster similarity, and generate an interactive\nvisualisation (using [clustermap.js](https://github.com/gamcil/clustermap.js))\nthat can be extensively tweaked before being exported as an SVG file.\n\n### A note on scope:\nclinker was designed primarily as a simple way to visualise groups of homologous\nbiosynthetic gene clusters, which are typically small genomic regions with not many genes\n(as in the example GIF). It performs pairwise alignments of all genes in all input files using\nthe [aligner built into BioPython](https://biopython.org/docs/1.76/api/Bio.Align.html#Bio.Align.PairwiseAligner),\nthen generates an interactive SVG document in the browser.\nThe alignment stage will scale very poorly to multiple genomes with many genes, and the resulting\nvisualisation will also be very slow given how many SVG elements it will contain.\nIf you are looking to align entire genomes, you will likely be better served using \ntools built for that purpose (e.g. [Cactus](https://github.com/ComparativeGenomicsToolkit/cactus)).\n\n![clinker visualisation demo](images/demo.gif)\n\n## Installation\nclinker can be installed directly through pip:\n\n`pip install clinker`\n\nBy cloning the source code from GitHub:\n\n```\ngit clone https://github.com/gamcil/clinker.git\ncd clinker\npip install .\n```\n\nOr, through conda:\n\n```\nconda create -n clinker -c conda-forge -c bioconda clinker-py\nconda activate clinker\n```\n\n## Citation\nIf you found clinker useful, please cite:\n```\nclinker & clustermap.js: Automatic generation of gene cluster comparison figures.\nGilchrist, C.L.M., Chooi, Y.-H., 2020.\nBioinformatics. doi: https://doi.org/10.1093/bioinformatics/btab007\n```\n\n## Usage\nRunning clinker can be as simple as:\n\n`clinker clusters/*.gbk`\n\nThis will read in all GenBank files inside the folder, align them, and print\nthe alignments to the terminal. To generate the visualisation, use the `-p/--plot`\nargument: \n\n`clinker clusters/*.gbk -p <optional: file name to save static HTML>`\n\nclinker can also parse GFF3 files:\n\n`clinker cluster1.gff3 cluster2.gff3 -p`\n\nNote: a corresponding FASTA file of the same name (extensions \".fa\", \".fsa\", \".fna\", \".fasta\" or \".faa\") must\nbe found in the same directory as the GFF3, i.e. `cluster1.fa` and `cluster2.fa`.\n\nSee `-h/--help` for more information:\n\n```\nusage: clinker [-h] [--version] [-r RANGES [RANGES ...]] [-gf GENE_FUNCTIONS] [-na] [-i IDENTITY] [-j JOBS] [-s SESSION] [-ji JSON_INDENT] [-f] [-o OUTPUT] [-p [PLOT]] [-dl DELIMITER] [-dc DECIMALS] [-hl] [-ha] [-mo MATRIX_OUT] [-ufo] [files ...]\n\nclinker: Automatic creation of publication-ready gene cluster comparison figures.\n\nclinker generates gene cluster comparison figures from GenBank files. It performs pairwise local or global alignments between every sequence in every unique pair of clusters and generates interactive, to-scale comparison figures using the clustermap.js library.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n\nInput options:\n  files                 Gene cluster GenBank files\n  -r RANGES [RANGES ...], --ranges RANGES [RANGES ...]\n                        Scaffold extraction ranges. If a range is specified, only features within the range will be extracted from the scaffold. Ranges should be formatted like: scaffold:start-end (e.g. scaffold_1:15000-40000)\n  -gf GENE_FUNCTIONS, --gene_functions GENE_FUNCTIONS\n                        2-column CSV file containing gene functions, used to build gene groups from same function instead of sequence similarity (e.g. GENE_001,PKS-NRPS).\n\nAlignment options:\n  -na, --no_align       Do not align clusters\n  -i IDENTITY, --identity IDENTITY\n                        Minimum alignment sequence identity [default: 0.3]\n  -j JOBS, --jobs JOBS  Number of alignments to run in parallel (0 to use the number of CPUs) [default: 0]\n\nOutput options:\n  -s SESSION, --session SESSION\n                        Path to clinker session\n  -ji JSON_INDENT, --json_indent JSON_INDENT\n                        Number of spaces to indent JSON [default: none]\n  -f, --force           Overwrite previous output file\n  -o OUTPUT, --output OUTPUT\n                        Save alignments to file\n  -p [PLOT], --plot [PLOT]\n                        Plot cluster alignments using clustermap.js. If a path is given, clinker will generate a portable HTML file at that path. Otherwise, the plot will be served dynamically using Python's HTTP server.\n  -dl DELIMITER, --delimiter DELIMITER\n                        Character to delimit output by [default: human readable]\n  -dc DECIMALS, --decimals DECIMALS\n                        Number of decimal places in output [default: 2]\n  -hl, --hide_link_headers\n                        Hide alignment column headers\n  -ha, --hide_aln_headers\n                        Hide alignment cluster name headers\n  -mo MATRIX_OUT, --matrix_out MATRIX_OUT\n                        Save cluster similarity matrix to file\n\nVisualisation options:\n  -ufo, --use_file_order\n                        Display clusters in order of input files\n\nExample usage\n-------------\nAlign clusters, plot results and print scores to screen:\n  $ clinker files/*.gbk\n\nOnly save gene-gene links when identity is over 50%:\n  $ clinker files/*.gbk -i 0.5\n\nSave an alignment session for later:\n  $ clinker files/*.gbk -s session.json\n\nSave alignments to file, in comma-delimited format, with 4 decimal places:\n  $ clinker files/*.gbk -o alignments.csv -dl \",\" -dc 4\n\nGenerate visualisation:\n  $ clinker files/*.gbk -p\n\nSave visualisation as a static HTML document:\n  $ clinker files/*.gbk -p plot.html\n\nCameron Gilchrist, 2020\n```\n\n## Defining gene groups by function\n\nBy default, clinker automatically assigns a name and colour for each group of homologous genes.\nYou can instead pre-assign names (i.e. functions) using the `-gf/--gene_functions` argument, which\ntakes a 2-column comma-separated file like:\n\n```\nGENE_001,Cytochrome P450 \nGENE_002,Cytochrome P450 \nGENE_003,Methyltransferase\nGENE_004,Methyltransferase\n```\n\nThis will generate two groups, Cytochrome P450 (GENE_001 and 002), and Methyltransferase (GENE_003, GENE_004).\nIf there any other homologous genes are identified, they will automatically be added to these groups.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "0.0.28",
    "project_urls": {
        "Homepage": "https://github.com/gamcil/clinker"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ba0b6a0af942d2a9db903faee57af6d2cb2a007fb5a85ac3d6b416e2c5aba61",
                "md5": "a9153ba4e9589603716b9012febc965d",
                "sha256": "c26d09b709dfc6e503b0c385a799bb69f5a28a77df80d40859d153d722f73a14"
            },
            "downloads": -1,
            "filename": "clinker-0.0.28-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9153ba4e9589603716b9012febc965d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 129446,
            "upload_time": "2023-07-14T05:24:33",
            "upload_time_iso_8601": "2023-07-14T05:24:33.215336Z",
            "url": "https://files.pythonhosted.org/packages/5b/a0/b6a0af942d2a9db903faee57af6d2cb2a007fb5a85ac3d6b416e2c5aba61/clinker-0.0.28-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5437f3b0b7137b30817e608cff68edfc6bc518989f66ebe18c211f21270838b",
                "md5": "faa8b407df1bbef101599210f97b8525",
                "sha256": "2198d5bdbef75d5cb3224449666c3cc79f3d79459ade694e1bcdf1bf62c4a007"
            },
            "downloads": -1,
            "filename": "clinker-0.0.28.tar.gz",
            "has_sig": false,
            "md5_digest": "faa8b407df1bbef101599210f97b8525",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 128549,
            "upload_time": "2023-07-14T05:24:35",
            "upload_time_iso_8601": "2023-07-14T05:24:35.271115Z",
            "url": "https://files.pythonhosted.org/packages/c5/43/7f3b0b7137b30817e608cff68edfc6bc518989f66ebe18c211f21270838b/clinker-0.0.28.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-14 05:24:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gamcil",
    "github_project": "clinker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clinker"
}
        
Elapsed time: 0.08656s