summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-psims.spec292
-rw-r--r--sources1
3 files changed, 294 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..15fec70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/psims-1.2.4.tar.gz
diff --git a/python-psims.spec b/python-psims.spec
new file mode 100644
index 0000000..4652304
--- /dev/null
+++ b/python-psims.spec
@@ -0,0 +1,292 @@
+%global _empty_manifest_terminate_build 0
+Name: python-psims
+Version: 1.2.4
+Release: 1
+Summary: Writers and controlled vocabulary manager for PSI-MS's mzML and mzIdentML standards
+License: Apache Software License
+URL: https://github.com/mobiusklein/psims
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/20/cb/dcfe05da20f8af92093b0bf2c2335f806500d789bbb03c8622722e7a252c/psims-1.2.4.tar.gz
+BuildArch: noarch
+
+Requires: python3-lxml
+Requires: python3-six
+Requires: python3-sqlalchemy
+Requires: python3-numpy
+Requires: python3-h5py
+Requires: python3-hdf5plugin
+Requires: python3-pynumpress
+Requires: python3-h5py
+Requires: python3-hdf5plugin
+Requires: python3-pynumpress
+
+%description
+# psims
+Prototype work for a unified API for writing Proteomics Standards Initiative standardized formats
+for mass spectrometry:
+
+1. mzML
+2. mzIdentML
+3. mzMLb
+
+See the [Documenation](https://mobiusklein.github.io/psims) for more information
+
+## Installation
+With pip:
+```sh
+pip install psims
+```
+
+With conda:
+```sh
+conda install -c bioconda -c conda-forge -c defaults psims
+```
+
+## mzML Minimal Example
+
+```python
+from psims.mzml.writer import MzMLWriter
+
+# Load the data to write
+scans = get_scan_data()
+
+with MzMLWriter(open("out.mzML", 'wb'), close=True) as out:
+ # Add default controlled vocabularies
+ out.controlled_vocabularies()
+ # Open the run and spectrum list sections
+ with out.run(id="my_analysis"):
+ spectrum_count = len(scans) + sum([len(products) for _, products in scans])
+ with out.spectrum_list(count=spectrum_count):
+ for scan, products in scans:
+ # Write Precursor scan
+ out.write_spectrum(
+ scan.mz_array, scan.intensity_array,
+ id=scan.id, params=[
+ "MS1 Spectrum",
+ {"ms level": 1},
+ {"total ion current": sum(scan.intensity_array)}
+ ])
+ # Write MSn scans
+ for prod in products:
+ out.write_spectrum(
+ prod.mz_array, prod.intensity_array,
+ id=prod.id, params=[
+ "MSn Spectrum",
+ {"ms level": 2},
+ {"total ion current": sum(prod.intensity_array)}
+ ],
+ # Include precursor information
+ precursor_information={
+ "mz": prod.precursor_mz,
+ "intensity": prod.precursor_intensity,
+ "charge": prod.precursor_charge,
+ "scan_id": prod.precursor_scan_id,
+ "activation": ["beam-type collisional dissociation", {"collision energy": 25}],
+ "isolation_window": [prod.precursor_mz - 1, prod.precursor_mz, prod.precursor_mz + 1]
+ })
+```
+
+## Citing
+
+If you use `psims` in an academic project, please cite:
+
+ Klein, J. A., & Zaia, J. (2018). psims - A declarative writer for mzML and mzIdentML for Python. Molecular & Cellular Proteomics, mcp.RP118.001070. https://doi.org/10.1074/mcp.RP118.001070
+
+
+%package -n python3-psims
+Summary: Writers and controlled vocabulary manager for PSI-MS's mzML and mzIdentML standards
+Provides: python-psims
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-psims
+# psims
+Prototype work for a unified API for writing Proteomics Standards Initiative standardized formats
+for mass spectrometry:
+
+1. mzML
+2. mzIdentML
+3. mzMLb
+
+See the [Documenation](https://mobiusklein.github.io/psims) for more information
+
+## Installation
+With pip:
+```sh
+pip install psims
+```
+
+With conda:
+```sh
+conda install -c bioconda -c conda-forge -c defaults psims
+```
+
+## mzML Minimal Example
+
+```python
+from psims.mzml.writer import MzMLWriter
+
+# Load the data to write
+scans = get_scan_data()
+
+with MzMLWriter(open("out.mzML", 'wb'), close=True) as out:
+ # Add default controlled vocabularies
+ out.controlled_vocabularies()
+ # Open the run and spectrum list sections
+ with out.run(id="my_analysis"):
+ spectrum_count = len(scans) + sum([len(products) for _, products in scans])
+ with out.spectrum_list(count=spectrum_count):
+ for scan, products in scans:
+ # Write Precursor scan
+ out.write_spectrum(
+ scan.mz_array, scan.intensity_array,
+ id=scan.id, params=[
+ "MS1 Spectrum",
+ {"ms level": 1},
+ {"total ion current": sum(scan.intensity_array)}
+ ])
+ # Write MSn scans
+ for prod in products:
+ out.write_spectrum(
+ prod.mz_array, prod.intensity_array,
+ id=prod.id, params=[
+ "MSn Spectrum",
+ {"ms level": 2},
+ {"total ion current": sum(prod.intensity_array)}
+ ],
+ # Include precursor information
+ precursor_information={
+ "mz": prod.precursor_mz,
+ "intensity": prod.precursor_intensity,
+ "charge": prod.precursor_charge,
+ "scan_id": prod.precursor_scan_id,
+ "activation": ["beam-type collisional dissociation", {"collision energy": 25}],
+ "isolation_window": [prod.precursor_mz - 1, prod.precursor_mz, prod.precursor_mz + 1]
+ })
+```
+
+## Citing
+
+If you use `psims` in an academic project, please cite:
+
+ Klein, J. A., & Zaia, J. (2018). psims - A declarative writer for mzML and mzIdentML for Python. Molecular & Cellular Proteomics, mcp.RP118.001070. https://doi.org/10.1074/mcp.RP118.001070
+
+
+%package help
+Summary: Development documents and examples for psims
+Provides: python3-psims-doc
+%description help
+# psims
+Prototype work for a unified API for writing Proteomics Standards Initiative standardized formats
+for mass spectrometry:
+
+1. mzML
+2. mzIdentML
+3. mzMLb
+
+See the [Documenation](https://mobiusklein.github.io/psims) for more information
+
+## Installation
+With pip:
+```sh
+pip install psims
+```
+
+With conda:
+```sh
+conda install -c bioconda -c conda-forge -c defaults psims
+```
+
+## mzML Minimal Example
+
+```python
+from psims.mzml.writer import MzMLWriter
+
+# Load the data to write
+scans = get_scan_data()
+
+with MzMLWriter(open("out.mzML", 'wb'), close=True) as out:
+ # Add default controlled vocabularies
+ out.controlled_vocabularies()
+ # Open the run and spectrum list sections
+ with out.run(id="my_analysis"):
+ spectrum_count = len(scans) + sum([len(products) for _, products in scans])
+ with out.spectrum_list(count=spectrum_count):
+ for scan, products in scans:
+ # Write Precursor scan
+ out.write_spectrum(
+ scan.mz_array, scan.intensity_array,
+ id=scan.id, params=[
+ "MS1 Spectrum",
+ {"ms level": 1},
+ {"total ion current": sum(scan.intensity_array)}
+ ])
+ # Write MSn scans
+ for prod in products:
+ out.write_spectrum(
+ prod.mz_array, prod.intensity_array,
+ id=prod.id, params=[
+ "MSn Spectrum",
+ {"ms level": 2},
+ {"total ion current": sum(prod.intensity_array)}
+ ],
+ # Include precursor information
+ precursor_information={
+ "mz": prod.precursor_mz,
+ "intensity": prod.precursor_intensity,
+ "charge": prod.precursor_charge,
+ "scan_id": prod.precursor_scan_id,
+ "activation": ["beam-type collisional dissociation", {"collision energy": 25}],
+ "isolation_window": [prod.precursor_mz - 1, prod.precursor_mz, prod.precursor_mz + 1]
+ })
+```
+
+## Citing
+
+If you use `psims` in an academic project, please cite:
+
+ Klein, J. A., & Zaia, J. (2018). psims - A declarative writer for mzML and mzIdentML for Python. Molecular & Cellular Proteomics, mcp.RP118.001070. https://doi.org/10.1074/mcp.RP118.001070
+
+
+%prep
+%autosetup -n psims-1.2.4
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-psims -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.4-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..c073021
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+9c9ebc1b57c3b2758fd7759c474076ec psims-1.2.4.tar.gz