diff calctfreq.py @ 21:d6b961721037

Miller Lab Devshed version 4c04e35b18f6
author Richard Burhans <burhans@bx.psu.edu>
date Mon, 05 Nov 2012 12:44:17 -0500
parents 2c498d40ecde
children
line wrap: on
line diff
--- a/calctfreq.py	Tue Oct 23 14:38:04 2012 -0400
+++ b/calctfreq.py	Mon Nov 05 12:44:17 2012 -0500
@@ -99,7 +99,11 @@
 		sKEGGcPthws=dKEGGcPthws.pop(cGen)
 		for eachP in sKEGGcPthws:
 			if eachP!='N':
-				dPthContsTmp[eachP]+=1
+				if eachP in dPthContsTmp:
+					dPthContsTmp[eachP]+=1
+				else:
+					print >> sys.stderr, "Error: pathway not found in database: '{0}'".format(eachP)
+					sys.exit(1)
 		cntGens+=1
 	#~ Calculate Freqs.
 	ltfreqs=[((Decimal(dPthContsTmp[x])/Decimal(dPthContsTotls[x])),Decimal(dPthContsTmp[x]),x) for x in dPthContsTotls]