Class: GffToProteinDBTool

Inherits:
Tool
  • Object
show all
Defined in:
lib/protk/gff_to_proteindb_tool.rb

Instance Attribute Summary collapse

Attributes inherited from Tool

#option_parser, #options, #options_defined_by_user

Instance Method Summary collapse

Methods inherited from Tool

#add_boolean_option, #add_default_to_help, #add_value_option, #check_options, #database_info, default_output_path, extension_from_filename, #jobid_prefix, #jobid_prefix=, #method_missing, #run, #supported_options

Constructor Details

#initialize(option_support = []) ⇒ GffToProteinDBTool

Initializes commandline options common to all such tools. Individual search tools can add their own options, but should use Capital letters to avoid conflicts



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/protk/gff_to_proteindb_tool.rb', line 23

def initialize(option_support=[])
  super(option_support)

  if ( option_support.include? :add_transcript_info )
    add_boolean_option(:add_transcript_info,false,['--info','Include CDS Coordinates'])
  end

  @option_parser.summary_width=40

  @capturing_gene=false
  @current_gene=nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tool

Instance Attribute Details

Returns the value of attribute print_progress.



18
19
20
# File 'lib/protk/gff_to_proteindb_tool.rb', line 18

def print_progress
  @print_progress
end

Instance Method Details

#get_lines_matching(pattern, gene_lines) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/protk/gff_to_proteindb_tool.rb', line 46

def get_lines_matching(pattern,gene_lines)
  match_lines=[]
  gene_lines.each do |line|  
    if line =~ pattern
      match_lines << line
    end
  end
  match_lines
end

#start_new_gene(line) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/protk/gff_to_proteindb_tool.rb', line 36

def start_new_gene(line)
  if (line =~ /maker\sgene/)
      new_gene = line.match(/ID=([^;]+)/).captures[0]
      if new_gene!=@current_gene
        @current_gene=new_gene
        return true
      end
    end
end