Closed eeko-kon closed 3 years ago
Hi Efi, thanks for reaching out.
I copied your excerpt and parsed it and I got the data back:
In [1]: from pyteomics import mztab
In [2]: sirius = mztab.MzTab('excerpt.mzTab')
In [3]: sirius.metadata
Out[3]:
OrderedDict([('mzTab-version', '1.0.0'),
('mzTab-mode', None),
('mzTab-type', None),
('description', 'Sirius-4.6.0'),
('smallmolecule_search_engine_score[1]', 'SiriusScore'),
('smallmolecule_search_engine_score[2]', 'TreeScore'),
('smallmolecule_search_engine_score[3]', 'IsotopeScore'),
('ms_run[1]-location',
'data Thermo Orbitrap ID-X/FileFiltered Std/Agnes_POS_MDNA_WGS_103_Filtered.mzML')])
In [4]: sirius.small_molecule_table
Out[4]:
identifier chemical_formula smiles inchi_key description ... opt_global_mass_error_precursor_ppm opt_global_compoundId opt_global_compoundScanNumber opt_global_featureId opt_global_native_id
0 None C17H25BN2O2S None None None ... -4.038156 745 746 id_6128946280250909851 controllerType=0 controllerNumber=1 scan=746
1 None C17H28BN3O2S None None None ... -4.038156 745 746 id_6128946280250909851 controllerType=0 controllerNumber=1 scan=746
2 None C17H30BN3O3S None None None ... -51579.350708 745 746 id_6128946280250909851 controllerType=0 controllerNumber=1 scan=746
3 None C15H26FN3O2S None None None ... 6.370361 745 746 id_6128946280250909851 controllerType=0 controllerNumber=1 scan=746
4 None C15H31FN4O3S None None None ... -51568.942191 745 746 id_6128946280250909851 controllerType=0 controllerNumber=1 scan=746
[5 rows x 31 columns]
I don't think you should convert the MzTab
object into a dataframe. It already contains several dataframes, which you can access with attributes, such as small_molecule_table
.
Dear Levitzky,
Ah, I misunderstood. Thank you so much! Very easy.
Efi.
Hello! I am generating mzTab files from sirius, that have MTD, SMH and SML initials , but utf8 encoding only recognizes the SMH (most importantly, it completely skips the SML part of the data). Any suggestions? This is my script:
output:
This is part of the file generated from sirius (.mzTab):
Best, Efi