Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby binding for the tabix file indexing routines within the samtools package http://samtools.sourceforge.net/
Ruby
tree: 5ae07f5819

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
ext/tabix
lib
test
.document
.gitignore
.rvmrc
Gemfile
LICENSE.txt
README.rdoc
Rakefile
VERSION
bio-tabix.gemspec

README.rdoc

bio-tabix

Ruby binding for the tabix file indexing routines within the samtools package samtools.sourceforge.net/

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

Usage

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

tabix_file = Bio::Tabix::Index.open(my_txt_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]
end

Process a region

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

Installation

'gem install bio-samtools'

Dependencies:

-FFI (github.com/ffi/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

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

Something went wrong with that request. Please try again.