diff admin_scripts/build_mods_loc.py @ 20:2cafc729b2ae draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/peptideshaker commit 0e976aeeed9d516e0ad4735dc847b1f2eba3532b
author iracooke
date Sun, 31 May 2015 09:05:57 -0400
parents
children bb0130ff73ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/admin_scripts/build_mods_loc.py	Sun May 31 09:05:57 2015 -0400
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+import xml.etree.ElementTree as ET
+from os.path import exists
+
+with open("searchgui_mods.loc.sample", "w") as output:
+    for mods_path in ["searchGUI_mods.xml", "searchGUI_usermods.xml"]:
+        tree = ET.parse(mods_path)
+        modifications_el = tree.getroot()
+        for mod in modifications_el.findall("{http://www.ncbi.nlm.nih.gov}MSModSpec"):
+            name_el = mod.find("{http://www.ncbi.nlm.nih.gov}MSModSpec_name")
+            output.write("%s\n" % name_el.text.lower())