annotate build_proteases_loc.py @ 0:d4b6c9eae635 draft

Initial commit.
author galaxyp
date Fri, 10 May 2013 17:22:51 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
1 #!/usr/bin/env python
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
2
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
3 import xml.etree.ElementTree as ET
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
4 from os.path import exists
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
5
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
6 proteases_path = "proteases.xml"
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
7
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
8 tree = ET.parse(proteases_path)
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
9 proteases_el = tree.getroot()
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
10
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
11 with open("maxquant_proteases.loc", "w") as output:
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
12 for protease in proteases_el.getchildren():
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
13 output.write("%s\n" % protease.attrib["name"])
d4b6c9eae635 Initial commit.
galaxyp
parents:
diff changeset
14