Skip to main content

mzdata2mat

Welcome ! mzdata2mat is a Python package from LARTIC research team, which converts mzData.xml files (version 1.05, Agilent Technologies) into mat files readable using matlab.

Author : Maxime R.A. Cordella
Team leader : Pr. Christophe B.Y. Cordella

Copyright(c)2024_LARTIC

Documentation Status PyPI downloads

Documentation

The complete documentation is available here. All classes and methods are explained.

Changelog

The current version of mzdata2mat is the following : 0.2.0

You can see the complete changelog here

Compatible hardware

At this time, the following OSes have been tested :

macOS

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

At this time, mzdata2mat have been tested and is supported on Windows 11, no testing has been done on Windows 10 or 7 but if you want to extend the compatibility, we are open to tester's feedback on thoses machines.

Requirements

Other than Python

This package requires node.js installed. you can download and install it at nodejs.org. It is available for both macOS and Windows for free.

Python version

This package is compatible to any python version equal or newer than 3.9.

Python packages

When mzdata2mat will be installed on your system, the following packages will also be installed (if they are not) into your Python enviuronment :

    pydantic>=2.6.4
    mat4py>=0.6.0
    javascript>=1!1.1.3
    colorama>=0.4.6

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

When you will first run this command, node.js will download and install the mzdata package from npm. This will only happen the first time you run the command. The terminal will show you these lines during the process :

 Installing 'mzdata' version 'latest'... This will only happen once. 

added 7 packages, and audited 8 packages in 2s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

 OK. 
[JSE] 

[JSE] 

When it's done, mzdata2mat package 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 or you didn't add it to your PATH.

Usage

Example Code

# Here we import the main class used for the conversion.
1 from mzdata2mat import mzDataManager

# We initialize the class
# If all mzData files are stored in the same directory, we can specify the parameter `mzDataPath` instead of `useDirectory`.
2 converterAgent = mzDataManager(useDirectory=False)

3 path2mzDataFile : str = "path/to/stored/files"

4 someDirectory : str = "path/to/save/file/"

# Now we can call the mzDataXMLread function to read the .mzData.xml file:
5 data = converterAgent.mzDataXMLread(fileName=path2mzDataFile)

# The data we've got from the previous function can be saved to a .mat file with the saveMatfile funtion:
6 converterAgent.saveMatfile(mzData=data, dir2save=someDirectory)

You have successfully converted a mzData file into mat files !

Congratulations !

Metadata

Release files for mzdata2mat 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mzdata2mat 0.2.0
File Size Uploaded
mzdata2mat-0.2.0.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mzdata2mat 0.2.0
File Interpreter ABI Platform
mzdata2mat-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.0 MB

Release files / mzdata2mat-0.2.0.tar.gz

Download URL mzdata2mat-0.2.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
450fe6df9365c6b9fdfa0072b1b4de180ce989a715a50e3897b776d84f722869
BLAKE2b-256 checksum
How to use checksums
6e8c887215123a9d262051562f4968f77e6b2c888e16719b1d63a0dfe32672c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / mzdata2mat-0.2.0-py3-none-any.whl

Download URL mzdata2mat-0.2.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8086fbde16801278ff233709121a77a3cc9d5db2268af2535b016302fe7ef09
BLAKE2b-256 checksum
How to use checksums
96b4b4e2a3ee4d1843b57c6f5c0abb80bf071a36e79e5fcf9bd4573b3cacce05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.22

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page