{"id":22795132,"url":"https://github.com/dmalzl/genomap","last_synced_at":"2025-10-13T05:12:43.507Z","repository":{"id":139731137,"uuid":"379885093","full_name":"dmalzl/genomap","owner":"dmalzl","description":"An easy to use tool to generate heatmap like tracks for the UCSC Genome Browser","archived":false,"fork":false,"pushed_at":"2021-06-24T15:15:56.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T08:55:33.520Z","etag":null,"topics":["bioinformatics","hacking","ucsc-browser"],"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/dmalzl.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":"2021-06-24T10:20:14.000Z","updated_at":"2021-06-25T09:37:39.000Z","dependencies_parsed_at":"2023-05-06T15:31:22.650Z","dependency_job_id":null,"html_url":"https://github.com/dmalzl/genomap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmalzl/genomap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmalzl%2Fgenomap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmalzl%2Fgenomap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmalzl%2Fgenomap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmalzl%2Fgenomap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmalzl","download_url":"https://codeload.github.com/dmalzl/genomap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmalzl%2Fgenomap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013695,"owners_count":26085390,"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-10-13T02:00:06.723Z","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":["bioinformatics","hacking","ucsc-browser"],"created_at":"2024-12-12T04:13:34.349Z","updated_at":"2025-10-13T05:12:43.493Z","avatar_url":"https://github.com/dmalzl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# genomap\nAn easy to use tool to generate heatmap like tracks for the UCSC Genome Browser\n\n## Setting up the work envrionment\nIn order to use `genomap.py` you will need a working Python 3 including [`pandas`](https://pandas.pydata.org/), [`matplotlib`](https://matplotlib.org/), [`numpy`](https://numpy.org/) and [`pyBigWig`](https://github.com/deeptools/pyBigWig). The most straightforward way to get this, is to download and install [`miniconda`](https://docs.conda.io/en/latest/miniconda.html) and use the `environment.yml` file to generate a virtual environment containing everything we need.\n```bash\ngit clone https://github.com/dmalzl/genomap.git\ncd genomap\nconda env create -f environment.yml\nconda activate genomapy\n```\n\n## Generating a bigWig file from your BAMs\nThe easiest way to generate a bigWig file from your alignments is to use the [deepTools](https://deeptools.readthedocs.io/en/develop/index.html) suites [`bamCoverage`](https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html)\n```bash\nbamCoverage -b \u003cinputBAM\u003e \\\n            -o \u003coutputFileName\u003e \\\n            -of bigwig \\\n            -bs 5000 \\\n            -p 16 \\\n            --ignoreDuplicates \\\n            --normalizeUsing CPM \\\n            --exactScaling\n```\nThis will generate a coverage track with a 5kb tiling normalized to counts per million over the genome from your input BAM file.\n\n## Converting bigWig file to bedGraph with UCSC suitable RGB column\nNow that we have our bigWig file, the next step is to generate a UCSC compatible bedGraph with an itemRGB column. This is done using the `genomap.py` script and is invoked as follows:\n```bash\n./genomap.py -i \u003cbigwigFile\u003e \\\n           -bs 5000 \\\n           --vmin 0 \\\n           --vmax p75 \\\n           --colormap coolwarm \\\n           -o \u003coutputBedGraph\u003e\n```\nThis will turn the bigwig into a bedGraph containing 9 columns including the itemRGB column which encodes the bigWig values as RGB colors for the UCSC genome browser.\n\n## Converting bedGraph to bigBed\nThe last step is to convert the bedGraph to it's binary twin the bigBed. This is done using the [UCSC kentUtils](https://github.com/ENCODE-DCC/kentUtils) suite. Note that you need\n```bash\ncat \u003cbedGraphFile\u003e | sort -k1,1 -k2,2n \u003e \u003csortedBedGraph\u003e\nbedToBigBed \u003csortedBedGraph\u003e chrom.sizes \u003coutputBigBed\u003e\n```\nThe chrom.sizes file is a generic tab-separated file containing two columns describing the name and the size of the chromosomes contained in the bedGraph file. This will also generate a PDF containing the colorbar corresponding to the colors in the itemRGB, which will be saved in the same directory as the outputBedGraph. Alternatively, one can use the `--colorbarFile` parameter to set a filepath manually.\n\n## Add to TrackHub on UCSC\nThe last step is to add the generated bigBed to you UCSC TrackHub using the following directives\n```\ntrack \u003ctrackName\u003e\nshortLabel      \u003ctrackShortLabel\u003e\nlongLabel       \u003ctrackLongLabel\u003e\nbigDataUrl      \u003cpath/to/bigBed\u003e\nitemRgb         on\ntype    bigBed 9 .\n```\n\n# General comment on usage\nThe UCSC Genome Browser is an online tool to display sequencing an other related data. The versatility also brings some caveats such as a requirement for restriction of colorspace in cases of the itemRGB column of bigBed files as well as the number of regions that can simultaneously be displayed, which seems to be restricted to 1000 regions. Thus, a general point for consideration is the size of the regions one wants to view on the browser, since the heatmap will turn black for regions that span more than 1000 bigBed bins. An example would be as follows:\n\nConsider viewing a 10Mb region on would need at least a binsize of 10,000,000 / 1,000 = 10,000 in order to be able to enjoy the colored version of the bigBed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmalzl%2Fgenomap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmalzl%2Fgenomap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmalzl%2Fgenomap/lists"}