3.4. File Access¶
pymzML offers support for different kinds of mzML files. The following classes are wrappers for different types of mzML files, which allows the implementation of file type specific search and data retrieving algorithms. An explanation of how to implement your own file class can be found in the advanced section.
3.4.1. File Interface¶
-
class
pymzml.file_interface.FileInterface(path, encoding)[source]¶ -
__getitem__(identifier)[source]¶ Access the item with id ‘identifier’ in the file
Parameters: identifier (str) – native id of the item to access Returns: data – text associated with the given identifier Return type: str
-
__init__(path, encoding)[source]¶ Initialize a object interface to mzML files
Parameters: - path (str) – path to the mzML file
- encoding (str) – encoding of the file
-
_indexed_gzip(path)[source]¶ Check if the given file is an indexed gzip file or not
Parameters: path (str) – path to the file Returns: True if path is a gzip file with index, else False Return type: bool
-
_open(path)[source]¶ Open a file like object resp. a wrapper for a file like object.
Parameters: path (str) – path to the mzml file Returns: instance of StandardGzip,IndexedGziporStandardMzml, based on the file ending of ‘path’Return type: file_handler
-
3.4.2. File Classes¶
3.4.2.1. mzML¶
-
class
pymzml.file_classes.standardMzml.StandardMzml(path, encoding)[source]¶ -
__getitem__(identifier)[source]¶ Access the item with id ‘identifier’ in the file using either linear, binary or interpolated search.
Parameters: identifier (str) – native id of the item to access Returns: data – text associated with the given identifier Return type: str
-
__init__(path, encoding)[source]¶ Initalize Wrapper object for standard mzML files.
Parameters: - path (str) – path to the file
- encoding (str) – encoding of the file
-
3.4.2.2. Gzip¶
-
class
pymzml.file_classes.standardGzip.StandardGzip(path, encoding)[source]¶ -
_StandardGzip__build_index()¶ Cant build index for standard gzip files
-
__getitem__(identifier)[source]¶ Access the item with id ‘identifier’ in the file by iterating the XML-tree.
Parameters: identifier (str) – native id of the item to access Returns: data – text associated with the given identifier Return type: str
-
3.4.2.3. iGzip¶
-
class
pymzml.file_classes.indexedGzip.IndexedGzip(path, encoding)[source]¶ -
_IndexedGzip__build_index()¶ Use the GSGR class to retrieve the index from the file and save it.
-
__getitem__(identifier)[source]¶ Access the item with id ‘identifier’ in the file.
Parameters: identifier (str) – native id of the item to access Returns: data – text associated with the given identifier Return type: str
-