Project

mascot-mgf

0.0
No commit activity in last 3 years
No release in over 3 years
A parser for Mascot Generic Format (MGF) files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

Mascot::MGF¶ ↑

A parser for Mascot Generic Format (MGF) files.

MGF Format ¶ ↑

The Mascot::MGF object represents a file of MSMS spectra. See www.matrixscience.com/help/data_file_help.html#GEN for more information on this file format.

Mascot::MGF¶ ↑

A subclass of File, opens an MGF flat file to read entries using Enumerable syntax.

Mascot::MGF::Query¶ ↑

A simple object that represents individual MS/MS spectrum objects in an MGF file. I use “Query” instead of “Spectrum” to remain consistent with Mascot”s terminology.

Simple Usage Examples¶ ↑

Reading ¶ ↑

require 'mascot/mgf'

# This opens a MGF file and builds an index of the query
# positions. The index is cached to the filesystem.
mgf = Mascot::MGF.open("some/file/path.mgf")

# Same thing as above, but does not cache the index to filesystem
mgf = Mascot::MGF.open("some/file/path.mgf",false)

# How many queries are in this file?
mgf.query_count

# Reads the next query from the read cursor position

query_string = mgf.readquery()

# Create a Mascot::MGF::Query from the query string query = Mascot::Query.new(query_string)

puts query.title

# Read the next query as a Mascot::MGF::Query object query = mgf.query() puts query.title

# puts cursor at begining of MGF file mgf.rewind

mgf.each_query do |query_object|
  # do something with query...
end