{"id":20387044,"url":"https://github.com/cmdcolin/mafviewer","last_synced_at":"2025-04-12T10:07:07.949Z","repository":{"id":137213244,"uuid":"75589692","full_name":"cmdcolin/mafviewer","owner":"cmdcolin","description":"A JBrowse plugin to view multiple alignment format (MAF) files","archived":false,"fork":false,"pushed_at":"2023-10-25T00:21:18.000Z","size":84026,"stargazers_count":26,"open_issues_count":11,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T10:05:03.143Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmdcolin.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-05T04:48:23.000Z","updated_at":"2024-03-20T13:31:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"30669551-3afb-4a90-91dd-29bd420722be","html_url":"https://github.com/cmdcolin/mafviewer","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fmafviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fmafviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fmafviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fmafviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdcolin","download_url":"https://codeload.github.com/cmdcolin/mafviewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550634,"owners_count":21122933,"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","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":"2024-11-15T02:42:24.505Z","updated_at":"2025-04-12T10:07:07.932Z","avatar_url":"https://github.com/cmdcolin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mafviewer\n\nA JBrowse 1 plugin for viewing multiple alignments. \n\nNote: See https://github.com/cmdcolin/jbrowse-plugin-mafviewer for JBrowse 2 version!\n\n\n## Prepare data\n\nThis program supports two formats\n\n1. BigMaf format, which can be created following UCSC guidelines\n\n2. MAF tabix based format, based on a custom BED created via conversion tools in this repo.\n\nThe choice between the two is your convenience. BigMaf is a \"standard\" UCSC format, basically just a specialized BigBed, so it requires JBrowse 1.14.0 or newer for it's BigBed support. The custom BED format only requires JBrowse 1.12.3 or newer, so therefore some slightly older JBrowse versions can support it.\n\n*Note: Both formats start with a MAF as input, and note that your MAF file should contain the species name and chromosome name e.g. hg38.chr1 in the sequence identifiers.*\n\n### Preparing BigMaf\n\nFollow instructions from https://genome.ucsc.edu/FAQ/FAQformat.html#format9.3 and set the storeType of your track as MAFViewer/Store/SeqFeature/BigMaf\n\n\n### Preparing the tabix BED format\n\nStart by converting the MAF into a pseudo-BED format by calling bin/maf2bed.pl\n\n    bin/maf2bed.pl hg38 \u003c file.maf \u003e output.txt\n    bgzip output.txt\n    tabix -p bed output.txt.gz\n\nNote: currently assumes space separated MAF, not tab separated. If you have tab separated, can add a 'sed' command in pipe\n\n    cat file.maf | sed -e 's/\\t/ /g | ./maf2bed.pl hg38 | bgzip \u003e out.txt.gz\n\nThe second argument to maf2bed.pl is the genome version e.g. hg38 used for the main species in the MAF (if your MAF comes from a pipeline like Ensembl or UCSC, the identifiers in the MAF file will say something like hg38.chr1, therefore, the argument to maf2bed.pl should just be hg38 to remove hg38 part of the identifier. if your MAF file does not include the species name as part of the identifier, you should add the species into them the those scaffold/chromosome e.g. create hg38.chr1 if it was just chr1 before)\n\nIf all is well, your BED file should have 6 columns, with `chr, start, end, id, score, alignment_data`, where `alignment_data` is separated between each species by `;` and each field in the alignment is separated by `:`.\n\nNote: you can also stream from a gzipped MAF to the bgzipped bed\n\n    gunzip -c chr21.maf.gz | bin/maf2bed.pl hg38 | bgzip \u003e output.txt.gz\n\nThe bin/convert.sh script has a small automatic processing from maf to bgzipped, tabixed, bed.\n\n## Options\n\n\n- samples - an array of species in the MAF file (e.g. hg38, mm10, etc.)\n- labelWidth - an integer width for labels (default: 100)\n- style.matchColor - color to use for matches (default: green)\n- style.mismatchColor - color to use for mismatches (default: blue)\n- style.gapColor - color to use for gaps in alignment (default: red)\n- style.mismatchBases - set to true, then you can set style.mismatchA, style.mismatchG, style.mismatchC, style.mismatchT as needed\n- storeClass - set to MAFViewer/Store/SeqFeature/MAFTabix or MAFViewer/Store/SeqFeature/BigMaf\n\n\nNote: samples can be the array of strings like [\"hg38\",\"mm10\"] or an array of extended JSON structures in order to customize the subtrack labels e.g. `{\"id\": \"hg38\", \"label\": \"Human\", \"description\": \"Extended description of species\", \"color\": \"rgb(255,255,0)\" }`\n\n## Example config\n\n    {\n      \"label\": \"MAF\",\n      \"urlTemplate\": \"chrI.txt.gz\",\n      \"storeClass\": \"MAFViewer/Store/SeqFeature/MAFTabix\",\n      \"type\": \"MAFViewer/View/Track/MAF\",\n      \"samples\": [\n        \"cb4\",\n        \"caeRem4\",\n        \"caePb3\",\n        \"caeSp111\",\n        \"caeJap4\"\n      ]\n    }\n\n## Screenshot\n\n[![](img/1.png)](https://raw.githubusercontent.com/cmdcolin/mafviewer/master/img/1.png)\n\nFor comparison this is the same region in UCSC browser ([picture](https://raw.githubusercontent.com/cmdcolin/mafviewer/master/img/2.png)) ([link](https://genome.ucsc.edu/cgi-bin/hgTracks?hgS_doOtherUser=submit\u0026hgS_otherUserName=cdiesh\u0026hgS_otherUserSessionName=hg38))\n\n## Installation\n\n\nDownload to the plugins/MAFViewer and add to your config file with\n\n    \"plugins\": [\"MAFViewer\"]\n\nSee JBrowse FAQ on installing plugins\n\n\n## Demo\n\nThe test/ directory contains sample data for C. Elegans (from UCSC), Human (from UCSC), Medaka (from Ensembl).\n\nVisit http://localhost/jbrowse/?data=plugins/MAFViewer/test/data or http://localhost/jbrowse/?data=plugins/MAFViewer/test/medaka or http://localhost/jbrowse/?data=plugins/MAFViewer/test/hg38 to view\n\n\n## Pairwise alignment\n\nYou can obtain MAF output from `lastz` using `--format=maf` and then use mafviewer to compare two different genomes\n\nYou can also obtain MAF from `mummer` by converting the outputted .delta file to MAF with the delta2maf program (not distributed in the latest mummer versions, you can obtain delta2maf by downloading mugsy from sourceforge and finding delta2maf inside their version of mummer. Then run `delta2maf yourfile.delta \u003e yourfile.maf` note that delta2maf assumes the fasta files are located where the .delta line 1 says they are)\n\nImportant: if using MAF files from lastz or mummer here, you should edit the MAF to include the organisms name pre-pended onto the chromosome names, e.g. if it says chr1, add \"human.chr1\" where relevant. Then the bin/maf2bed.pl program included in this package can be run with `bin/maf2bed.pl human \u003c yourfile.maf \u003e output.bed` which then strips the \"human\" part of the chromosome identifiers again\n\n## Multiple alignment\n\nFor performing multiple alignment, https://github.com/medvedevgroup/SibeliaZ is an option\n\nAlternatively, you can use the classic TBA/Multiz pipeline from UCSC, e.g. http://shiulab.plantbiology.msu.edu/index.php?title=SyntenicBlocks. I have not evaluated either of these pipelines, but the main goal is that resulting alignments must be non-overlapping for mafviewer to properly display them\n\n## Notes\n\nRequires JBrowse 1.12.3 or later for BEDTabix functionality\n\nRequires the alignment chunks to be non-overlapping (it will plot overlapping chunks of the MAF file over each other on the same line see https://github.com/cmdcolin/mafviewer/issues/7)\n\nFeel free to provide feedback!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Fmafviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdcolin%2Fmafviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Fmafviewer/lists"}