{"id":17220860,"url":"https://github.com/kojix2/ruby-igv","last_synced_at":"2025-04-06T07:37:37.181Z","repository":{"id":42667643,"uuid":"281373245","full_name":"kojix2/ruby-igv","owner":"kojix2","description":"Simple wrapper to the IGV socket interface","archived":false,"fork":false,"pushed_at":"2024-04-24T04:02:11.000Z","size":203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-24T15:26:41.549Z","etag":null,"topics":["bioinformatics","igv","ruby"],"latest_commit_sha":null,"homepage":"https://kojix2.github.io/ruby-igv/","language":"Ruby","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/kojix2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"ko_fi":"kojix2"}},"created_at":"2020-07-21T11:00:36.000Z","updated_at":"2024-07-20T17:38:45.941Z","dependencies_parsed_at":"2024-07-20T17:56:00.884Z","dependency_job_id":null,"html_url":"https://github.com/kojix2/ruby-igv","commit_stats":{"total_commits":86,"total_committers":1,"mean_commits":86.0,"dds":0.0,"last_synced_commit":"4c1fc5c79df2045e1bb49b75ad687d828cbfa65e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-igv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-igv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-igv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-igv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojix2","download_url":"https://codeload.github.com/kojix2/ruby-igv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451476,"owners_count":20940946,"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":["bioinformatics","igv","ruby"],"created_at":"2024-10-15T03:53:27.690Z","updated_at":"2025-04-06T07:37:37.147Z","avatar_url":"https://github.com/kojix2.png","language":"Ruby","funding_links":["https://ko-fi.com/kojix2"],"categories":[],"sub_categories":[],"readme":"# ruby-igv\n\n[![Gem Version](https://badge.fury.io/rb/ruby-igv.svg)](https://badge.fury.io/rb/ruby-igv)\n[![Docs Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://rubydoc.info/gems/ruby-igv)\n[![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://kojix2.github.io/ruby-igv)\n[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE.txt)\n[![DOI](https://zenodo.org/badge/281373245.svg)](https://zenodo.org/badge/latestdoi/281373245)\n\nRuby-IGV is a simple tool for controlling the Integrated Genomics Viewer (IGV) from the Ruby language. It provides an automated way to load files, specify genome locations, and take and save screenshots using IGV.\n\n## Installation\n\n\u003cimg src=\"https://user-images.githubusercontent.com/5798442/182540876-c3ca2906-7d05-4c93-9107-ce4135ae9765.png\" width=\"300\" align=\"right\"\u003e\n\nRequirement : \n\n* [Ruby](https://github.com/ruby/ruby)\n* [IGV (Integrative Genomics Viewer)](http://software.broadinstitute.org/software/igv/)\n  * [Enable IGV to listen on the port](https://software.broadinstitute.org/software/igv/Preferences#Advanced)\n  * View \u003e Preference \u003e Advanced \u003e Enable port ☑\n\n```ruby\ngem install ruby-igv\n```\n\n## Quickstart\n\n\u003cimg src=\"https://user-images.githubusercontent.com/5798442/182623864-a9fa59aa-abb9-4cb1-8311-2b3479b7414e.png\" width=\"300\" align=\"right\"\u003e\n\n```ruby\nrequire 'igv'\n\nigv = IGV.start # This launch IGV\n\nigv.set      :SleepInterval, 200 # give a time interval\nigv.genome   'hg19'\nigv.load     'http://hgdownload.cse.ucsc.edu/goldenPath/' \\\n             'hg19/encodeDCC/wgEncodeUwRepliSeq/' \\\n             'wgEncodeUwRepliSeqK562G1AlnRep1.bam'\nigv.go       'chr18:78016233-78016640'\nigv.snapshot 'region.png'\n```\n\n## Usage\n\n### IGV batch commands\n\nThe commonly used commands in IGV are summarized in the official [list of batch commands](https://github.com/igvteam/igv/wiki/Batch-commands). (but even this does not seem to be all of them). You can also call the `commands` method from Ruby to open a browser and view the list.\n\n```ruby\nigv.commands # Show the IGV command reference in your browser\n```\n\n### docs\n\nSee [yard docs](https://rubydoc.info/gems/ruby-igv/IGV). Commonly used IGV batch commands can be called from Ruby methods of the same name. However, not all IGV batch commands are implemented in Ruby. Use the `send` method described below.\n\n### send\n\nCommands that are not implemented can be sent using the send method.\n\n```ruby\nigv.send(\"maxPanelHeight\", 10)\n```\n\nTo avoid unexpected behavior, ruby-igv does not use the `method_missing` mechanism.\n\n### Launch IGV\n\nLaunch IGV from Ruby script.\n\n```ruby\nigv = IGV.start # launch IGV app using spawn\n```\n\nYou can specify the port.\n\n```ruby\nigv = IGV.start(port: 60152)\n```\n\nIf you start IGV in this way, you can force IGV to terminate by calling the kill method.\n\n```ruby\nigv.kill\n```\n\n### Open socket connection to IGV\n\nIf IGV is already running, use `new` or `open`.\n\nnew\n\n```ruby\nigv = IGV.new   # create an IGV object. Then you will type `igv.connect`\nigv = IGV.new(host: \"127.0.0.1\", port: 60151, snapshot_dir: \"~/igv_snapshot\")\nigv.connect # To start a connection, call connect explicitly.\nigv.close\n```\n\nopen\n\n```ruby\nigv = IGV.open  # create an IGV object and connect it to an already activated IGV.\nigv.close\nIGV.open(host: \"127.0.0.1\", port: 60151, snapshot_dir: \"~/igv_snapshot\") do |igv|\n  # do something\nend # The socket is automatically closed.\n```\n\n### Close IGV\n\nThe behavior of the following methods is different.\n\n```ruby\nigv.close       # close the socket connection\nigv.exit        # send exit command to IGV then close the socket connection\nigv.quit        # alias method to exit\nigv.kill        # kill group pid created with IGV.start\n```\n\n## Contributing\n\n* [Report bugs](https://github.com/kojix2/ruby-igv/issues)\n* Fix bugs and submit [pull requests](https://github.com/kojix2/ruby-igv/pulls)\n* Write, clarify, or fix documentation\n* Suggest or add new features\n\n```\nDo you need commit rights to this repository?\nDo you want to get admin rights and take over the project?\nIf so, please feel free to contact me @kojix2.\n```\n\n## Acknowledgement\nThis gem is strongly inspired by a Python script developed by Brent Pedersen.\n* [brentp/bio-playground/igv](https://github.com/brentp/bio-playground).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-igv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojix2%2Fruby-igv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-igv/lists"}