Skip to content

BioGem helps Bioinformaticians start developing plugins/modules for BioRuby creating a scaffold and a gem package

License

Notifications You must be signed in to change notification settings

rjpbonnal/bioruby-gem

Repository files navigation

Biogem

Helios: <img src=“https://secure.travis-ci.org/helios/bioruby-gem.png”/>

Pjotr: <img src=“https://secure.travis-ci.org/pjotrp/bioruby-gem.png”/>

Biogem provides a set of tools for those Bioinformaticans who want to start coding an application, or a library for using/extending BioRuby’s core library and sharing the code as a gem through rubygems.org. Biogems are automatically listed at biogems.info

The basic idea is to promote a modular approach to the BioRuby package, and simplify creating such modules. Biogem creates the necessary directory structure for a gem, and generates files, based on templates. Biogem includes templates for parsing the command line, logging, libraries, documentation, tests. Also there is Ruby on Rails support, BioSQL and FFI (for binding to C libraries).

Biogem does not reinvent the wheel, but puts together different tools and modifies their original behavior, when needed. The tool jeweler is used to create the initial scaffold, setting up git for versioning, releasing it to github.com and/or rubygems.org and packaging. Bundler is used used for setting up a predefined developing environment.

Also Biogem makes use of webservices. Currently

  • GitHub.com is used for maintaining the source tree, tracking changes and issues. Create a github account if you don’t have one.

  • RubyGems.org publishes your software for other people to install and use

  • biogems.info tracks all biogems, so people can find them

Installation

Pre-requisites

  • Ruby: Ruby: 1.9

    • development and installation have been tested on 1.9.2, 1.9.3.

  • RVM: RVM beginrescueend.com/ is optional, but suggested. Not only can you specify the Ruby interpreter version that works best with Biogem, RVM also allows multiple ruby interpreters in your home directory for testing purposes. When using RVM, make sure to compile with openssl support, e.g. on Debian

    $ sudo apt-get install libssl-dev 
    $ rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr
  • GitHub & RubyGems: In order to use Biogem to its fullest potential, you must create a regular GitHub github.com and RubyGems rubygems.org account. Why? Because for sharing and keeping track of source code we (currenlty) use github and for distributing the plugin we rely on RubyGems, the reference Ruby gem repository. To configure github and automate most of Biogem’s tasks:

    $ git config --global user.name "Firstname Lastname" Sets the name of the user for all git instances on the system
    $ git config --global user.email "[email protected]"
    $ git config --global github.user "user_id"
    $ git config --global github.token "TOKEN ASSIGNED BY GITHUB"

Note: another Ruby version management system used in BioRuby community is github.com/sstephenson/rbenv but for now we can not provide support for it.

IMPORTANT NOTE

Rubygems will not let you install Biogem in an environment with a Ruby interpreter older than 1.9.X. Biogem can create gems for Ruby 1.8.7 - but you need a recent version of Ruby and tools to run Biogem itself.

Also it is recommended to install the latest version of bundler using

$ gem install bundler

Download

Install the Biogem toolset with

$ gem install bio-gem

all the required dependencies will be downloaded and installed automatically.

$ gem install bio-gem
Fetching: rake-0.9.2.2.gem (100%)
Fetching: git-1.2.5.gem (100%)
Fetching: jeweler-1.6.4.gem (100%)
Fetching: json-1.6.4.gem (100%)
Building native extensions.  This could take a while...
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Fetching: bio-gem-1.2.0.gem (100%)
Successfully installed rake-0.9.2.2
Successfully installed git-1.2.5
Successfully installed jeweler-1.6.4
Successfully installed json-1.6.4
Successfully installed rdoc-3.12
Successfully installed bio-gem-1.2.0
6 gems installed
Installing ri documentation for rake-0.9.2.2...
Installing ri documentation for git-1.2.5...
Installing ri documentation for jeweler-1.6.4...
Installing ri documentation for json-1.6.4...
Installing ri documentation for rdoc-3.12...
Installing ri documentation for bio-gem-1.2.0...
Installing RDoc documentation for rake-0.9.2.2...
Installing RDoc documentation for git-1.2.5...
Installing RDoc documentation for jeweler-1.6.4...
Installing RDoc documentation for json-1.6.4...
Installing RDoc documentation for rdoc-3.12...
Installing RDoc documentation for bio-gem-1.2.0...

Note: the above list of dependencies is just an example and it may vary from your current installation.

Browse the documentation

During the installation you may note how Rubygems install the documentation for you, for each library installed. Is possible to access to all the documentations and API installed simply typing in the command line:

$ gem server

Server started at 0.0.0.0:8808 Server started at [::ffff:0.0.0.0]:8808

To see Biogem documentation locally use this link:

http://localhost:8808/doc_root/bio-gem-1.2.0/rdoc/README_rdoc.html

Note: the above link must be update with your current version of Biogem

Biogem Tutorial HowTo Develop a plugins

Please follow the guide reported in tutorial github.com/helios/bioruby-gem/blob/master/Tutorial.rdoc, which is the most up to date version. You’ll find out how to create

  • a simple plugin

  • embed a database

  • create a Biogem Engine to embed your gem into a Ruby on Rails web application

and much more

Biogems Official Archive

Contributing to Biogem

The source code repositories for Biogem and biogems.info website are on github

Use Biogem for all purposes DRY. If you want to contribute, feel free! Clone the project! Submit! Send us a pull request!

BioRuby’s Wiki Official Documentation

Biogem options

Usage: biogem [options] reponame

e.g. biogem the-perfect-gem

    --directory [DIRECTORY]      specify the directory to generate into
These options are for BioGem
    --meta                       create a meta package, just the Rakefile, Gemfile, Licence, Readme. This options takes the precedence over every other option.
    --with-bin                   create the bin directory and an executable template script called bioreponame
    --with-db                    create the database directory for a db application-library.
    --with-test-data             create the data directory inside the test directory if the user need to set up a test with its own dataset
    --with-engine [NAMESPACE]    create a Rails engine with the namespace given in input. Set default database creation
These options are for Jeweler
    --rspec                      generate rspec code examples
    --shoulda                    generate shoulda tests
    --testunit                   generate test/unit tests
    --bacon                      generate bacon specifications
    --testspec                   generate test/spec tests
    --minitest                   generate minitest tests
    --micronaut                  generate micronaut examples
    --riot                       generate riot tests
    --shindo                     generate shindo tests
    --[no-]bundler               use bundler for managing dependencies
    --cucumber                   generate cucumber stories in addition to the other tests
    --reek                       generate rake task for reek
    --roodi                      generate rake task for roodi
    --summary [SUMMARY]          specify the summary of the project
    --description [DESCRIPTION]  specify a description of the project
    --user-name [USER_NAME]      the user's name, ie that is credited in the LICENSE
    --user-email [USER_EMAIL]    the user's email, ie that is credited in the Gem specification
    --github-username [GITHUB_USERNAME] name of the user on GitHub to set the project up under
    --github-token [GITHUB_TOKEN] GitHub token to use for interacting with the GitHub API
    --git-remote [GIT_REMOTE]    URI to set the git origin remote to
    --homepage [HOMEPAGE]        the homepage for your project (defaults to the GitHub repo)
    --no-create-repo             dont't create the repository on GitHub
    --yard                       use yard for documentation
    --rdoc                       use rdoc for documentation
-h, --help                       display this help and exit

Recent versions of Biogem may have more options. For a full list run

bundle exec rake -T

Copyright © 2010-2012 Raoul J.P. Bonnal. See LICENSE.txt for further details.

About

BioGem helps Bioinformaticians start developing plugins/modules for BioRuby creating a scaffold and a gem package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •