Class: Ms::Sequest::SrfGroup

Inherits:
Object
  • Object
show all
Includes:
Ident::SearchGroup
Defined in:
lib/ms/sequest/srf.rb

Instance Method Summary collapse

Constructor Details

#initialize(arg, opts = {}, &block) ⇒ SrfGroup

see Ms::Id::Search for acceptable arguments (filename, filenames, array of objects) opts =

:filter_by_precursor_mass_tolerance => true | false (default true)


762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/ms/sequest/srf.rb', line 762

def initialize(arg, opts={}, &block)
  orig_opts = opts.dup
  indiv_opts = { :link_protein_hits => false }
  super(arg, opts.merge(indiv_opts)) do
    unless orig_opts[:link_protein_hits] == false
      (@peptides, @proteins) = merge!(@searches.map {|v| v.peptides }) do |_prot, _peps|
        Ms::Sequest::Srf::Out::Protein.new(_prot.reference, _peps)
      end
    end
  end
  block.call(self) if block_given?
end

Instance Method Details

#search_classObject



775
776
777
# File 'lib/ms/sequest/srf.rb', line 775

def search_class
  Ms::Sequest::Srf
end

#to_srg(srg_filename = 'bioworks.srg') ⇒ Object

returns the filename used if the file exists, the name will be expanded to full path, otherwise just what is given



782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/ms/sequest/srf.rb', line 782

def to_srg(srg_filename='bioworks.srg')
  File.open(srg_filename, 'w') do |v|
    @filenames.each do |srf_file|
      if File.exist? srf_file
        v.puts File.expand_path(srf_file)
      else
        v.puts srf_file
      end
    end
  end
  srg_filename
end