コード例 #1
0
def compress_file(file_path, out_path):
    print("Working on file {0}".format(file_path))
    with open(file_path) as fin:
        fin.seek(0, 2)
        max_offset_len = fin.tell()
        max_spec_no = pymzml.run.Reader(file_path).get_spectrum_count() + 10

    index_gzip(
        file_path, out_path, max_idx=max_spec_no, idx_len=len(str(max_offset_len))
    )
    print("Wrote file {0}".format(out_path))
    return
コード例 #2
0
ファイル: mzMLimporter.py プロジェクト: m-stofella/UniDec
def gzip_files(mzml_path, out_path):
    """
    Create and indexed gzip mzML file from a plain mzML.
    """
    with open(mzml_path) as fin:
        fin.seek(0, 2)
        max_offset_len = fin.tell()
        max_spec_no = pymzml.run.Reader(mzml_path).get_spectrum_count() + 10

    index_gzip(mzml_path,
               out_path,
               max_idx=max_spec_no,
               idx_len=len(str(max_offset_len)))
コード例 #3
0
ファイル: gzip_mzml.py プロジェクト: qdotme/pymzML
def main(mzml_path, out_path):
    """
    Create and indexed gzip mzML file from a plain mzML.

    Usage: python3 gzip_mzml.py <path/to/mzml> <path/to/output>
    """
    with open(mzml_path) as fin:
        fin.seek(0, 2)
        max_offset_len = fin.tell()
        max_spec_no = Reader(mzml_path).get_spectrum_count() + 10

    index_gzip(
        mzml_path, out_path, max_idx=max_spec_no, idx_len=len(str(max_offset_len))
    )
コード例 #4
0
def compress_file(file_path, out_path):
    print('Working on file {0}'.format(file_path))
    with open(file_path) as fin:
        fin.seek(0, 2)
        max_offset_len = fin.tell()
        max_spec_no = pymzml.run.Reader(file_path).get_spectrum_count() + 10

    index_gzip(
        file_path,
        out_path,
        max_idx=max_spec_no,
        idx_len=len(str(max_offset_len))
    )
    print('Wrote file {0}'.format(out_path))
    return
コード例 #5
0
ファイル: gzip_mzml.py プロジェクト: MKoesters/pymzML
def main(mzml_path, out_path):
    """
    Create and indexed gzip mzML file from a plain mzML.

    Usage: python3 gzip_mzml.py <path/to/mzml> <path/to/output>
    """
    with open(mzml_path) as fin:
        fin.seek(0,2)
        max_offset_len = fin.tell()
        max_spec_no    = Reader(mzml_path).get_spectrum_count() + 10

    index_gzip(
        mzml_path,
        out_path,
        max_idx = max_spec_no,
        idx_len = len(str(max_offset_len))
    )