Mercurial > repos > galaxyp > maxquant
diff build_mods_loc.py @ 0:d4b6c9eae635 draft
Initial commit.
author | galaxyp |
---|---|
date | Fri, 10 May 2013 17:22:51 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build_mods_loc.py Fri May 10 17:22:51 2013 -0400 @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import xml.etree.ElementTree as ET +from os.path import exists + +mods_path = "extended_modifications.xml" + +if not exists(mods_path): + mods_path = "modifications.xml" + +tree = ET.parse(mods_path) +modifications_el = tree.getroot() + +with open("maxquant_mods.loc", "w") as output: + for mod in modifications_el.getchildren(): + if mod.find("type").text.strip() == "standard": + output.write("%s\n" % mod.attrib["title"])