{"id":33051349,"url":"https://github.com/mjsull/chromatiblock","last_synced_at":"2025-11-18T21:01:05.029Z","repository":{"id":69740883,"uuid":"97623186","full_name":"mjsull/chromatiblock","owner":"mjsull","description":"Colinear block visualisation tool","archived":false,"fork":false,"pushed_at":"2024-01-17T03:47:03.000Z","size":57028,"stargazers_count":31,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T01:31:45.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjsull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-18T16:55:20.000Z","updated_at":"2025-05-08T12:03:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f21e4fbd-9a19-4881-bea6-90f04e636d65","html_url":"https://github.com/mjsull/chromatiblock","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mjsull/chromatiblock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjsull%2Fchromatiblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjsull%2Fchromatiblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjsull%2Fchromatiblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjsull%2Fchromatiblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjsull","download_url":"https://codeload.github.com/mjsull/chromatiblock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjsull%2Fchromatiblock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285138471,"owners_count":27121052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-14T03:00:27.111Z","updated_at":"2025-11-18T21:01:05.017Z","avatar_url":"https://github.com/mjsull.png","language":"Python","funding_links":[],"categories":["Comparative"],"sub_categories":[],"readme":"# chromatiblock\n\n## Scalable, whole-genome visualisation of structural changes in prokaryotes\n![release](https://img.shields.io/github/v/release/mjsull/chromatiblock) ![license](https://img.shields.io/badge/license-GPLv3-green) [![DOI](https://zenodo.org/badge/97623186.svg)](https://zenodo.org/badge/latestdoi/97623186)\n\n\n\n### Installation \n\n#### Conda:\n\nTo create a fresh environment for chromatiblock to run in do:\n\n```\nconda create --name chromatiblock\nconda activate chromatiblock\nconda install chromatiblock --channel conda-forge --channel bioconda\n```\n\nThen in future to run chromatiblock you can reactivate this environment using ```conda activate chromatiblock```\n\n#### Direct download:\n\nAlternatively you can download and run the script from [here](https://github.com/mjsull/chromatiblock/releases/download/v1.0.0/chromatiblock).\n\n#### requirements:\n(these will be installed automatically if chromatiblock is installed with conda)\n\n- **Python \u003e= 3.6.0**\n\nWhile chromatiblock will run fine without the following programs, they are needed for certain tasks.\n\n- **Sibelia** - for automatic generation of colinear blocks\n- **cairosvg** - for creating PNG and PDF images (svg and html supported natively) \n- **ncbi-blast+** - for automatic annotation of genes\n- **svg-pan-zoom.min.js** - by default the html output uses an online javascript library for zoom functionality,\nthe -pz flag can be used to point to an offline location of svg-pan-zoom.\n\n### Example usage: \n`python chromatiblock -f genome1.fasta genome2.fasta .... genomeN.fasta -w cb_working_dir -o image.svg` \n\nWill run chromatiblock on the genomeN.fasta files and create an svg image of the output. Intermediate files will be created\nin `cb_working_dir`.\n\n\nor\n     \n`python chromatiblock -d /path/to/fasta_directory/ -w cb_working_dir -o image.html`\n\nWill run chromatiblock on all fasta or genbank files in `/path/to/fasta_directory/` and create an interactive webpage of the output. Intermediate files will be created\nin `cb_working_dir`.\n\n### Example output:\n\n[![chromatiblock](https://mjsull.github.io/chromatiblock/images/chromatiblock_main.gif)](https://mjsull.github.io/chromatiblock/C_difficile.html)\n\n#### An interactive HTML example can explored by clicking on the above figure.\n\nA tooltip will show block # and location when the mouse is hovered over a block. Other blocks of the same type will also be highlighted. Clicking on a block will show additional information, including the underlying sequence.\n\n### Figure description\n\nAn example of a global alignment of 28 complete *C. difficile* genomes is shown in the above figure. \n\n**TOP)** The global alignment view shows the arrangement of core blocks (i.e. syntenic regions found\nonce in all genomes) in the alignment and how non-core blocks (i.e syntenic regions found in 2 or\nmore genomes) and unique sequences (i.e. sequence found in a single genome) are arranged\nrelative to the core blocks. Core blocks are aligned according to their\narrangement in the first genome. The color of the core blocks for each genome is\ndetermined by its position. Between any two adjacent core blocks there exists a\ncombination of non-core blocks and unique sequence. This combination is grouped\nand positioned between the two core blocks to which they are adjacent. In\ninstances where the group cannot be placed between its two adjacent core blocks\nit is placed arbitrarily next to one of the core blocks to which it is\nadjacent. This is indicated by removing the gap between core and non-core\nblocks.\n\nIn top panel of the above figure a large inversion can be observed in the third isolate from the top, indicated by a difference in ordering of core block colors relative to the reference. \nPlasmids, found in 9 genomes, consist entirely of non-core and unique blocks. They are positioned on the right side of the figure. \n\n**BOTTOM)** The alignment difference view shows the presence and absence of all non-core\nblocks.Each genome is represented as a row and each non-core block is assigned a column in the order they are most commonly found in the genome.\nPresence of each non-core block is shown as a patterned rectangle in the genomes row. As non-core blocks may be present more than once, duplicates are shown by splitting the blocks according to repeat number.\nBlocks are coloured by user provided categories. \n\nThis example shows that the main\n*C. difficile* pathogenicity locus (PaLoc) that contains the genes encoding the\nTcdA enterotoxin and TcdB cytotoxin, has been lost in the sixth isolate from the bottom.\nSix isolates also contain a transposon carry-ing the erm(B) gene, encoding a 23S rRNA methyltransferase that confers resistance to erythromycin.\nThe erm(B)gene is also present in the seventh isolate from the bottom, but located on a novel transposon and inserted elsewhere in the genome.\n\n\n\n\n# Demo:\n\n\n### Simple demo (*H. pylori*):\n\n\n\nThis simple example uses 12 randomly selected complete *H. pylori* genome to demonstrate how to easily generate a chromatiblock webpage.\n\nFiles to generate the *H. pylori* example can be found [here](https://github.com/mjsull/chromatiblock/releases/download/v0.4.0/simple_demo.zip) (n.b. this dataset is a lot smaller and will run quicker).\n\nThe expected output of this example is available [here.](https://mjsull.github.io/chromatiblock/H_pylori.html)\n\nTo run: extract files to your current directory and then use the command\n\n`chromatiblock -d simple_demo -w cb_working_dir_simple -o H_pylori.html -l simple_demo/order_list.txt`\n\n**-d** - directory to look for fasta files\n\n**-w** - working directory location\n\n**-o** - output file, for an svg use .svg suffix\n\n**-l** - How to order fasta files in figure\n\nThen open H_pylori.html with your favourite browser.\n\n\n### Advanced demo (*C. difficile*)\n\nThis demo illustrates how to add gene symbols and colour blocks by categories. It uses 28 genomes generated as part of the pathogen surveillance program at Mount Sinai Hospital.\n\nFiles to generate the example figure can be found [here](https://github.com/mjsull/chromatiblock/releases/download/v0.4.0/advanced_demo.zip).\n\nTo run: extract files to your current directory and then use the command\n\n`chromatiblock -d advanced_demo -w cb_working_dir_advanced -o C_difficile.html -l advanced_demo/order_list.txt -gb advanced_demo/toxins.faa -c advanced_demo/categories.tsv`\n\n**-d** - directory to look for fasta files\n\n**-w** - working directory location\n\n**-o** - output file, for an svg use .svg suffix\n\n**-l** - How to order fasta files in figure\n\n**-gb** - Fasta file of proteins to annotate in genome, genes will be found using BLASTx\n\n**-c** - custom colours to use for bottom panel of figure\n\n\n## Arguments:\n\n\n\n``-h``, ``--help``\n\n\nshow this help message and exit\n\n___\n\n``-d``, ``--input_directory \u003c/path/to/fastas/\u003e``\n\n\nDirectory of fasta or genbank files to use as input (will ignore files without .fasta, .fa, .fna, .gb or .gbk suffixes).\n\n___\n\n``-l``, ``--order_list \u003clist_of_filenames.txt\u003e``\n\nfile containing list of filenames (one per line) in desired order\n\n___\n\n``-f``, ``--fasta_files \u003cgenome_1.fasta\u003e \u003cgenome_2.fasta\u003e .... \u003cgenome_x.fasta\u003e ``\n\nList of fasta/genbank files to use as input\n\n___\n\n``-w``, ``--working_directory \u003cworking_dir\u003e``\n\nFolder to write intermediate files.\n\n___\n\n``-s``, ``--sibelia_path \u003c/path/to/sibelia/\u003e``\n\nSpecify path to sibelia (does not need to be set if Sibelia binary is in path)\n\n___\n\n``-sm``, ``--sibelia_mode \u003cloose\u003e``\n\nmode for running sibelia \u003cloose|fine|far\u003e\n\n**default: loose**\n\n___\n\n``-o``, ``--out \u003coutfile.svg\u003e``\n\nLocation to write output (options \\*.svg/\\*.html/\\*.png/\\*.pdf) will default to svg (and add extension). (n.b. PDF does not work particularly well all the time)\n\n___\n\n``-q``, ``--ppi \u003cinteger\u003e``\n\npixels per inch (only used for png, figure width is 8 inches)\n\n**default: 50**\n\n___\n\n``-m``, ``--min_block_size \u003cinteger\u003e``\n\nMinimum size of syntenic block to display.\n\n**default: 1000bp**\n\n___\n\n``-c``, ``--categorise \u003ccategories.txt\u003e``\n\ncolor blocks by category\n\nprovide a file where each line contains\n\n```\u003cgenome.fasta\u003e    \u003cfasta_header\u003e    \u003ccategory_name\u003e   \u003cstart\u003e   \u003cstop\u003e```\n\ne.g.\n\n```\ngenome_1.fasta    contig_1    phage    50000 100000\ngenome_2.fasta    contig_1    phage    80000    120000\ngenome_2.fasta    contig_2    plasmid\ngenome_3.fasta    contig_2    plasmid\ngenome_3.fasta    contig_1    transposon 100000 105000\n```\n\n\nnon-core blocks in panel B will be colored according to category if at least 50% falls within a specified range. Start and stop columns are optional.\n\n___\n\n``-gb``, ``--genes_of_interest_blast \u003cgenes.faa\u003e``\n\nUses BLASTx to find genes in chromosome and then marks them in panel a and b with a triangle\n\n___\n\n``-gf``, ``--genes_of_interest_file \u003cgenes.txt\u003e``\n\nmark genes of interest using a list\n\n\nprovide a file where each line contains\n\n\n```\u003cgenome.fasta\u003e    \u003cfasta_header\u003e    \u003cgene_name\u003e   \u003cstart\u003e```\n\ne.g.\n```\ngenome_1.fasta    contig_1    mrcA    50000\ngenome_2.fasta    contig_1    mrcA    80000\ngenome_2.fasta    contig_2    hlb    20000\n```\n\n___\n\n``-gh``, ``--genome_height \u003cint\u003e``\n\nHeight of genome blocks in pixels\n\n**default: 280**\n\n___\n\n``-vg``, ``--gap \u003cint\u003e``\n\ngap between genomes\n\n**default: 20**\n\n___\n\n``-ss``, ``--skip_sibelia``\n\nUse sibelia output already in working directory\n\n___\n\n``-sb``, ``--skip_blast``\n\nuse existing BLASTx file for annotation (must use with -gb flag)\n\n___\n\n``-maf``, ``--maf_alignment \u003calignment.maf\u003e``\n\nuse a maf file for multiple alignment instead of Sibelia. MAF files can be produced by SibeliaZ and Mugsy.\n\n___\n\n``-pz``, ``--svg_pan_zoom_location``\n\nLocation of the svg-pan-zoom javascript library, this can be set to an offline location, or a directory relative to the html.\n\n**default: http://ariutta.github.io/svg-pan-zoom/dist/svg-pan-zoom.min.js**\n\n___\n\n``-hs``, ``--hue_start``\n\nHue of core blocks at the start of the genome.\n\n___\n\n``-he``, ``--hue_end``\n\nHue of core blocks at the end of the genome.\n\n___\n\n``-v``, ``--version``\n\nprint version and exit.\n\n___\n\n``-e``, ``--extension``\n\nWhen -d is used for input files, chromatiblock will check against this comma seperated list to determine whether to add file to the list of input sequences.\n\n**defaul: fasta,fa,fna,gbk,gb**\n___\n\n``-of``, ``--output_format``\n\nfile format to write to, if all is selected --out will be a prefix and extension will be added\n\nvalid formats are html, svg, png, pdf, all\n\nall will create a svg, png and pdf\n\n___\n\n``-t``, ``--add_labels``\n\nAdd the fasta names as labels. \n\n\n___\n\n``--force``\n\noverwrite working directory and output\n\n___\n\n``--keep``\n\nkeep working directory, desciption of intermediate files created by Sibelia can be found here https://github.com/bioinf/Sibelia/blob/master/SIBELIA.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjsull%2Fchromatiblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjsull%2Fchromatiblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjsull%2Fchromatiblock/lists"}