view 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 source

#!/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"])