Skip to content

Commit f91abbd

Browse files
authoredFeb 14, 2017
Merge pull request #1 from elijahspina/elijahspina-patch-1
Add files via upload
2 parents 7e828e9 + 8d233bb commit f91abbd

File tree

101 files changed

+10134
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+10134
-0
lines changed
 

‎Python/ANISEED_ISHparse2.py

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#-------------------------------------------------------------------------------
2+
# Name: module1
3+
# Purpose:
4+
#
5+
# Author: Eli
6+
#
7+
# Created: 14/04/2015
8+
# Copyright: (c) Eli 2015
9+
# Licence: <your licence>
10+
#-------------------------------------------------------------------------------
11+
12+
def main():
13+
pass
14+
15+
if __name__ == '__main__':
16+
main()
17+
18+
import sys
19+
20+
#Read data
21+
f_in = open("C:/users/eli/downloads/ish/ish_ci.xml")
22+
23+
#Print header row
24+
sys.stdout.write("gene" +"\t"+ "stage" +"\t"+ "tissue" +"\t"+ "pattern" +"\t"+ "original" +"\t"+ "source" +"\t"+ "exp" +"\t"+ "note" +'\n')
25+
26+
#Set number of header rows to skip
27+
headers = 3
28+
count = 1
29+
source = False
30+
31+
for line in f_in:
32+
33+
#Skip specified number of header lines
34+
if count <= headers:
35+
count+=1
36+
pass
37+
38+
#Parse desired information
39+
else:
40+
if "experiment id" in line:
41+
exp = "NA"
42+
stage = "NA"
43+
stage_source = "NA"
44+
gene = "NA"
45+
tissue = "NA"
46+
note = "NA"
47+
pattern = "NA"
48+
original = "NA"
49+
exp = line.split('"')[1]
50+
if "developmental_stage" in line and source == False:
51+
stage = line.split(">")[1].split('<')[0]
52+
source = True
53+
54+
if "developmental_stage" in line and source == True:
55+
stage_source = line.split(">")[1].split('<')[0]
56+
source = False
57+
58+
if "probe_gene_predicted" in line:
59+
gene = line.split(">")[1].split('<')[0]
60+
61+
if "staining_localization" in line:
62+
tissue = line.split(">")[1].split('<')[0]
63+
64+
if "image_note" in line:
65+
note = line.split(">")[1].split('<')[0]
66+
if "Expression pattern:" in note:
67+
pattern = note.split("Expression pattern:")[1].split("<")[0]
68+
69+
if "Original annotation:" in note:
70+
original = note.split("Original annotation:")[1].split(".")[0]
71+
72+
else:
73+
pass
74+
75+
#Output information for parsed record
76+
if "/experiment" in line:
77+
#results = [gene, stage, tissue, pattern, original, exp, note]
78+
output = "\t".join([gene, stage, tissue, pattern, original, stage_source, exp, note])
79+
sys.stdout.write(output + '\n')

‎Python/ANISEED_ISHparseET.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#-------------------------------------------------------------------------------
2+
# Name: module2
3+
# Purpose:
4+
#
5+
# Author: Eli
6+
#
7+
# Created: 14/04/2015
8+
# Copyright: (c) Eli 2015
9+
# Licence: <your licence>
10+
#-------------------------------------------------------------------------------
11+
12+
def main():
13+
pass
14+
15+
if __name__ == '__main__':
16+
main()
17+
18+
#http://effbot.org/zone/element.htm
19+
20+
import elementtree.ElementTree as ET
21+
import sys
22+
23+
tree = ET.parse("C:/users/eli/downloads/ish/ish_ci.xml")
24+
25+
# the tree root is the toplevel html element
26+
print tree.findtext("experiment")
27+
28+
# if you need the root element, use getroot
29+
root = tree.getroot()
30+
31+
print root

0 commit comments

Comments
 (0)
Please sign in to comment.