diff shm_csr.py @ 17:b95fa7e426c3 draft

Uploaded
author davidvanzessen
date Thu, 24 Nov 2016 10:24:19 -0500
parents 4e596473c25c
children ce25fb581ca3
line wrap: on
line diff
--- a/shm_csr.py	Wed Nov 23 09:05:40 2016 -0500
+++ b/shm_csr.py	Thu Nov 24 10:24:19 2016 -0500
@@ -247,12 +247,9 @@
 	
 
 def get_xyz(lst, gene, f, fname):
-	
-	x = int(round(f(lst)))
+	x = round(round(f(lst), 1))
 	y = valuedic[gene + "_" + fname]
 	z = str(round(x / float(y) * 100, 1)) if y != 0 else "0"
-	if gene == "unmatched":
-		print x, y, z
 	return (str(x), str(y), z)
 
 dic = {"RGYW": RGYWCount, "WRCY": WRCYCount, "WA": WACount, "TW": TWCount}
@@ -282,7 +279,7 @@
 # for testing
 seq_motif_file = outfile[:outfile.rindex("/")] + "/motif_per_seq.txt"
 with open(seq_motif_file, 'w') as o:
-	o.write("ID\tRGYWC\tWRCY\tWA\tTW\n")
+	o.write("ID\tRGYW\tWRCY\tWA\tTW\n")
 	for ID in IDlist:
 		#o.write(ID + "\t" + str(round(RGYWCount[ID], 2)) + "\t" + str(round(WRCYCount[ID], 2)) + "\t" + str(round(WACount[ID], 2)) + "\t" + str(round(TWCount[ID], 2)) + "\n")
 		o.write(ID + "\t" + str(RGYWCount[ID]) + "\t" + str(WRCYCount[ID]) + "\t" + str(WACount[ID]) + "\t" + str(TWCount[ID]) + "\n")