Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby binding for the tabix file indexing routines within the samtools package

tree: cd165d9484

Fetching latest commit…

Cannot retrieve the latest commit at this time



Ruby binding for the tabix file indexing routines within the samtools package

Tabix provides utilities for indexing and subsequently querying regions of interest from large tab delimited files.

Files are indexed on three columns: [Group, pos1, pos2] and must be position sorted


Open the file, an index will be created if it does not exist. Use :force => true to overwrite an existing index.

tabix_file =, {:s => group_col, :b => pos1_col, :e => pos2_col})

Create a proc or lambda. This will be called with the value of each fileline

my_proc = lambda do |line|
 # convert text to array and print column 7
 puts line.split("\t")[6]

Process a region

tabix_file.process_region(group_name, pos1, pos2, my_proc)


'gem install bio-samtools'


-FFI (

Contributing to bio-tabix

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright © 2012 Nicholas A Thrower. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.