forked from galaxyproject/tools-iuc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mzmine: bump to 3.9 * mzmine: limit number of cores fro JVM * mzmine: add possibility to use local CSV database * mzmine: reduce amount of remote test data and version the remaining * mzmine: comment tests don't work unless planemo can use the 23.1 galaxy packages * Change quoting Co-authored-by: Björn Grüning <[email protected]> * improve help message * allow also tsv and txt technically all this is allowed, batch file can specify the delimiter the example uses ; --------- Co-authored-by: Björn Grüning <[email protected]>
- Loading branch information
1 parent
3a3dfd6
commit 889d26f
Showing
5 changed files
with
9,199 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import argparse | ||
import re | ||
import sys | ||
from xml.etree import ElementTree | ||
|
||
parser = argparse.ArgumentParser( | ||
prog="set_path.py", description="update paths in mzmine batch XML" | ||
) | ||
parser.add_argument("--input", help="input XML") | ||
parser.add_argument("--output", help="output XML") | ||
parser.add_argument("--localdb", required=False, help="Local CVS DB for Search") | ||
args = parser.parse_args() | ||
|
||
PATHSEP = re.compile(r"[/\\]") | ||
tree = ElementTree.parse(args.input) | ||
|
||
for batchstep in tree.findall(".//batchstep"): | ||
method = batchstep.attrib.get("method") | ||
for current_file in batchstep.findall(".//current_file"): | ||
if ( | ||
method | ||
== "io.github.mzmine.modules.dataprocessing.id_localcsvsearch.LocalCSVDatabaseSearchModule" | ||
): | ||
if args.localdb: | ||
current_file.text = args.localdb | ||
else: | ||
sys.exit("Batch file contains LocalCSVDatabaseSearchModule but no local DB CSV file given") | ||
else: | ||
current_file.text = f"./output/{PATHSEP.split(current_file.text)[-1]}" | ||
|
||
tree.write(args.output) |
Oops, something went wrong.