b3cf49dac6cf89ce0a5e8b396bfc1c3422591b8c wong Thu Feb 2 10:40:59 2012 -0800 added in snippet to detect if a label is still autogenerated diff --git python/lib/ucscgenomics/qa.py python/lib/ucscgenomics/qa.py index 61f862a..4ec96af 100644 --- python/lib/ucscgenomics/qa.py +++ python/lib/ucscgenomics/qa.py @@ -202,30 +202,33 @@ toolong = list() p1 = re.compile('^\s+longLabel\s+(.*)$') p2 = re.compile('^\s+shortLabel\s+(.*)$') p3 = re.compile('^\s+#.*$') for i in lines: m1 = p1.match(i) m2 = p2.match(i) m3 = p3.match(i) if m3: continue if m1: if seenlabel.has_key(m1.group(1)): seenlabel[m1.group(1)] = seenlabel[m1.group(1)] + 1 else: seenlabel[m1.group(1)] = 1 + if re.search('autogenerated', m1.group(1)): + toolong.append([m1.group(1), -1]) + output.append("longLabel '%s' is still autogenerated, please tell the wrangler to fix this" % m1.group(1)) if len(m1.group(1)) > 80: toolong.append([m1.group(1), len(m1.group(1))]) output.append("longLabel '%s' is too long: %s" % (m1.group(1), len(m1.group(1)))) if m2: #short labels are allowed to repeat #if seenlabel.has_key(m2.group(1)): #seenlabel[m2.group(1)] = seenlabel[m2.group(1)] + 1 #else: #seenlabel[m2.group(1)] = 1 if len(m2.group(1)) > 17: toolong.append([m2.group(1), len(m2.group(1))]) output.append("shortLabel '%s' is too long: %s" % (m2.group(1), len(m2.group(1)))) for i in seenlabel: if seenlabel[i] > 1: output.append("%s label seen more than once: %s" % (i, seenlabel[i]))