Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MSCompress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yu Gao
MSCompress
Commits
a4d9e249
Commit
a4d9e249
authored
Oct 31, 2021
by
yugao@uic.edu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added header reader to decoder
parent
0759b4b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
mscompress_onefile.py
mscompress_onefile.py
+6
-3
No files found.
mscompress_onefile.py
View file @
a4d9e249
...
...
@@ -67,7 +67,7 @@ def base64_encoder(number_array: np.ndarray, compress_method: str):
def
find_string
(
file_io_fp
,
mzml_read_fp
,
match_tag_start
,
match_tag_end
,
data_format
,
spec_no
,
compression
=
'auto'
):
start_time
=
time
.
time
()
if
compression
==
'zstd'
:
if
compression
.
lower
()
==
'zstd'
:
compressor
=
zstandard
.
ZstdCompressor
(
threads
=
2
)
file_name
=
mzml_read_fp
.
name
file_size
=
os
.
path
.
getsize
(
file_name
)
...
...
@@ -202,8 +202,10 @@ def mzml_decoder(msz_file, mzml_file, compression='auto'):
bmass_data
=
msz_fp
.
read
(
file_pos_array
[
3
]
-
file_pos_array
[
2
])
bint_data
=
msz_fp
.
read
(
file_pos_array
[
5
]
-
file_pos_array
[
4
])
if
compression
==
'auto'
:
compression
=
file_head
[
180
:
184
]
.
decode
(
'utf-8'
)
if
compression
==
'zstd'
:
if
compression
.
lower
()
==
'zstd'
:
decompressor
=
zstandard
.
ZstdDecompressor
()
bmass_data
=
decompressor
.
decompress
(
bmass_data
)
bint_data
=
decompressor
.
decompress
(
bint_data
)
...
...
@@ -211,6 +213,7 @@ def mzml_decoder(msz_file, mzml_file, compression='auto'):
smzml_file
=
smzml_data
.
decode
(
'utf8'
)
.
splitlines
()
# Create file pointers
#print(smzml_file[:2])
total_spec_no
=
int
.
from_bytes
(
bint_data
[
-
4
:],
byteorder
=
'little'
)
...
...
@@ -310,5 +313,5 @@ if __name__ == '__main__':
start
=
time
.
time
()
output_mzml
=
r'K:\test\test\out2.mzML'
mzml_decoder
(
msz_output
,
output_mzml
,
compression
=
args
.
compression
)
mzml_decoder
(
msz_output
,
output_mzml
,
compression
=
'auto'
)
print
(
"total time for unpacking:
%
ss"
%
(
time
.
time
()
-
start
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment