Skip to content

Commit

Permalink
biotm_hmm is now the script name, and added some README
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben J Woodcroft committed Apr 3, 2011
1 parent 96e8386 commit 6cabb16
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 128 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Expand Up @@ -2,7 +2,7 @@


A bioruby plugin for running TMHMM automatically on multiple sequences in a FASTA file and manipulation of the results A bioruby plugin for running TMHMM automatically on multiple sequences in a FASTA file and manipulation of the results



biotm_hmm -f proteome.fasta


== Contributing to bio-tm_hmm == Contributing to bio-tm_hmm


Expand Down
118 changes: 57 additions & 61 deletions bin/biotm_hmm 100644 → 100755
@@ -1,76 +1,72 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
#
# BioRuby bio-tm_hmm Plugin
# Version 0.0.0
# Author:: Ben J. Woodcroft # Author:: Ben J. Woodcroft
# Copyright:: 2011 # Copyright:: 2011
# License:: The Ruby License # License:: The Ruby License


USAGE = "Describe biotm_hmm" require 'rubygems'

require 'bio'
if ARGV.size == 0
print USAGE
end

require 'bio-tm_hmm' require 'bio-tm_hmm'
require 'optparse' require 'optparse'


# Uncomment when using the bio-logger # If being run directly instead of being require'd,
# require 'bio-logger' # output one transmembrane per line, and
# Bio::Log::CLI.logger('stderr') # indicate that a particular protein has no transmembrane domain
# Bio::Log::CLI.trace('info') if $0 == __FILE__
options = {
:filter_in => false,
:filter_out => false,
}
o = OptionParser.new do |opts|
opts.banner = [
'Usage: tm_hmm_wrapper.rb [-fg] [fasta_filename]',
"\tfasta file can also be piped in on STDIN.",
"\twithout arguments, a description of the transmembranes is printed out for each input sequence"
]
opts.on('-f','--filter-in','Print those sequences that have a transmembrane domain') do
options[:filter_in] = true
end
opts.on('-g','--filter-out','Print those sequences that do NOT have a transmembrane domain') do
options[:filter_out] = true
end
end
o.parse!


options = {:example_switch=>false,:show_help=>false} runner = Bio::TMHMM::TmHmmWrapper.new
opts = OptionParser.new do |o|
o.banner = "Usage: #{File.basename($0)} [options] reponame\ne.g. #{File.basename($0)} the-perfect-gem"


o.on('--example_parameter [EXAMPLE_PARAMETER]', 'TODO: put a description for the PARAMETER') do |example_parameter| Bio::FlatFile.auto(ARGF).each do |seq|
# TODO: your logic here, below an example result = runner.calculate(seq.seq)
options[:example_parameter] = 'this is a parameter' name = seq.definition
end

o.separator ""
o.on("--switch-example", 'TODO: put a description for the SWITCH') do
# TODO: your logic here, below an example
self[:example_switch] = true
end


# Uncomment the following when using the bio-logger # Default output - a description of the TMDs for each input aaseq
# o.separator "" if options[:filter_in] == false and options[:filter_out] == false
# o.on("--logger filename",String,"Log to file (default stderr)") do | name | if result.has_domain?
# Bio::Log::CLI.logger(name) # At least one TMD found. Output each on a separate line
# end result.transmembrane_domains.each do |tmd|
# puts [
# o.on("--trace options",String,"Set log level (default INFO, see bio-logger)") do | s | name,
# Bio::Log::CLI.trace(s) result.transmembrane_type,
# end tmd.start,
# tmd.stop,
# o.on("-q", "--quiet", "Run quietly") do |q| tmd.orientation
# Bio::Log::CLI.trace('error') ].join("\t")
# end end
# else
# o.on("-v", "--verbose", "Run verbosely") do |v| puts [
# Bio::Log::CLI.trace('info') name,
# end 'No Transmembrane Domain Found'
# ].join("\t")
# o.on("--debug", "Show debug messages") do |v| end
# Bio::Log::CLI.trace('debug')
# end


o.separator "" elsif options[:filter_in]
o.on_tail('-h', '--help', 'display this help and exit') do if result.has_domain?
options[:show_help] = true puts seq
end
elsif options[:filter_out]
unless result.has_domain?
puts seq
end
end
end end
end end


begin
opts.parse!(ARGV)

# Uncomment the following when using the bio-logger
# Bio::Log::CLI.configure('bio-tm_hmm')

# TODO: your code here
# use options for your logic
rescue OptionParser::InvalidOption => e
options[:invalid_argument] = e.message
end
66 changes: 0 additions & 66 deletions bin/tm_hmm_wrapper.rb

This file was deleted.

0 comments on commit 6cabb16

Please sign in to comment.