Mercurial > repos > galaxyp > maxquant
annotate build_mods_loc.py @ 0:d4b6c9eae635 draft
Initial commit.
| author | galaxyp |
|---|---|
| date | Fri, 10 May 2013 17:22:51 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
| 0 | 1 #!/usr/bin/env python |
| 2 | |
| 3 import xml.etree.ElementTree as ET | |
| 4 from os.path import exists | |
| 5 | |
| 6 mods_path = "extended_modifications.xml" | |
| 7 | |
| 8 if not exists(mods_path): | |
| 9 mods_path = "modifications.xml" | |
| 10 | |
| 11 tree = ET.parse(mods_path) | |
| 12 modifications_el = tree.getroot() | |
| 13 | |
| 14 with open("maxquant_mods.loc", "w") as output: | |
| 15 for mod in modifications_el.getchildren(): | |
| 16 if mod.find("type").text.strip() == "standard": | |
| 17 output.write("%s\n" % mod.attrib["title"]) |
