Skip to content

Instantly share code, notes, and snippets.

@dpo
Created February 22, 2014 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpo/9158826 to your computer and use it in GitHub Desktop.
Save dpo/9158826 to your computer and use it in GitHub Desktop.
require 'formula'
class Velvet < Formula
homepage 'http://www.ebi.ac.uk/~zerbino/velvet/'
url 'http://www.ebi.ac.uk/~zerbino/velvet/velvet_1.2.10.tgz'
sha1 '216f0941609abf3a73adbba19ef1f364df489d18'
head 'https://github.com/dzerbino/velvet.git'
option 'with-maxkmerlength=<value>', 'Specify max kmer length'
option 'with-categories=<value>', 'Specify number of categories'
def install
inreplace 'Makefile' do |s|
# recommended in Makefile for compiling on Mac OS X
s.change_make_var! "CFLAGS", "-Wall -m64"
end
args = ["LONGSEQUENCES=1"]
args << "OPENMP=1" unless ENV.compiler == :clang
maxkmerlength = ARGV.value('with-maxkmerlength') || '-1'
categories = ARGV.value('with-categories') || '-1'
args << "MAXKMERLENGTH=#{maxkmerlength}" if maxkmerlength.to_i > 0
args << "CATEGORIES=#{categories}" if categories.to_i > 0
system "make", "velveth", "velvetg", *args
bin.install 'velveth', 'velvetg'
# install additional contributed scripts
(share/'velvet/contrib').install Dir['contrib/shuffleSequences_fasta/shuffleSequences_*']
end
def caveats
<<-EOS.undent
If you want to build with a different kmer length, you can set
the environmental variable MAXKMERLENGTH=X to a value (X) *before*
you brew this formula.
If you want to build with support for multiple categories, you
can set the environmental variable CATEGORIES=X to a value (X)
*before* you brew this formula.
Some additional user contributed scripts are installed here:
#{share}/velvet/contrib
EOS
end
def test
system "velveth --help"
system "velvetg --help"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment