{"id":19427132,"url":"https://github.com/anergictcell/wigfiles","last_synced_at":"2026-05-15T00:40:41.615Z","repository":{"id":6613336,"uuid":"7856786","full_name":"anergictcell/Wigfiles","owner":"anergictcell","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-21T05:21:17.000Z","size":1104,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T09:09:05.794Z","etag":null,"topics":["chip-seq","rna-seq","wig"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/anergictcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-27T19:23:45.000Z","updated_at":"2017-02-20T05:45:59.000Z","dependencies_parsed_at":"2022-09-12T07:01:33.912Z","dependency_job_id":null,"html_url":"https://github.com/anergictcell/Wigfiles","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/anergictcell%2FWigfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anergictcell%2FWigfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anergictcell%2FWigfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anergictcell%2FWigfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anergictcell","download_url":"https://codeload.github.com/anergictcell/Wigfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240605841,"owners_count":19827985,"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":["chip-seq","rna-seq","wig"],"created_at":"2024-11-10T14:10:32.264Z","updated_at":"2026-05-15T00:40:41.574Z","avatar_url":"https://github.com/anergictcell.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WigReader\n\n## A library for working with ChIP-seq or RNA-seq data in .wig file format\n\n### Use at your own risk!\nThe library was created many years ago and was actually my first Ruby project. Thus it's not written too well and its definitely not the best tool for the job nowadays. However, it does work if you have the correct files. It doesn't include much error-checking, so while it checks the most common errors, there is a small change you might end up with the program crashing after a 4hour analysis..... \n\n\n### WigReader\nA small class to parse and index .wig files. Can be used to retrieve custom signal profiles. \n\nIn order to run efficiently, you need to have enough RAM. It reads the whole .wig file into memory, so you should have more RAM than the size of your .wig file.\n\nSince it's reading the whole file into memory, it only makes sense to use if you need it to return FPKMs of many areas at once.\n\nGeneral usage:\n```Ruby\nwig = WigReader.new(path/to/wig/file)\n\n# read all data into the Hash at once\nwig.read\n\n# return fpkm value of a specified region\nwig.fpkm(:chr =\u003e \"chr1\", :start =\u003e 10034, :ending =\u003e 123534) # =\u003e 2034.245\n\n# return profile of given coordinates\nwig.profile(:chr =\u003e \"chr1\", :start =\u003e 10034 :ending =\u003e 123534) # =\u003e [50.0, 100.0, ... , 100.0]\n```\n\nIf you are worried about the script crashing, you can read in the wig file with a progress bar. It will noticeable slow down the parsing though.\n```Ruby\nwig = WigReader.new(path/to/wig/file)\nwig.read_with_progress(\u003ctype\u003e)\n\n# Output each new chromosome during parsing (default)\nwig.read_with_progress(\"chr\")\n\n# Output the percentage of parsed data\nwig.read_with_progress(\"percent\")\n```\n\nTesting is done via `test.rb`.\n\n### geneProfile.rb\nCalculates the FPKM profiles of genomic areas. \nTakes each given area, divides it into equal bins, then calculates the fpkm value for each bin.\n\nGeneral usage:\n```Bash\ngeneProfile.rb [source-wig-file] [areas-bed-file] [output-file]\n\ngeneProfile.rb ./H3K4me3.wig ./Protein.coding.genes.bed ./Protein.coding.gened.profiles.tsv\n```\nSome settings can be modified inside of the script:\n`TSS_OUTSIDE` : Number of bp upstream of TSS that will be included for the promoter (Default: 1000)\n`TSS_INSIDE` : Number of bp downstream of TSS (inside genebody) that will be included for the promoter (Default: 1000)\nDefault Promoter: TSS +/- 1 kb\n`TTS_OUTSIDE` : Number of bp downstream of TTS that will be included for transcriptional termination site (Default: 1000)\n`TTS_INSIDE` : Number of bp upstream of TTS (inside genebody) that will be included for transcriptional termination site (Default: 1000)\nDefault TTS: TTS +/ 1 kb\n\nBased on the standard settings, the first and last 1 kb of the genebody will NOT be included in the genebody, but only in the TSS and TTS.\n\n`TSS_BINS`, `TTS_BINS` : Defines in how many bins the promoter and TTS areas will be split for profile calculation (Default: 20)\n`GENEBODY_BINS` : Defines in how many bins the genebody will be split (Default: 40)\n\n### make_exons.rb\nDocumentation TBA\n\n### make_genebody.rb\nDocumentation TBA\n\n### make_tss.rb\nDocumentation TBA\n\n### tssProfile.rb\nCalculates the FPKM profiles of promoters (TSS)\nTakes each given gene, divides the promoter area into equal bins, then calculates the fpkm value for each bin.\n\nGeneral usage:\n```Bash\ntssProfile.rb [source-wig-file] [areas-bed-file] [output-file]\n\ntssProfile.rb ./H3K4me3.wig ./Protein.coding.genes.bed ./Protein.coding.gened.profiles.tsv\n```\nSome settings can be modified inside of the script:\n`TSS_OUTSIDE` : Number of bp upstream of TSS that will be included for the promoter (Default: 3000)\n`TSS_INSIDE` : Number of bp downstream of TSS (inside genebody) that will be included for the promoter (Default: 3000)\nDefault Promoter: TSS +/- 3 kb\n`TSS_BINS` : Defines in how many bins the promoter and TTS areas will be split for profile calculation (Default: 80)\n\n\n### normalize_wigs.rb\nscript to convert raw values in .wig files to fpkm values. This script only works with a special folder strucure that is explained in the script.\nThe calculations are not floating-number-safe. If your data is sensitive to those errors, do NOT use this tool.\n\n\n### subtract_wigs.rb\nscript to subtract values from one .wig file from values of another. Good to remove background noise, like IgG. The data is subtracted, not divided! Output of negative values can be suppressed by setting `$print_negatives` to `false`.\n\n### test.wig:\n.wig file to be used for testing.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanergictcell%2Fwigfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanergictcell%2Fwigfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanergictcell%2Fwigfiles/lists"}