Class: SearchTool

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

Direct Known Subclasses

ProphetTool, TandemSearchTool

Instance Attribute Summary

Attributes inherited from Tool

#option_parser, #options, #options_defined_by_user

Instance Method Summary collapse

Methods inherited from Tool

#add_boolean_option, #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 = []) ⇒ SearchTool

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


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/protk/search_tool.rb', line 21

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

  # if (option_support.include? :database)
  #   add_value_option(:database,"sphuman",['-d', '--database dbname', 'Specify the database to use for this search. Can be a named protk database or the path to a fasta file'])        
  # end
  
  if ( option_support.include? :enzyme )
    add_value_option(:enzyme,"Trypsin",['--enzyme enz', 'Enzyme'])
  end

  if ( option_support.include? :modifications )
    add_value_option(:var_mods,"",['--var-mods vm','Variable modifications. These should be provided in a comma separated list'])
    add_value_option(:fix_mods,"",['--fix-mods fm','Fixed modifications. These should be provided in a comma separated list'])
  end

  if ( option_support.include? :instrument )
    add_value_option(:instrument,"ESI-QUAD-TOF",['--instrument instrument', 'Instrument'])
  end

  if ( option_support.include? :mass_tolerance_units )
    add_value_option(:fragment_tolu,"Da",['--fragment-ion-tol-units tolu', 'Fragment ion mass tolerance units (Da or mmu). Default=Da'])      
    add_value_option(:precursor_tolu,"ppm",['--precursor-ion-tol-units tolu', 'Precursor ion mass tolerance units (ppm or Da). Default=ppm'])
  end

  if ( option_support.include? :mass_tolerance )
    add_value_option(:fragment_tol,0.65,['-f', '--fragment-ion-tol tol', 'Fragment ion mass tolerance (unit dependent). Default=0.65'])
    add_value_option(:precursor_tol,200,['-p','--precursor-ion-tol tol', 'Precursor ion mass tolerance. Default=200'])
  end
  
  if ( option_support.include? :precursor_search_type )
    add_value_option(:precursor_search_type,"monoisotopic",['-a', '--search-type type', 'Use monoisotopic or average precursor masses. (monoisotopic or average)'])
  end

  if ( option_support.include? :strict_monoisotopic_mass )
    add_boolean_option(:strict_monoisotopic_mass,false,['-s', '--strict-monoisotopic-mass', 'Dont allow for misassignment of monoisotopic mass to another isotopic peak'])
  end

  if ( option_support.include? :missed_cleavages )
    add_value_option(:missed_cleavages,2,['-v', '--num-missed-cleavages num', 'Number of missed cleavages allowed'])
  end

  if ( option_support.include? :cleavage_semi )
    add_boolean_option(:cleavage_semi,false,['--cleavage-semi', 'Search for peptides with up to 1 non-enzymatic cleavage site'])
  end

  if ( option_support.include? :respect_precursor_charges )
    add_boolean_option(:respect_precursor_charges,false,['-q', '--respect-charges','Dont respect charges in the input file. Instead impute them by trying various options'])
  end

  if ( option_support.include? :searched_ions )
    add_value_option(:searched_ions,"",['--searched-ions si', 'Ion series to search (default=b,y)'])
  end

  if ( option_support.include? :multi_isotope_search )
    add_boolean_option(:multi_isotope_search,false,["--multi-isotope-search","Expand parent mass window to include windows around neighbouring isotopic peaks"])
  end

  if ( option_support.include? :num_peaks_for_multi_isotope_search )
    add_value_option(:num_peaks_for_multi_isotope_search,0,["--num-peaks-for-multi-isotope-search np","Number of peaks to include in multi-isotope search"])
  end

  if ( option_support.include? :glyco)
    add_boolean_option(:glyco,false,['-g','--glyco', 'Expect N-Glycosylation modifications as variable mod in a search or as a parameter when building statistical models'])
  end

  if ( option_support.include? :acetyl_nterm)
    add_boolean_option(:acetyl_nterm,false,['-y','--acetyl-nterm', 'Expect N-terminal acetylation as a variable mod in a search or as a parameter when building statistical models'])
  end

  if ( option_support.include? :methionine_oxidation)
    add_boolean_option(:methionine_oxidation,false,['-m', '--methionineo', 'Expect Oxidised Methionine modifications as variable mod in a search'])
  end

  if ( option_support.include? :carbamidomethyl)
    add_boolean_option(:carbamidomethyl,false,['-c', '--carbamidomethyl', 'Expect Carbamidomethyl C modifications as fixed mod in a search'])
  end
  
  if ( option_support.include? :maldi)
    add_boolean_option(:maldi,false,['-l', '--maldi', 'Run a search on MALDI data'])
  end

  @option_parser.summary_width=40

    
end

Dynamic Method Handling

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