{"id":17652265,"url":"https://github.com/zyxue/vr2c","last_synced_at":"2025-03-30T08:43:28.527Z","repository":{"id":141946753,"uuid":"145336351","full_name":"zyxue/vr2c","owner":"zyxue","description":"Visualize read-to-contig alignment during assembly analysis ","archived":false,"fork":false,"pushed_at":"2018-08-23T21:23:01.000Z","size":68,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T10:50:21.308Z","etag":null,"topics":["alignment","contig-coverage","contigs","genome-assembly","read-to-contig-alignment","transcriptome-assembly"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zyxue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-08-19T20:45:49.000Z","updated_at":"2022-09-26T02:14:24.000Z","dependencies_parsed_at":"2023-03-13T10:27:03.073Z","dependency_job_id":null,"html_url":"https://github.com/zyxue/vr2c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyxue%2Fvr2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyxue%2Fvr2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyxue%2Fvr2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyxue%2Fvr2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyxue","download_url":"https://codeload.github.com/zyxue/vr2c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296583,"owners_count":20754632,"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":["alignment","contig-coverage","contigs","genome-assembly","read-to-contig-alignment","transcriptome-assembly"],"created_at":"2024-10-23T11:46:24.020Z","updated_at":"2025-03-30T08:43:28.514Z","avatar_url":"https://github.com/zyxue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VR2C\n\nVisualize read-to-contig alignment.\n\n**NOTE**: This package needs Python-3.6, and is still very rough around the\ncorners, but I just put it earlier in case anyone would like to contribute.\n\n### Motivation\n\nVisualizing read-to-contig alignment could be difficult because the number of\ncontigs could be huge compared to a typical genome, which has only a few dozens\nof contigs/chromosomes. It may be difficult to index the contig FASTA file and\nload it into a genome browser like\n[IGV](http://software.broadinstitute.org/software/igv/).\n\n\n### Usage\n\n```\nvr2c --contigs-to-genome test_data/c2g.sorted.bam --reads-to-contigs test_data/r2c_sorted.bam --contig-id [contig-id] --seqname [chromosome] --positions [positions]\n```\n\nOr equivalently\n\n```\nvr2c -c test_data/c2g.sorted.bam -r test_data/r2c_sorted.bam -t [contig-id] -s [chromosome] -p [positions]\n```\n\nBy default it will save the output in `[chromosome]_[contig_id]_[positions].png`, or you\ncould change the output file name by specifying `--output/-o`.\n\n```\nvr2c --help\nusage: vr2c [-h] -c CONTIGS_TO_GENOME -r READS_TO_CONTIGS -t CONTIG_ID -s\n            SEQNAME -p POSITIONS [POSITIONS ...] [--figure-width FIGURE_WIDTH]\n            [--seqname-beg-end SEQNAME_BEG_END SEQNAME_BEG_END] [-o OUTPUT]\n\nplot r2c and c2g in one coordinate\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONTIGS_TO_GENOME, --contigs-to-genome CONTIGS_TO_GENOME\n                        input contig-to-genome alignment BAM file\n  -r READS_TO_CONTIGS, --reads-to-contigs READS_TO_CONTIGS\n                        input read-to-contig alignment BAM file\n  -t CONTIG_ID, --contig-id CONTIG_ID\n                        contig id, e.g. A1.J70460\n  -s SEQNAME, --seqname SEQNAME\n                        e.g. chr12. This is required because one contig could\n                        be aligned to two chromosomes, e.g. hardclipping\n  -p POSITIONS [POSITIONS ...], --positions POSITIONS [POSITIONS ...]\n                        plot vertical lines for intended positions. e.g.\n                        cleavage site\n  --figure-width FIGURE_WIDTH\n                        figure width, default to 16 based on experience\n  --seqname-beg-end SEQNAME_BEG_END SEQNAME_BEG_END\n                        if specified, the beginning and ending of the plot on\n                        the chromosome are enforced, e.g. [25357088, 25357993]\n  -o OUTPUT, --output OUTPUT\n                        default to be \u003ccontig_id\u003e.png\n```\n\n### An example use case\n\nOutput:\n```\n$ vr2c -c test_data/c2g.sorted.bam -r test_data/r2c_sorted.bam -t E1.L.4362 -s chr16 -p 23698789\n2018-08-23 14:09:09,598|INFO|c2g_bam_file: test_data/c2g.sorted.bam\n2018-08-23 14:09:09,598|INFO|r2g_bam_file: test_data/r2c_sorted.bam\n329275it [00:00, 470121.10it/s]\n2018-08-23 14:09:10,361|INFO|contig.query_name: E1.L.4362\n2018-08-23 14:09:10,361|INFO|contig.is_reverse: False\n2018-08-23 14:09:10,362|INFO|contig.cigarstring: 501M743N169M661N145M1005N94M1712N220M3379N156M1043N78M492N155M101N183M183N508M13S\n2018-08-23 14:09:10,362|INFO|contig.reference_start: 23690160\n2018-08-23 14:09:10,362|INFO|contig.reference_end: 23701688\n2018-08-23 14:09:10,811|INFO|found 17779 reads; randomly pick 100\n```\n\nGenerated plot:\n\n![img](./test_data/example.png)\n\n*Legend*:\n\n1. shown in the bottom is the contig\n1. green are regular reads\n1. yellow is softclip\n1. red is hardclip (not available in this example)\n1. introns are skipped and the distance between neighbouring exons are not to scale\n\n### A few TODOs\n\n1. currently, it only plot the first 100 reads per contig by default, need to make it adjustable\n1. calculate figure size more properly, currently there could be excessive top margin as seen from above.\n1. choose matplotlib backend accordingly\n1. write tests\n\n\n### Development\n\n```\nvirtualenv venv\n. venv/bin/activate\n\npython setup.py develop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyxue%2Fvr2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyxue%2Fvr2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyxue%2Fvr2c/lists"}