Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
PeakStrainer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
labShevchenko
PeakStrainer
Commits
e672634a
Commit
e672634a
authored
Jun 28, 2019
by
mirandaa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issues_11'
parents
08b8e84b
e07ad580
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
lib/reorderScans/reorderScans.py
lib/reorderScans/reorderScans.py
+10
-22
No files found.
lib/reorderScans/reorderScans.py
View file @
e672634a
...
...
@@ -9,6 +9,7 @@ import xml.etree.ElementTree as ET
import
os
import
re
import
copy
import
re
def
main
(
folderpath
=
None
):
app
=
wx
.
App
(
False
)
...
...
@@ -16,40 +17,27 @@ def main(folderpath = None):
frame
.
Show
(
True
)
app
.
MainLoop
()
def
getScanHeaders
(
filePath
):
# TODO:handle different namespaces of mzxml
namespaces
=
{
'xmlns'
:
'http://sashimi.sourceforge.net/schema_revision/mzXML_3.0'
}
ET
.
register_namespace
(
''
,
'http://sashimi.sourceforge.net/schema_revision/mzXML_3.0'
)
tree
=
ET
.
parse
(
filePath
)
scanElems
=
tree
.
findall
(
'.//xmlns:scan'
,
namespaces
)
scans
=
[]
for
scan
in
scanElems
:
# scanNo = int(scan.attrib['num'])
# scanNo = scan.attrib['num'].zfill(5)
# scan number ges confused with other values so its not good
# maybe add zerowidth space to solve '\u200b'
filterLine
=
scan
.
attrib
[
'filterLine'
]
scans
.
append
(
filterLine
)
return
scans
def
getScanHeaders
(
files
):
filterlines
=
[]
for
f
in
files
:
with
open
(
f
,
'r'
)
as
file
:
matches
=
re
.
findall
(
' filterLine="(.*?)" '
,
file
.
read
())
filterlines
.
extend
(
matches
)
return
list
(
set
(
filterlines
))
def
getMZXMLFiles
(
folderPath
):
result
=
[]
for
file
in
os
.
listdir
(
folderPath
):
if
file
.
lower
().
endswith
(
".mzxml"
):
result
.
append
(
os
.
path
.
join
(
folderPath
,
file
))
return
result
return
result
def
getSourceList
(
folderPath
):
sourceList
=
[]
files
=
getMZXMLFiles
(
folderPath
)
first
=
files
[
0
]
scans
=
getScanHeaders
(
first
)
scans
=
getScanHeaders
(
files
)
select
=
set
()
containsMS
=
False
...
...
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