Skip to main content

Package used to convert mzData.xml files into matlab files.

Project description

mzData2Mat

Welcome ! mzData2Mat is a Python package which converts mzData.xml files (version 1.05) into mat files which matlab can load and use.

Compatible hardware

macOS

mzdata2mat has been developped with a macOS environment. At this time, macOS Sonoma 14.0 is officially supported, other macOS versions could be supported as long as they follow the requirements listed below.

Windows

madata2mat has not been tested yet on any Windows machine for now. Support will soon be added (if applicable).

Requirements

Other than Python

This packages requires a javascript interpreter such as node.js. We recommand downloading it and installing it a nodejs.org, this package has been tested with node.js only. There is no official support for other interpreters at this time.

Python version

This package has been developped with Python 3.12.1 however, other python versions are actively being tested to add other versions as soon as possible.

Python packages

To be able to use this package, the following packages need to be also installed on the target environment :

    pydantic>=2.6.4
    PyExecJS==1.5.1
    mat4py>=0.6.0

Installation

From your terminal run the following command to install mzdata2mat into your environment :

pip install mzdata2mat

If you have multiple instances of Python installed, run this command with the chosen Python interpreter to install mzdata2mat in the corresponding Python installation :

<pathToPythonApp> -m pip install mzdata2mat

When the command terminates, you have successfully installed mzdata2mat !

To verfiy if the installation was successful, run in your terminal this command :

$ mzdata2mat-verify

This command will attempt to convert an example .mzdata.xml file into a .mat file. If everything goes right, you will get this message :

$ mzdata2mat - Ready to use !

The example file (.mzdata.xml) will be copied in the current working directory and the converted file (.mat) will be added as soon as the conversion finishes.

If an error occurs, this probably means that you do not have node.js installed on your machine.

Usage

To use mzdata2mat, import it like follows:

from mzdata2mat import mzDataManager

Here we import the main class used for the conversion. Now we initilize the class :

converterAgent = mzDataManager(useDirectory=False)

If all mzData files are stored in the same directory, we can specify the parameter mzDataPath instead of useDirectory.

From now we can call the mzDataXMLreadfunction to read the `.mzData.xml' file:

data = converterAgent.mzDataXMLread(fileName=path2mzDataFile)

We can now save this file with the function saveMatfile:

converterAgent.saveMatfile(mzData=data, dir2save=someDirectory)

You have now successfully converted a mzData file into mat files ! Congratulations !

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mzdata2mat-0.0.22.tar.gz (2.3 MB view hashes)

Uploaded Source

Built Distribution

mzdata2mat-0.0.22-py3-none-any.whl (504.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page