Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bio-cgranges

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bio-cgranges

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

bio-cgranges

Gem Version test docs docs DOI

Ruby bindings to lh3/cgranges.

cgranges is a small C library for genomic interval overlap queries

Installation

gem install bio-cgranges

Usage

require "bio/cgranges"

granges = Bio::CGRanges.new
granges.add("chr1", 10, 20, 0)
       .add("chr1", 15, 25, 1)
       .add("chr1", 30, 40, 2)
       .add("chr1", 10, 25, 3)
       .add("chr1", 15, 20, 4)
       .add("chr2", 10, 20, 5)
       .index
0.........5.........10........15........20........25........30........35........40
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
                     0-0-0-0-0-0-0-0-0-0
                               1-1-1-1-1-1-1-1-1-1
                                                             2-2-2-2-2-2-2-2-2-2
                     3-3-3-3-3-3-3-3-3-3-3-3-3-3-3
                               4-4-4-4-4
           5-5-5-5-5
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
0.........5.........10........15........20........25........30........35........40
granges.overlap("chr1", 12, 22)
# [["chr1", 10, 20, 0],
#  ["chr1", 10, 25, 3],
#  ["chr1", 15, 25, 1],
#  ["chr1", 15, 20, 4]]

granges.contain("chr1", 12, 22)
# [["chr1", 15, 20, 4]]

granges.coverage("chr1", 20, 35)
# [10, 3] # cov, n

granges.coverage("chr1", 12, 22, mode: :contain)
# [5, 1]

See docs for details.

Development

git clone https://github.com/kojix2/bio-cgranges
bundle install
bundle exec rake compile
bundle exec rake test

Bug reports and pull requests are welcome on GitHub at https://github.com/kojix2/bio-cgranges.

Do you need commit rights to this repository?
Do you want to get admin rights and take over the project?
If so, please feel free to contact us.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc