%global _empty_manifest_terminate_build 0 Name: python-psims Version: 1.2.5 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.aliyun.com/pypi/web/packages/a7/54/e4faeab95d284236727d68d9cfd4b4283e92814e01253ed86cc8ef52bf29/psims-1.2.5.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.5 %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 * Thu Jun 08 2023 Python_Bot - 1.2.5-1 - Package Spec generated