File size: 2,081 Bytes
ab93432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: unknown
task_categories:
- other
tags:
- mass-spectrometry
- proteomics
- metabolomics
- mscompress
size_categories:
- n<1K
---

# My MSZ Dataset

A dataset containing mass spectrometry data in MSZ format.

## Dataset Information

- **Format**: MSZ (compressed mass spectrometry)
- **Number of files**: 1
- **Granularity**: spectrum-level
- **Filter**: All MS levels

## Files

- `test.msz`

## Usage

This dataset requires the `mscompress` library to load the MSZ files.

### Installation

```bash
pip install mscompress
```

### Loading the Dataset

```python
from datasets import load_dataset

# Load the dataset
dataset = load_dataset("my-msz-dataset")

# Access spectra
for example in dataset["train"]:
    mz = example["mz"]
    intensity = example["intensity"]
    print(f"Spectrum {example['scan_number']}: {len(mz)} peaks")
```

### Direct MSZ File Access

For more control, you can download and read the MSZ files directly:

```python
import mscompress
from huggingface_hub import hf_hub_download

# Download an MSZ file
msz_path = hf_hub_download(
    repo_id="<repo_id>",
    filename="data/test.msz",
    repo_type="dataset"
)

# Read with mscompress
msz = mscompress.read(msz_path)

# Access spectra with random access
spectrum = msz.spectra[0]
print(f"m/z: {spectrum.mz}")
print(f"Intensity: {spectrum.intensity}")
```

## Dataset Structure


### Spectrum-level Features

- `source_file`: Name of the source MSZ file
- `spectrum_index`: Index of the spectrum in the file
- `scan_number`: Scan number from the instrument
- `ms_level`: MS level (1 for MS1, 2 for MS2/MS3, etc.)
- `retention_time`: Retention time in seconds
- `num_peaks`: Number of m/z-intensity pairs
- `mz`: Array of m/z values
- `intensity`: Array of intensity values

## Citation

If you use this dataset, please cite the mscompress library:

```
@software{mscompress,
  title = {mscompress: High-performance compression for mass spectrometry data},
  url = {https://github.com/chrisagrams/mscompress}
}
```

## License

Please check with the dataset creator for license information.