dimspy.portals package¶
Submodules¶
dimspy.portals.hdf5_portal module¶
The PeakList and PeakMatrix HDF5 portals.
New in version 0.1.
-
dimspy.portals.hdf5_portal.
save_peaklists_as_hdf5
(pkls, file_name)¶ Saves multiple peaklists in HDF5 file.
Parameters: - pkls – the target list of peaklist objects
- file_name – name of the file to export data
To incorporate with different dtypes in the attribute matrix, this portal converts all the arribute values into fix-lenght strings for HDF5 data tables storage. The order of the peaklists will be retained.
-
dimspy.portals.hdf5_portal.
load_peaklists_from_hdf5
(file_name)¶ Loads a list of peaklists from HDF5 file.
Parameters: file_name – name of the file to import data Return type: list The values in HDF5 data tables are automatically converted to their original dtypes before loading in the the peaklist.
-
dimspy.portals.hdf5_portal.
save_peak_matrix_as_hdf5
(pm, file_name)¶ Saves a peak matrix in HDF5 file.
Parameters: - pm – the target peak matrix object
- file_name – name of the file to export data
The order of the attributes and flags will be retained.
-
dimspy.portals.hdf5_portal.
load_peak_matrix_from_hdf5
(file_name)¶ Loads a peak matrix from HDF5 file.
Parameters: file_name – name of the file to import data Return type: PeakMatrix object
dimspy.portals.mzml_portal module¶
dimspy.portals.txt_portal module¶
The PeakList and PeakMatrix plain text portals.
New in version 0.1.
-
dimspy.portals.txt_portal.
save_peaklist_as_txt
(pkl, file_name, *args, **kwargs)¶ Saves a peaklist in plain text file.
Parameters: - pkl – the target peaklist object
- file_name – name of the file to export data
- args – arguments to be passed to PeakList.to_str
- kwargs – keyword arguments to be passed to PeakList.to_str
-
dimspy.portals.txt_portal.
load_peaklist_from_txt
(file_name, ID, delimiter=', ', flag_names='auto', has_flag_col=True)¶ Loads a peaklist from plain text file.
Parameters: - file_name – name of the file to import data
- ID – ID of the loaded peaklist
- delimiter – delimiter of the text lines. Default = ‘,’, i.e., CSV format
- flag_names – names of the flag attributes. Default = ‘auto’, indicating all the attribute names ends with “_flag” will be treated as flag attibute. Provide None to indicate no flag attributes
- has_flag_col – whether the text file contains the overall “flags” column. If True, it’s values will be discarded. The overall flags of the new peaklist will be calculated automatically. Default = True
Return type: PeakList object
-
dimspy.portals.txt_portal.
save_peak_matrix_as_txt
(pm, file_name, *args, **kwargs)¶ Saves a peak matrix in plain text file.
Parameters: - pm – the target peak matrix object
- file_name – name of the file to export data
- args – arguments to be passed to PeakMatrix.to_str
- kwargs – keyword arguments to be passed to PeakMatrix.to_str
-
dimspy.portals.txt_portal.
load_peak_matrix_from_txt
(file_name, delimiter='\t', transposed=False, comprehensive=False)¶ Loads a peak matrix from plain text file.
Parameters: - file_name – name of the file to import data
- delimiter – delimiter of the text lines. Default = ‘ ‘, i.e., TSV format
- transposed – whether the attribute matrix has been transposed during the export. Default = False
- comprehensive – whether the comprehensive information has been included during the export. Default = False
Return type: PeakMatrix object