Project

mzid

0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem to parse mzIdentML (mzid) files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.6
~> 2.0
 Project Readme

mzid

ruby parser library for mzIdentML files

Gem Version Build Status

Install
gem install mzid
Usage

A command line utility is provided to convert from mzid to csv, an example:

$ convert_mzid_to_csv.rb test.mzid -v -m 
DBSeq:         100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time:   0:00:01
Peptides:      100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time:   0:00:01
PepEv:         100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time:   0:00:01
Spectra:       100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time:   0:00:02

this results in a file named test.csv since one was not explicitly provided.

Example

parsing the output of an mzid file can be done in a simple block:

require 'mzid'

parser = MzID::Parser.new("output.mzid")
parser.each_psm do |spec_id|
  puts [spec_id.get_id, spec_id.get_pep, spec_id.get_spec_prob].join("\t")
end

alternatively, one can also specify a more memory-efficient parser for large files, reformatting their output into an easily parsable csv file:

parser = MzID::ParserSax.new("output.mzid")
parser.write_to_csv("output.csv")
Dependencies
  • nokogiri
  • ox
  • progressbar
  • minitest
  • minitest-reporters