{"id":20386961,"url":"https://github.com/cmdcolin/jbrowse-plugin-mafviewer","last_synced_at":"2025-04-12T10:02:05.266Z","repository":{"id":203016328,"uuid":"706806710","full_name":"cmdcolin/jbrowse-plugin-mafviewer","owner":"cmdcolin","description":"A viewer for multiple alignment format (MAF) files in JBrowse 2","archived":false,"fork":false,"pushed_at":"2025-02-12T22:45:50.000Z","size":63294,"stargazers_count":12,"open_issues_count":20,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T04:51:10.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-18T16:47:54.000Z","updated_at":"2025-03-23T19:43:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b0d5dca-8bcb-43f0-83b8-1321444f5c4d","html_url":"https://github.com/cmdcolin/jbrowse-plugin-mafviewer","commit_stats":null,"previous_names":["cmdcolin/jbrowse-plugin-mafviewer"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fjbrowse-plugin-mafviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fjbrowse-plugin-mafviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fjbrowse-plugin-mafviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdcolin%2Fjbrowse-plugin-mafviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdcolin","download_url":"https://codeload.github.com/cmdcolin/jbrowse-plugin-mafviewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550624,"owners_count":21122932,"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:41:47.148Z","updated_at":"2025-04-12T10:02:05.249Z","avatar_url":"https://github.com/cmdcolin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jbrowse-plugin-mafviewer\n\nA viewer for multiple alignment format (MAF) files in JBrowse 2\n\nThis is a port of the JBrowse 1 plugin https://github.com/cmdcolin/mafviewer to\nJBrowse 2\n\n![](img/1.png)\n\n## Demo\n\nhttps://jbrowse.org/code/jb2/main/?config=%2Fdemos%2Fmaf%2Fhg38%2Fdistconfig.json\u0026session=share-jREsrEm0Q-\u0026password=fRZjQ\n\n## GUI usage (e.g. in JBrowse Desktop)\n\nThis short screenshot workflow shows how you can load your own custom MAF files\nvia the GUI\n\nFirst install the plugin via the plugin store\n\n![](img/3.png)\n\nThen use the custom \"Add track workflow\"\n\n![](img/2.png)\n\n## Manual config entry\n\n### Add plugin to your jbrowse 2 config.json\n\n```json\n{\n  \"plugins\": [\n    {\n      \"name\": \"MafViewer\",\n      \"url\": \"https://unpkg.com/jbrowse-plugin-mafviewer/dist/jbrowse-plugin-mafviewer.umd.production.min.js\"\n    }\n  ]\n}\n```\n\n### Example MafTabixAdapter config\n\ncan use nhLocation or samples array on adapter\n\n```json\n{\n  \"type\": \"MafTrack\",\n  \"trackId\": \"chrI.bed\",\n  \"name\": \"chrI.bed\",\n  \"adapter\": {\n    \"type\": \"MafTabixAdapter\",\n    \"samples\": [\"ce10\", \"cb4\", \"caeSp111\", \"caeRem4\", \"caeJap4\", \"caePb3\"],\n    \"bedGzLocation\": {\n      \"uri\": \"chrI.bed.gz\"\n    },\n    \"index\": {\n      \"location\": {\n        \"uri\": \"chrI.bed.gz.tbi\"\n      }\n    }\n  },\n  \"assemblyNames\": [\"c_elegans\"]\n}\n```\n\n### Example BigMafAdapter config\n\ncan use nhLocation or samples array on adapter\n\n```json\n{\n  \"type\": \"MafTrack\",\n  \"trackId\": \"bigMaf\",\n  \"name\": \"bigMaf (chr22_KI270731v1_random)\",\n  \"adapter\": {\n    \"type\": \"BigMafAdapter\",\n    \"samples\": [\n      \"hg38\",\n      \"panTro4\",\n      \"rheMac3\",\n      \"mm10\",\n      \"rn5\",\n      \"canFam3\",\n      \"monDom5\"\n    ],\n    \"bigBedLocation\": {\n      \"uri\": \"bigMaf.bb\"\n    }\n  },\n  \"assemblyNames\": [\"hg38\"]\n}\n```\n\n### Example BgzipTaffyAdapter config\n\nNote: TAF files are actually significantly slower and has known bugs...will\nupdate once fixed\n\nThis notice will be removed it it is improved\n\nAs with other adapters, you can use nhLocation or samples array on adapter\n\n```json\n{\n  \"type\": \"MafTrack\",\n  \"trackId\": \"bigMaf\",\n  \"name\": \"taffy\",\n  \"adapter\": {\n    \"type\": \"BgzipTaffyAdapter\",\n    \"nhLocation\": {\n      \"uri\": \"hg38.30way.nh\"\n    },\n    \"tafGzLocation\": {\n      \"uri\": \"30way.taf.gz\"\n    },\n    \"taiGzLocation\": {\n      \"uri\": \"30way.taf.gz.tai\"\n    }\n  },\n  \"assemblyNames\": [\"hg38\"]\n}\n```\n\n### Example with customized sample names and colors\n\n```json\n{\n  \"trackId\": \"MAF\",\n  \"name\": \"example\",\n  \"type\": \"MafTrack\",\n  \"assemblyNames\": [\"hg38\"],\n  \"adapter\": {\n    \"type\": \"MafTabixAdapter\",\n    \"bedGzLocation\": {\n      \"uri\": \"data.txt.gz\"\n    },\n    \"index\": {\n      \"location\": {\n        \"uri\": \"data.txt.gz.tbi\"\n      }\n    },\n    \"samples\": [\n      {\n        \"id\": \"hg38\",\n        \"label\": \"Human\",\n        \"color\": \"rgba(255,255,255,0.7)\"\n      },\n      {\n        \"id\": \"panTro4\",\n        \"label\": \"Chimp\",\n        \"color\": \"rgba(255,0,0,0.7)\"\n      },\n      {\n        \"id\": \"gorGor3\",\n        \"label\": \"Gorilla\",\n        \"color\": \"rgba(0,0,255,0.7)\"\n      },\n      {\n        \"id\": \"ponAbe2\",\n        \"label\": \"Orangutan\",\n        \"color\": \"rgba(255,255,255,0.7)\"\n      }\n    ]\n  }\n}\n```\n\nThe samples array is either `string[]|{id:string,label:string,color?:string}[]`\n\n## Creating MAF files as Cactus pangenome/HAL\n\nYou can create a MAF file from a Cactus pangenome graph using\nComparativeGenomeToolkit\n\nThis page discusses some examples\n\nhttps://github.com/ComparativeGenomicsToolkit/cactus/blob/master/doc/progressive.md#maf-export\n\nThanks to Sam Talbot (https://github.com/SamCT) for initially creating the\nCactus -\u003e JBrowse 2 MAF example\n\nPlease note that MAFViewer wants non-overlapping blocks, please check if this is\nthe case\n\n## Prepare data\n\n1. BigMaf format, which can be created following UCSC guidelines\n   (https://genome.ucsc.edu/FAQ/FAQformat.html#format9.3)\n\n2. MAF tabix based format, based on a custom BED created via conversion tools in\n   this repo (see maf2bed)\n\n3. TAF format (new!). Currently only supports bgzip'd TAF. This is pioneered by\n   https://github.com/ComparativeGenomicsToolkit/taffy\n\n_Note: All these formats generally start with a MAF as input. Note that your MAF\nfile should contain the species name and chromosome name e.g. hg38.chr1 in the\nsequence identifiers._\n\n### Option 1. Preparing BigMaf\n\nFollow instructions from https://genome.ucsc.edu/FAQ/FAQformat.html#format9.3\n\n### Option 2. Preparing MAF tabix\n\nStart by converting the MAF into a pseudo-BED format using the maf2bed tool\n\n```bash\n# from https://github.com/cmdcolin/maf2bed\ncargo install maf2bed\ncat file.maf | maf2bed hg38 | sort -k1,1 -k2,2n | bgzip \u003e out.bed.gz\ntabix out.bed.gz\n```\n\nThe second argument to maf2bed is the genome version e.g. hg38 used for the main\nspecies in the MAF (if your MAF comes from a pipeline like Ensembl or UCSC, the\nidentifiers in the MAF file will say something like hg38.chr1, therefore, the\nargument to maf2bed should just be hg38 to remove hg38 part of the identifier.\n\nIf your MAF file does not include the species name as part of the identifier,\nyou should add the species into them the those scaffold/chromosome e.g. create\nhg38.chr1 if it was just chr1 before)\n\nIf all is well, your BED file should have 6 columns, with\n`chr, start, end, id, score, alignment_data`, where `alignment_data` is\nseparated between each species by `;` and each field in the alignment is\nseparated by `:`.\n\nNote: If you can't use the `cargo install maf2bed` binary, there is a\n`bin/maf2bed.pl` perl version of it in this repo\n\n### Option 3. Preparing TAF\n\nFollow steps from https://github.com/ComparativeGenomicsToolkit/taffy\n\n```\ntaffy view -i chr22.maf -o chr22.taf\nbgzip chr22.taf\ntaffy index -i chr22.taf.gz\n```\n\nThe above workflow requires that taffy is built with \"htslib support\"\n\nNote that the TAF support is beta, let me know if you run into any issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Fjbrowse-plugin-mafviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdcolin%2Fjbrowse-plugin-mafviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdcolin%2Fjbrowse-plugin-mafviewer/lists"}