ms-sequest
An mspire library supporting SEQUEST, Bioworks, SQT and associated formats.
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.peps # Ms::Sequest::Srf::Out::Pep objects
srf.prots # Ms::Sequest::Srf::Out::Prot 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 and Locus objects:
sqt.peps
sqt.prots
Also reads Percolator SQT output files intelligently:
psqt = Ms::Sequest::Sqt.new("percolator_output.sqt")
psqt.peps.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
Copyright
See LICENSE (MIT)