ms-sequest

An mspire library supporting SEQUEST, Bioworks, SQT and associated formats.

Current API

Examples

Provides two executables for extracting information from an Srf file (run without file for usage):

srf_to_sqt.rb file.srf     # => file.sqt
srf_to_search.rb file.srf  # => file.mgf  (also can make .dta files)

MS::Sequest::Srf

Can read and convert Bioworks Sequest Results Files (SRF).

require 'ms/sequest/srf'
srf = MS::Sequest::Srf.new("file.srf")

Conversions (see api for options):

require 'ms/sequest/srf/sqt'  # require this in addition to 'ms/sequest/srf'
srf.to_sqt            # (outputs a file) -> file.sqt

require 'ms/sequest/srf/search' # require this in addition to 'ms/sequest/srf'
srf.to_mgf            # (outputs a file) -> file.mgf
srf.to_dta            # (outputs a dir)  -> file
srf.to_dta("file.tgz", :tgz)  # on the fly tgz (requires archive-tar-minitar)

Object access (see MS::Sequest::Srf for much more):

srf.header         # MS::Sequest::Srf::Header object
srf.params         # MS::Sequest::Params object
srf.dta_files      # MS::Sequest::Srf::Dta objects
srf.out_files      # MS::Sequest::Srf::Out objects
srf.peptide_hits   # MS::Sequest::Srf::Out::Peptide objects

MS::Sequest::Params

Object or hash access to any parameter in the file. Also provides a unified interface across several versions (3.1 - 3.3)

require 'ms/sequest/params'
params = MS::Sequest::Params.new("sequest.params")
params.any_existing_param    # -> some value or empty string if no value
params['any_existing_param'] # -> some value or empty string if no value
params.non_existent_param    # -> nil

# some unified interace methods:
params.enzyme              # -> enzyme name with no parentheses
params.database            # -> first_database_name
params.enzyme_specificity  # -> [offset, cleave_at, expect_if_after]
params.precursor_mass_type  # => "average" | "monoisotopic"
params.fragment_mass_type   # => "average" | "monoisotopic"

MS::Sequest::Sqt

sqt = MS::Sequest::Sqt.new("file.sqt")
sqt.header
sqt.spectra.each do |spectrum|      # an MS::Sequest::Sqt::Spectrum object
  spectrum.matches.each do |match|    # an MS::Sequest::Sqt::Match object
    match.loci.each do |locus|          # an MS::Sequest::Sqt::Locus object
    end
  end
end

# or more direct access to Match objects:
sqt.peptide_hits

Also reads Percolator SQT output files intelligently:

psqt = MS::Sequest::Sqt.new("percolator_output.sqt")
psqt.peptide_hits.each do |pmatch|
  pmatch.percolator_score  ==  pmatch.xcorr
  pmatch.negative_q_value  ==  pmatch.sp
  pmatch.q_value           ==  -pmatch.negative_q_value 
end

Installation

gem install ms-sequest

See LICENSE (MIT)