Git Product home page Git Product logo

mzlib's Introduction

mzLib

A library for mass spectrometry projects.

GitHub Action Builds codecov Coverity Scan Build Status NuGet Badge

image

NuGet packages are released here: https://www.nuget.org/packages/mzLib/

GitHub release tags are recoreded here: https://github.com/smith-chem-wisc/mzLib/releases

Usage

Reading Spectra Files

To read Thermo or mzML files, use

ThermoStaticData staticThermo = ThermoStaticData.LoadAllStaticData(@"spectra.raw");
ThermoDynamicData dynamicThermo = ThermoDynamicData.InitiateDynamicConnection(@"spectra.raw")
Mzml mzmlFile = Mzml.LoadAllStaticData(@"spectra.mzML");

Both filetypes implement the same interface that has all of the necessary functionality to interact with spectra files:

IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> thermoFile = new ThermoRawFile(@"spectra.RAW");
IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> mzmlFile = new Mzml(@"spectra.mzML");

Loading Databases From Online Sources

Loaders.LoadElements("elements.dat"); // void, loads elements into static PeriodicTable class 
IEnumerable<ModificationWithLocation> unimodMods = Loaders.LoadUnimod("unimod.dat");
IEnumerable<ModificationWithLocation> uniprotMods = Loaders.LoadUniprot("uniprot.dat");

Reading Protein Database Files

To read .fasta, .xml, or .xml.gz files, use

List<Protein> proteins = ProteinDbLoader.LoadProteinDb("proteins.xml", generateDecoys, allKnownModifications, IsContaminant, out unknownModifications);

The parameters are:

  • bool generateDecoys True if wish to generate decoy proteins.
  • IDictionary<string, IList<Modification>> allKnownModifications Dictionary of modifications with keys that correspond to modifications in the xml file.
  • bool IsContaminant True if it is a contaminant database
  • out Dictionary<string, Modification> unknownModifications An auxiliary output of modifications that were in the xml file but are not known.

Reading Modification Files

To load modifications from ptmlist formatted files use

IEnumerable<ModificationWithLocation> ptms = PtmListLoader.ReadMods("ptms.txt")

License

Code heavily borrowed from https://github.com/dbaileychess/CSMSL and distrubuted under the appropriate license, LGPL.

mzlib's People

Contributors

stefanks avatar rmillikin avatar acesnik avatar trishorts avatar zrolfs avatar dippman avatar lonelu avatar rmmiller22 avatar ianhirsch avatar yulingdai avatar bintiibrahim avatar alexander-sol avatar zdanaceau avatar kyp4 avatar avcarr2 avatar xrsheeran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.