annotate aggregate.py @ 12:04ee1373b7e7 draft

Uploaded
author kaymccoy
date Fri, 12 Aug 2016 22:49:34 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
1 # A translation of aggregate.pl into python! For analysis of Tn-Seq.
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
2 # This script requires BioPython just like calc_fitness.py, so you need it installed along with its dependencies if you want to run these scripts on your own.
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
3 # How to install BioPython and a list of its dependencies can be found here: http://biopython.org/DIST/docs/install/Installation.html
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
4 # K. McCoy
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
5
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
6
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
7
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
8
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
9
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
10
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
11
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
12
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
13
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
14 ##### ARGUMENTS #####
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
15
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
16 def print_usage():
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
17 print "Aggregate.py's usage is as follows:" + "\n\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
18 print "\033[1m" + "Required" + "\033[0m" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
19 print "-o" + "\t\t" + "Output file for aggregated data." + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
20 print "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
21 print "\033[1m" + "Optional" + "\033[0m" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
22 print "-c" + "\t\t" + "Check for missing genes in the data set - provide a reference genome in genbank format. Missing genes will be sent to stdout." + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
23 print "-m" + "\t\t" + "Place a mark in an extra column for this set of genes. Provide a file with a list of genes seperated by newlines." + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
24 print "-x" + "\t\t" + "Cutoff: Don't include fitness scores with average counts (c1+c2)/2 < x (default: 0)" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
25 print "-b" + "\t\t" + "Blanks: Exclude -b % of blank fitness scores (scores where c2 = 0) (default: 0 = 0%)" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
26 print "-f" + "\t\t" + "An in-between file carrying information on the blank count found from calc_fitness or consol_fitness; one of two ways to pass a blank count to this script" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
27 print "-w" + "\t\t" + "Use weighted algorithm to calculate averages, variance, sd, se" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
28 print "-l" + "\t\t" + "Weight ceiling: maximum value to use as a weight (default: 999,999)" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
29 print "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
30 print "All remainder arguements will be treated as fitness files (those files created by calc_fitness.py)" + "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
31 print "\n"
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
32
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
33 import argparse
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
34 parser = argparse.ArgumentParser()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
35 parser.add_argument("-o", action="store", dest="summary")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
36 parser.add_argument("-c", action="store", dest="find_missing")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
37 parser.add_argument("-m", action="store", dest="marked")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
38 parser.add_argument("-x", action="store", dest="cutoff")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
39 parser.add_argument("-b", action="store", dest="blank_pc")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
40 parser.add_argument("-f", action="store", dest="blank_file")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
41 parser.add_argument("-w", action="store", dest="weighted")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
42 parser.add_argument("-l", action="store", dest="weight_ceiling")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
43 parser.add_argument("fitnessfiles", nargs=argparse.REMAINDER)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
44
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
45 arguments = parser.parse_args()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
46
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
47 if not arguments.summary:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
48 print "\n" + "You are missing a value for the -o flag. "
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
49 print_usage()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
50 quit()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
51
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
52 if not arguments.fitnessfiles:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
53 print "\n" + "You are missing fitness file(s); these should be entered immediately after all the flags. "
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
54 print_usage()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
55 quit()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
56
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
57 # 999,999 is a trivial placeholder number
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
58
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
59 if (not arguments.weight_ceiling):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
60 arguments.weight_ceiling = 999999
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
61
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
62 # Cutoff exists to discard positions with a low number of counted transcripts, because their fitness may not be as accurate - for the same reasoning that studies with low sample sizes can be innacurate.
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
63
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
64 if (not arguments.cutoff):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
65 arguments.cutoff = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
66
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
67 # Gets information from the txt output file of calc_fit / consol, if inputted
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
68
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
69 if arguments.blank_file:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
70 with open(arguments.blank_file) as file:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
71 blank_pc = file.read().splitlines()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
72 arguments.blank_pc = float(blank_pc[0].split()[1])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
73
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
74 if (not arguments.blank_pc):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
75 arguments.blank_pc = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
76
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
77
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
78
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
79
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
80
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
81 ##### SUBROUTINES #####
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
82
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
83 # A subroutine that calculates the average, variance, standard deviation (sd), and standard error (se) of a group of scores; for use when aggregating scores by gene later on
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
84
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
85 import math
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
86 def average(scores):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
87 sum = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
88 num = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
89 for i in scores:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
90 ###!!!
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
91 print i
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
92 sum += i
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
93 num += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
94 average = sum/num
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
95 xminusxbars = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
96 for i in scores:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
97 xminusxbars += (i - average)**2
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
98 variance = xminusxbars/(num-1)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
99 sd = math.sqrt(variance)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
100 se = sd / math.sqrt(num)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
101 return (average, variance, sd, se)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
102
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
103 # A subroutine that calculates the weighted average, variance, standard deviation (sd), and standard error (se) of a group of scores; the weights come from the number of reads each insertion location has
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
104 # For use when aggregating scores by gene later on, if the weighted argument is called
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
105
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
106 def weighted_average(scores,weights):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
107 sum = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
108 weighted_average = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
109 weighted_variance = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
110 top = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
111 bottom = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
112 i = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
113 while i < len(weights):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
114 if not scores[i]:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
115 scores[i] = 0.0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
116 top += float(weights[i])*float(scores[i])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
117 bottom += float(weights[i])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
118 i += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
119 if bottom == 0:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
120 return 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
121 weighted_average = top/bottom
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
122 top = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
123 bottom = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
124 i = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
125 while i < len(weights):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
126 top += float(weights[i]) * (float(scores[i]) - weighted_average)**2
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
127 bottom += float(weights[i])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
128 i += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
129 weighted_variance = top/bottom
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
130 weighted_stdev = math.sqrt(weighted_variance)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
131 weighted_stder = weighted_stdev/math.sqrt(len(scores))
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
132 return (weighted_average, weighted_variance, weighted_stdev, weighted_stder)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
133
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
134
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
135
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
136
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
137
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
138
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
139
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
140
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
141
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
142
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
143 ##### AGGREGATION / CALCULATIONS #####
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
144
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
145 #Reads the genes which should be marked in the final aggregate file into an array
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
146
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
147 import os.path
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
148 if arguments.marked:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
149 with open(arguments.marked) as file:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
150 marked_set = file.read().splitlines()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
151
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
152 #Creates a dictionary of dictionaries to contain a summary of all genes and their fitness values
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
153 #The fitness values and weights match up, so that the weight of gene_summary[locus]["w"][2] would be gene_summary[locus]["s"][2]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
154
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
155 import csv
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
156 gene_summary = {}
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
157 for eachfile in arguments.fitnessfiles:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
158 with open(eachfile) as csvfile:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
159 lines = csv.reader(csvfile)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
160 for line in lines:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
161 locus = line[9]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
162 w = line[12]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
163 if w == 'nW':
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
164 continue
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
165 if not w:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
166 w == 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
167 c1 = float(line[2])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
168 c2 = float(line[3])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
169 avg = (c1+c2)/2
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
170 if avg < float(arguments.cutoff):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
171 continue
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
172 if avg > float(arguments.weight_ceiling):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
173 avg = arguments.weight_ceiling
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
174 if locus not in gene_summary:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
175 gene_summary[locus] = {"w" : [], "s": []}
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
176 gene_summary[locus]["w"].append(w)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
177 gene_summary[locus]["s"].append(avg)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
178
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
179 #If finding any missing gene loci is requested in the arguments, starts out by loading all the known features from a genbank file
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
180
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
181 from Bio import SeqIO
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
182 if (arguments.find_missing):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
183 output = [["locus","mean","var","sd","se","gene","Total","Blank","Not Blank","Blank Removed","M\n"]]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
184 handle = open(arguments.find_missing, "rU")
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
185 for record in SeqIO.parse(handle, "genbank"):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
186 refname = record.id
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
187 features = record.features
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
188 handle.close()
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
189
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
190 #Goes through the features to find which are genes
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
191
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
192 for feature in features:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
193 gene = ""
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
194 if feature.type == "gene":
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
195 locus = "".join(feature.qualifiers["locus_tag"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
196 if "gene" in feature.qualifiers:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
197 gene = "".join(feature.qualifiers["gene"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
198 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
199 continue
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
200
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
201 #Goes through the fitness scores of insertions within each gene, and removes whatever % of blank fitness scores were requested along with their corresponding weights
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
202
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
203 #!!! issue = locus["w"] returning str not float for some reason!
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
204
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
205 sum = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
206 num = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
207 avgsum = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
208 blank_ws = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
209 i = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
210 if locus in gene_summary.keys():
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
211 for w in gene_summary[locus]["w"]:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
212 if float(w) == 0:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
213 blank_ws += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
214 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
215 sum += float(w)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
216 num += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
217 count = num + blank_ws
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
218 removed = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
219 to_remove = int(float(arguments.blank_pc)*count)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
220 if blank_ws > 0:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
221 i = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
222 while i < len(gene_summary[locus]["w"]):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
223 w = gene_summary[locus]["w"][i]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
224 if removed == to_remove:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
225 break
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
226 if float(w) == 0:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
227 del gene_summary[locus]["w"][i]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
228 del gene_summary[locus]["s"][i]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
229 removed += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
230 i -= 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
231 i += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
232
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
233 #If all the fitness values within a gene are empty, sets mean/var to 0.10 and Xs out sd/se; marks the gene if that's requested
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
234
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
235 if num == 0:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
236 if (arguments.marked and locus in marked_set):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
237 output.append([locus, "0.10", "0.10", "X", "X", gene, count, blank_ws, num, removed, "M", "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
238 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
239 output.append([locus, "0.10", "0.10", "X", "X", gene, count, blank_ws, num, removed, "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
240
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
241 #Otherwise calls average() or weighted_average() to find the aggregate w / count / standard deviation / standard error of the insertions within each gene; marks the gene if that's requested
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
242
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
243 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
244 if not arguments.weighted:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
245 (average, variance, stdev, stderr) = average(gene_summary[locus]["w"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
246 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
247 (average, variance, stdev, stderr) = weighted_average(gene_summary[locus]["w"],gene_summary[locus]["s"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
248 if (arguments.marked and locus in marked_set):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
249 output.append([locus, average, variance, stdev, stderr, gene, count, blank_ws, num, removed, "M", "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
250 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
251 output.append([locus, average, variance, stdev, stderr, gene, count, blank_ws, num, removed, "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
252
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
253 #If a gene doesn't have any insertions, sets mean/var to 0.10 and Xs out sd/se, plus leaves count through removed blank because there were no reads.
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
254
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
255 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
256 if (arguments.marked and locus in marked_set):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
257 output.append([locus, "0.10", "0.10", "X", "X", gene, "", "", "", "", "M", "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
258 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
259 output.append([locus, "0.10", "0.10", "X", "X", gene, "", "", "", "", "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
260
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
261 #Writes the aggregated fitness file
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
262
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
263 with open(arguments.summary, "wb") as csvfile:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
264 writer = csv.writer(csvfile)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
265 writer.writerows(output)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
266
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
267 #If finding missing genes is not requested, just finds the aggregate w / count / standard deviation / standard error of the insertions within each gene, and writes them to a file, plus marks the genes requested
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
268 #This is never called through Galaxy since finding missing genes is just better than not finding them.
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
269
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
270 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
271 output = [["Locus","W","Count","SD","SE","M\n"]]
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
272 for gene in gene_summary.keys():
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
273 sum = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
274 num = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
275 average = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
276 if "w" not in gene_summary[gene]:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
277 continue
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
278 for i in gene_summary[gene]["w"]:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
279 sum += i
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
280 num += 1
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
281 average = sum/num
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
282 xminusxbars = 0
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
283 for i in w:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
284 xminusxbars += (i-average)**2
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
285 if num > 1:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
286 sd = math.sqrt(xminusxbars/(num-1))
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
287 se = sd / math.sqrt(num)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
288 if (arguments.marked and locus in marked_set):
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
289 output.append([gene, average, num, sd, se, "M", "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
290 else:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
291 output.append([gene, average, num, sd, se, "\n"])
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
292 with open(arguments.summary, "wb") as csvfile:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
293 writer = csv.writer(csvfile)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
294 writer.writerows(output)
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
295
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
296
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
297
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
298
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
299
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
300
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
301
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
302
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
303
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
304
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
305
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
306
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
307
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
308
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
309
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
310
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
311
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
312
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
313
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
314
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
315
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
316
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
317
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
318
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
319
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
320
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
321
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
322
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
323
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
324
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
325
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
326
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
327
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
328
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
329
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
330
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
331
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
332
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
333
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
334
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
335
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
336
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
337
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
338
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
339
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
340
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
341
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
342
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
343
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
344
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
345
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
346
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
347
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
348
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
349
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
350
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
351
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
352
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
353
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
354
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
355
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
356
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
357
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
358
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
359
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
360
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
361
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
362
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
363
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
364
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
365
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
366
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
367
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
368
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
369
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
370
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
371
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
372
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
373
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
374
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
375
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
376
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
377
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
378
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
379
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
380
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
381
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
382
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
383
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
384
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
385
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
386
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
387
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
388
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
389
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
390 #
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
391 # ~MMM=:DMMM?, +NMMO=,:~I8MMMMM8+, , ~I8MMMMMN87~?8NNMMN8: +NMND~ +MN= ,$MMMI ?M8, ,OM8, :MN+ =MM? ,MMDNMMD ,+DM8I, ,,:::~~~::::::::::
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
392 # IMMMNMM8I ,I8MM87~::+$8NNMMMMOI+=~~:, ,,:~=?$DNMMMMMMDOZI7ZDMMMD8I , , $M8+?8MM8I , 7MI +MN= ZMN, 8MD MMN8MMM, :$ONM8I+=:, ,,,::::~~~~~=====~:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
393 # , ,DMNN7: , ,OMMN7==~::~=?8NNMMMMMMNNMMMMMMMMMMMN8OO8ODNMMMMMD~ , IMMNMN~ ,OM+ ,NM$ ,NMO, :MM$ , ,:::,,::::,, $MNMMNM, ,,, :?ONMMNN8?~,, , ,,,,,,,::~~=+++??=~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
394 # ,,:=+????+, I$ :ZMMN8$~:,,, ,:=?7$O8DD8O$7+==+$O8DNMMMMMMMMM$ ?$, == ,~, ~NM= 8MD, ,OM8ZMMO , ,::::::~~~:,, ?MNMMZ ,,,,,, ,+7ONMNMD8O$+~, ,,,,,,::~====::
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
395 # ,:=IONMMMMMMMMMMM8: ZN$: ,~DMMMND7=, ,,:~====:=$DNMMMMMMMN88MMMZ +N$ , ,7DN8= =MN, IMM =DMN7 ,,,,,,,,,, ,~?, ,,,,, , ~?$8MMMMNN8Z?~:,, ,:::,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
396 #+ONMMMMMMNO7=:,, ,,+MMO, 7D$: ~OMNMNNMNNNNNNNNNNNMMMMMMMMMNMMMM?,~MMM8 ND, 7MM=, ?NN:, +MO, ?MM, ,,,, , :,:=$DMMMMMMN87=~, ,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
397 #MMND8$: , 7NM7 , =?~,,, :?88DDDNNMNNNDNDD88Z?:, ZMM$ ,MMMO ,MM+ZNMM? ::ZNZ, +M$ ,MM?, , ,, ,,:=?Z8NMMMMMN8Z+=,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
398 #: ~ZMM8~ ,,,, 8MM, +MMM, 7ZZI~=$OOZ$: ,:+???+, +MZ =MN= ,,, , ,,:~=?IIII$ZO88DDNNNNNNMMMMMMMMMMN~,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
399 # ,:OMMM? ,,:,, 8MM ~NNM7 :OMMMMMMMMO: =M8, :NM~ = ,~?I, ,,,,,,,,,,,,,, ,~$DNMMMMMMMMMND8O888Z$II7777I??+++===:,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
400 # ?DMM8?, OMN??NMM$ ~8MMMO?===7MMM8: ~NM= =NN: ,OM~ ,, +NMMN~ ,,,,, ,,,,,,,, ,?$O8NNMDDZ7?+=~:, , , ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
401 # , ~$MMMD+ , , ~MMNMMN~ : +NMMZ, NMNM~ 7MI , ZNN,, IMN, :DMNM+ ~+NMMMD~, ,,,,,,,, ,, ,,,,,:, +OMNMMOI~,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
402 # , $MMMM$, , ,=?ODNMNNMNMMMMNNND~ ,$D$, , ,8MM8 ,MMM7 ,ZMNNMM= DMMNMMMMMMMMMMMMNI: , ,,,,,,,,, ,,, ?NMO=, ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
403 # ,~ZNMND7, ,,:~=+$DNNMMMMNDDDD888OZZZZ8NMMN IMMN: ,MMN~ +Z$+, ?NNNDO+:?O888OI, ,,,,,,, ,,, +MN+
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
404 # =ONMMM8~ , ,:=IDMMMMMMMND8$+:, , ,INMNZ :MMM~, , +MMD , ,, ,,::,,,, ,,:::, ?M8: ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
405 #8MMMNZ~ , =I$ONMMNDZ7?+, ,,=I8NMD7: DMMN DMN= ,:::, ,:~~=~~:,, :ZMMZI+: ,, ,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
406 #MN7:,:=7ONMMMD$?=, , ~7ODNMM$+: ~MMM++7ZOZOO8O8D8$~ ,MM8 ,,,,::~~==~~:,, :+7DMMMMNNDD88OOZZZO88DNNNN8=, ,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
407 #I,~+DMMNND7: , ,$MMMMMN7, $MMN :??+=~::,,,, NMD, ,:,,:::~=~~,,,, ,,=I$8DNMMMMMMMMMNMMMNZ: ,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
408 #DNMNN7:, ,+ONMMMMNI: NMM$ DMN= ,,,,:::::~~::,, ?DMMMMDZ=, ,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
409 #N8$: ,,, ,:=?ONMMMD8Z+, ,,,, MMM= ZMMI ,=?$8NMMMMMMMMMMMN87=~~,,, :=ZMMMMD$~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
410 # , ,=ZNMMMMMNI:, ,~?Z88888$=, ,:~+??~, MMM, IMM$ ,=ZNMMMMMN8$+~=~=~~===7ODNMMMN8DNMMMN+, ,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
411 # , ~?$ODMMMMNZ?: :II+~, ,=7= :?77?=:====?O+ ,,:,,, MMM, ?MM$ ,,,, :?ONMM8II=, , =DMMMM87=, ,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
412 # , ,, ,~I8MMMMMMN87?~:=+?7$ZOO88DD888O$I+~:, ~ZZ: ,$7,~??, ,?+ ,+Z8$?==??= MMM =MM$ :?ODNNNNNNNMMO: ,:?NNMNO= ,,,IMMMNZ, ,,,:,,,,,,,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
413 #, ,~7DNMMMMMMMMMMMNNNNMMMNND8Z7II7$$$$ZODNNNMND$, :O$: , ,IN$, I+ +ZZ=,, 7+ MMM =ODDDDNNNNNN8= :MM$ ?DDNN8?::,, ,,7NMM8, 7NMNZ~, :OMMM$, , ,,:::~~:,,,,,,,,,,,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
414 #?8NMMMMMMMMMMMN8I:,,, ~$NMMM$ :87 +DM$ ID+~78I, O7 :=+~ MMM , , ?MM7 $NMN$, :I8MMMMMMNMDNNNNNNNNNDD88ZI=: ,ZMM7, +MMN~ ,,,:::,, ,,:,::::,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
415 #MMMD8DNMDZ7=: ,:=+7ZNNNDOZ~ =DI , :7MM7, IDDZI, =DN88ZI77$N? NMM: $MM= ~: =OMNZ+ ,=7DMMMMMMNDDOOOOZ$7IIIII77$ZOO8NNMMD$+~ :OND~, ,, MMN= ,,,,,,,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
416 #: ,,, , ,:+ZNMNNMMNO?: +8? +NMN7 , , ON~ 8MM$ NMD, ,7MMMN, 7MMO, ,:ONMMMMN8I: ,~ZNMNN$, ~MM? , ZMNND?~: ,,, ,, ,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
417 # , , ,:~?7$ZZ8NNMMMNO7I=, ~D+ ZNO=, , :NM$: =MMM NMO ~NMNMMM :ZDN$, ,,=7DMD$?=, :?ZMD$: :DMNOZZZ$: ,,,,, ~IDMMMMMMMMMMMMMMMMMMMMM8~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
418 # , =DMNNNNNNNN8$= : , ,,~?ODNZ: :DM? =: ,MMM7 +MN~ ,MM8:NMN INMZ, ,=ONOI , +NMZ ,,+ZDMMMMMMMN+, ,,,,,,, ,~?$ODNNNNNNNMMMMMMMMD= ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
419 # ,:::::~7$I?=: ,~78NMNMMMMM? :+Z+ M8 $MM, =, DMMD NMN DMO OMM77NMI, ?8$~ , ~ZDDDNNNNNMMMMMMMMNMNNNNNDD8Z+:, IMN: I8DNMMMMN7~: ,,,,,, +$O$, ~$DMMMMMMMD~ ,, ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
420 # :I+ :ID? ~ZDNNNNMMNO?~,, ,:::::=7ONMNNNDMMMN$ ,=IONNMMMMZ:, ~MO ,7MMMI $MN, , :MMN ?8NDDNND$~ +MM~ ,MM~=MMMNMD, =ONNDDNMMMMMMMMMMMMNNND88DNNNNNMMMMMMMNDO7+~::,:,7MM+ =DMMMNNO? ~ZMMMMM7::~INMMMMMMMMMMMMMN8:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
421 #:MMM+,INMMM: ,:~+78NMMMM8?==++++++???++??I$Z77$$$$$$$7II??I$ZZO8MMMMM8Z7~ ,IZI ~77+ ?MMMMD88MN8+~, +8MO$OMMMMMNMMMZ, ~=: OMM? ,MM? ZMM~MMMM8~ ,:+7$$$$ZZ7?==: :8MDOZ$ZZZODMMMMMM8+, ,:=?$ZZOOOOOOZ$: , , ,=8MNMMMMMMMMMMNDZ$7$MMMMMMMMMMMMMMMMMMNI+?I7ZDNMMMMMMMMMM$,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
422 #=MMMZ$MMMMMM~ ,::::~==~~+I$8NMMMMMN$::::::::,,, ,,=ONDDO$7II?+~, , ,,$DD87: =NND= , ,+$$=:~, ,:, ,MMD NMI ,~?Z8DND88$?: 8MM$MMMZ:=~:,~~:::,,,=$DNMND$MM8, ~DMNMMMN?, :7$7?+==~=:,,,,,,,, ,,,,,,, ,,,,,,::,,,,,:::::::,,,::::::,, ,OM$,7MMMMMMNZ= , ~8MMMMMMMNDO7I7MMMMMMMMMMMMN8Z7+?NMMMD,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
423 #NMMMMMM? ,++, ~=I??= :7$ 7MM+ 7M7 ,:?ZZ$MMM8NMZ~+, :?INMMM? +$NMMMNZ: :+?I7$$Z$O88D88DDDDNNNNNNNNNNNNNNNNNNDDNDDDNNNNNMMNMMMMMMMNNNN$:??~ ,+II?=, , ,, ,?I??+=~, :MMMMMNM
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
424 #MMMMMD~ ,:=++++++++++=~,,, +MMN: ,MMD, :M$ ,INMNMMMMMMMMMM~~~?D, :OMM8: ,+$8Z$+,,$MMMMMD, :IODDDD
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
425 #N$~,,, ,~I$8NMMMMMMMMMNMMMMMMMMMMMMMMMMNNNN7: ZMMMM? NMMMNZ~:, +$: ,NMNI:::~?8MMM7I? IO ~I$ODNNNDND8OO$I?DMMMD$I8NMMMMMMMNMNMMMMMMM8=, ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
426 # ,:~?ONMMMMNNNDDD8NMD+, ,~?Z8NMNM8=, , $MNNNMM? :DMMMNDD8DZ7$+, ,8NMMNMNMMMD$: =8, ,INMMMNZI?====+I$$8DDNMMMMMMNNNMND7, :~$DMMMNMO
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
427 # ,?DMMMMMNNNMMM+::~++ZMMMM8ZZZZZZ$II77II7???=~:, ,+DMN7 =NMM8, ,NMMNMNMN$?I7I77OZ~ ~8D$~, ,MMMMMMNM8: :DMMM, , DMO=ZMZ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
428 # ,?OMMN87=, IZNNNMMMMMMMMMMND7IIII??III$8DDNN8Z+, , ~MM ?OMMMM~ ,MMMMMZ+ ~I= IMMMO$$= ?NNM? MN~ +NM:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
429 # IMM8~ =MD, ?N= :,, ,+77?=+, $8MM7::OMMMMMMZ+ I+, ?NI , :MMM8$ NNI, 7M$
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
430 # ,MMN $MD 7M+ ~ODNZ~, :7MMN? , $MMMN= 7MNMN: +8+ ,D8~ =MMDD8Z= =NMD OM7,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
431 # OMMD~ IMN: =8O:,~+$OO? :IZ+: :ZMMNM8= =DMMI ~8MM8= , ,, :8M?,$MM, ::, DM, =Z~ ,I8DDDN8$DMN~ MN ,=Z8DNDZZ= MD: ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
432 # ,,,,,,,, ?8NNMM8$I????++=+8MMMD$77$ZDMMNMMMDNOZ~ :IZ8DOI~, =MMMNMNM8I:, ,7M8I +MND7 ~MNDDM8~ 7MI MM7 :8MDDM7 8N= ~ID$, ,:Z$?:,,,=ONNMNMD= ?M$ :: +MI ,,,,,,::~~:::,,,,,,, ,+OMO:, ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
433 # ,,,::~===~~:, ,~+I$88DNNNNNNNNNDNDD8O$?~:, ,7DNMNDMMMN~,ZMND$8NNDZ=, $M? ?NNN7 =MO OMD$MM= MMMINMO $M7 DN: 8MMD: ?D~ :O8ZDMMMMD=, ,ZN$ ,INNMD= :NO ,:+8MMMMMMMMDI:,::,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
434 #=~~~::~~::, ~?78MMMDNMM? :+I$DD87?=, OMNDO$7$OI: 7N+ ?MNMN~ MMMNM$ 7M$ 7M$ +NMMO, ?N~ ~8+ ~7NMMNNOI= ~?ONZ+ ~ZNND,$M8 ~MO $MMMMMMMMMM7:::~~~~~~=+++===~~~:::,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
435 # ,~ONMMNO~, :?8NNMN8?~ZNMMMMMMMMMNMMNDOI=~NM? =MMM+ NMMMO 8M$ ,MM, $MMMN =D, ,?N~ , ?NMMMNNNDDO8DDD887, ,$ND= :O$NMZ IMO ,IMMMMN$, 7NO, ,,,,,:,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
436 # ,~IDMNN8OI, :~+$DMMMMMMMN87+=~~~~?ZDNNMM, ?NM? :NMN :MM7 ~MN ~DMMMN O~ :DD, ,MMMMNNOI:,, , ,=ZODD8D? :MMM: NMZ +8NM8, ,, :~ ,,~:,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
437 # ,INNMMNNO+ :=78NNZIIONMNNDMMN ,7D~ :MN~ MNMM?=MM $? OD, ,IMD ,:8MNMNNNNNNNNMMNM7: :8~ ZND OMN7, :NNMMMMN :8MMMMMNZ=:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
438 # :O88NMMN$=~:, ?MMN88NMMMD =MN? =, :NM +7$NO, =N8 , OMI, ,, 7M: ZDDND? MMO ,, +MM8?OMN: ,::
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
439 # :$NMMMNMM8I: ,8MD, +MMN= ,=?77=:ZMMM7 ?MN ~$+ 7M7 ,DZ :M~ IMM8: ,8MN, , ,,,, :MMD,=DMM+,?O8= , ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
440 # ,=I77$ONNNZ?+ONMZ =$D ,+=::+$8NNMNDNMD7?, ?MN :~~: ~D7 ,NI ,M7 ~?ZNZ?, 8MM~ =ZMMN~$MMMMMMMNMMD$ONMMMMD:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
441 # ~DMM= ~I7=, =DMMMD7MMM, :+?=?O$: ~N: ~MN88D$: NMM=, ~MMMMMMMMMMMMOZMMMMMM7::8MMI
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
442 # , :DNNI :~IDMMND :::=?II?==~::ZN7=+I$ZZZ8DZ+~~: IMMM~ ~MMMNMMMMMI~:7NMMMMD7,: +NM8,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
443 # :NMM7, ~MM+ ,,,:~==~~~: , OMMN: ?NNMMMMM8, ~NMNO, =MMMN?,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
444 # ,,,,,,,, ,$8MMO= ~M8 +MNO: ,MM~ , :: ,~, ,,:::,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
445 # ,::,,,, ~ONND+ OD+ ?NMD, ?? ,::::::,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
446 # :=+??=:,,,,, ~?$D87I: ~Z? =$DM$: ,::,,,,,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
447 # ,:~==~, :+=, $NNNNZ~ ,,:~~: , :DMMMI
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
448 # ,~~~~~:,,, ,,, ,~IMMMN8O+, ,:~?7$Z7~, :ZDMNNDNM8ZI
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
449 # ,,~~:,, , :$DNNMMN8?, , ,~7ZOO?: ,:$NMMMM? :7NMMD?,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
450 # ,:~~:,,, $NMMMMMNMNO?~ ~?ODDD$=, :?8MMMMMD?~7NMMMD$~ :ONMMN?
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
451 # ,,,,,,,,, ?$DMMMMMMMMMMD$?=~, ,~7ZZODN87????I$ODNMDOZ$7I: ~$ZDMD7==~ =$ZDND$++~,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
452 # ~?++=~~, ~+?II7ZNMMMMMM8$$$?~, ,~?II7Z8DDOZ$77II+: ~?IZDM8O$I~, :??$8MMNZZ7+,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
453 # , , ,+D7 :=IZ8NMMMNNMNNO$= ,:?ZDNNMMMNMND8Z7=, =ZNMMMMMD?,, :ONMNMMMN?,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
454 # ,MMMM7 ,,::~IONNMMNNDDD8OZI=, ,::::=+I$ONMNNNNDDDNNMMMMMMMMMD87: ,:~=ZNNNDOI, ~7$ZO8DDNNNNDD8O+:,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
455 #~, +MMMMDI?~ ,~+Z8DNDNNMMMMDD$+:,,, , ,~?7O8DNNNNNNMMMMMNOOZI??++?IZ88$: ,,~ZDMMMMMMMMMMMMMMMMMMNNNNNMMMNND8$=,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
456 # ,~: NMMMMOZMM8: ,7DZ~ ,,~IONMMMMMMMMMNDZ+~: , ,=I8DNMMMMMNMNMMMMMDNMMMMNMMMNNNDDDDD8O8Z$7II+++IZDDMMNMN$,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
457 # :~: MMMMMNMMM+ :, +?DOI~ ,:~?7$$ZODDNMNN8Z7??+=~:, ,~=+?7I?=:,,,,:=?I7$$$$$$$ZZZOO8DDNNMMNNNNNMMMMNMZ+
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
458 # ~=, MMMMMMMM8 ,NNNO , ,~?ZDNMNNNNNNND8O7?:,,, ,~=7DMMMMMMMMMZ~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
459 # ,:+~ ,MMMMMMMMO ~N8: ,,:~, ,:~:,,, ,:~, ,:~~=+++?7$O8DNNNNNMMN8$=, ~+$ZO8DNNMMNNNND8OOOZ$+:, :=+I8MMMMDOI
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
460 # ,=+ MMMMMMMMMDMZ, ~?: ,,,,, ,:~~~, ,NN?$NMMMMMMMMMMMN87~:,,,=+=:,,,,,,:?NMMNMMMMMMNNDNDI8MMM+ ,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
461 # +=, $MMMN?$NMN, ,+?+:, ,,:~~:, :=~, 8M= , :7ONNNO?~, , :$NNMMMMMMMMMMMMMN,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
462 # ,+? ,NNO,, , :ODNNNZ: :?777I= IMO ,,=$Z7+~ ,?NNMMNZ: :7NMMMMMNMMMM8 , ,IDND~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
463 # ,=~, 7I :+I+~::,, ~?I~ , ,~=~==: ZMZ ?8I: :I$DND$?~ :?$8MMN$?: ?ZDMMMMMMMM7 +$NMMMMMI
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
464 # ~~ , ,=+=: ,== ::, , ZMM: ?NN8: ,7NMMNI, ,$NMMMO: =NMMMNMM+ I8NMMMM,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
465 # ~= ,~:,,~~, ,:, ,,,, , ,, +MN8 ,~OMM8Z, :+ZMNDOI =IMMN8= ,=NNMO ?NMMMD
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
466 # ::, ,,,:: ,:, ,, =MMO~ , ?NMMMI, ,INMMMDI, ~DMMN+, NMO ?DNO~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
467 # ,~, ,,,::, ,, , ,, ,INMND+: :MMM+ ~ZDDMMMD?~:$MMMMMMMMMMM?
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
468 # ,, :~~:, ,:, ,, :ZMMMMNNMMMN, ,=ONMMMMNM$,,,,,, ,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
469 #Z, :, ,, ,~=~, ,, ,=?7$I= , :~~~, ,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
470 #MD= :: ,,,, , ,, ,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
471 #MNMI :: ,,, ,,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
472 #7MMM? , ,~: :~:, ,:,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
473 # OMMMO: ~NMD, :=: :+=: ,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
474 # ~MMMN8: NMMM~ +?: ,:=++~ ,:,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
475 # $MMMMMNI,?MMMMZ ,DM7 ,=I= ~+~~:, ,:,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
476 # +MMO~OMMMMMMMMD MMM7 , , =$~ ?OZ+ ,:,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
477 # ~NMN: :+DNN7MMMNMMMDODMMN+ :+?, +77+~: :::,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
478 # IMM+ ,NMMMMMMMMN?NM7 ~7+, , :+$I, , +8? :+~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
479 # =NMD, NMMMMMM8~ ?NN, =ND? ,=??: ,8NMMMM= :++
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
480 # +DO, ~ZZ$ODI :8M~ :=I8NMNMMD+, ,:~~=: , +8MO$DMD+ ~===~: :~~:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
481 # :$~ 7NMD$, ZMM8I? ,~=: , ZNN7,:MM8~,OMNMD8DMM= ++:
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
482 # =ZNOI: ?DND= ,?I~ ,,,: ,$ND+ ?NMNNNNN7+, 7MN, ,=+~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
483 # :ZI: :, ,=7: ::,, $NN= 7NMMMM7: :DMMMN8NMMDDMN7 ,::,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
484 # ~?= ,,, ,ZM= DMMD8 ?MMMMNN7, ,I+ :~~,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
485 # =+, ,,, ,, =Z8: +$~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
486 # :~ ,,~~,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
487 # :, ::,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
488 # ::, ,:::,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
489 # ,, ,~
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
490 # ,, ,,,
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
491 #
04ee1373b7e7 Uploaded
kaymccoy
parents:
diff changeset
492 #