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.

Documentation Status PyPI downloads

Documentation

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

Changelog

The current version of mzdata2mat is the following : 0.1.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 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

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

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 !

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.1.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

mzdata2mat-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file mzdata2mat-0.1.0.tar.gz.

File metadata

  • Download URL: mzdata2mat-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for mzdata2mat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17f32555f2b4ebbd932f4fabd4d02a79fb009745202a9599c3297726fc9cb2d6
MD5 6dfb96e0ac9d1502e33050bfb4e7b1c8
BLAKE2b-256 233f3f187b95ffa00333526ad9710e866d944dbe7a21c064e7d230f18affa3b1

See more details on using hashes here.

Provenance

File details

Details for the file mzdata2mat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mzdata2mat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for mzdata2mat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94b4e8ab404aafb92c9471ccb56e1fba623445eacec7be6209330b08eb55510c
MD5 82b0f1acef2641c40dcefe4c83345a18
BLAKE2b-256 803c74bdb4b01e1b4800427aae3709256dc62d27916d70a222c901f29008ba12

See more details on using hashes here.

Provenance

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