Sha256: 10be8fc1b1e2d9285a515b3c5e211a89da0959043d2014cd1747109983a73942

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

#!/usr/bin/env ruby
require 'optparse'

require 'npsearch'
require 'npsearch/arg_validator'
require 'npsearch/version'

opt = {}
optparse = OptionParser.new do |opts|
  opts.banner = <<Banner

* Usage: npsearch [Options] -i [Input File]

* Mandatory Options:

Banner

  opt[:input_file] = nil
  opts.on('-i', '--input [file]',
          'Path to the input fasta file') do |f|
    opt[:input_file] = f
  end

  opts.separator ''
  opts.separator '* Optional Options:'

  opt[:signalp_path] = File.join(ENV['HOME'], 'signalp/signalp')
  opts.on('-s', '--signalp_path', String,
          'The full path to the signalp script. This can be downloaded from',
          ' CBS. See https://www.github.com/wurmlab/NpSearch for more',
          ' information') do |p|
    opt[:signalp_path] = p
  end

  opt[:usearch_path] = File.join(ENV['HOME'], 'bin/uclust')
  opts.on('-u', '--usearch_path', String,
          'The full path to the usearch binary. This script can be downloaded',
          ' from .... See https://www.github.com/wurmlab/NpSearch for more',
          ' information') do |p|
    opt[:usearch_path] = p
  end

  opt[:num_threads] = 1
  opts.on('-n', '--num_threads', Integer,
          'The number of threads to use when analysing the input file') do |n|
    opt[:num_threads] = n
  end

  opt[:orf_min_length] = 10
  opts.on('-m', '--orf_min_length N', Integer,
          'The minimum length of a potential neuropeptide precursor.',
          ' Default: 30') do |n|
    opt[:orf_min_length] = n
  end

  opts.on('-h', '--help', 'Display this screen') do
    puts opts
    exit
  end

  opts.on('-v', '--version', 'Shows version') do
    puts NpSearch::VERSION
    exit
  end
end
optparse.parse!

# Temporary hard coding my defaults...
opt[:num_threads] = 8
opt[:signalp_path] = '/Volumes/Data/data/programs/signalp-4.1/signalp'
opt[:usearch_path] = '/Volumes/Data/data/programs/bin/usearch'

NpSearch.init(opt)
NpSearch.run

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
npsearch-2.0.1 bin/npsearch
npsearch-2.0.0 bin/npsearch