87909f5188ff027a43543876b759a9f1d3e3def8 wong Thu Oct 27 14:44:53 2011 -0700 added skipping of comment lines for label check diff --git python/lib/ucscgenomics/qa.py python/lib/ucscgenomics/qa.py index b265c2d..4cc9dc3 100644 --- python/lib/ucscgenomics/qa.py +++ python/lib/ucscgenomics/qa.py @@ -177,33 +177,37 @@ output.append("") else: output.append("No malformed table names") output.append("") return (output, bad) def checkLabels(trackDb): """ Check if long and short labels are too long.""" f = open(trackDb, "r") lines = f.readlines() seenlabel = dict() output = [] 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 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: