diff --git a/AnnotatorCore.py b/AnnotatorCore.py index 9784747..97d6bb2 100644 --- a/AnnotatorCore.py +++ b/AnnotatorCore.py @@ -976,8 +976,8 @@ def processclinicaldata(annotatedmutfiles, clinicalfile, outfile): sampledrivers[sample].append(variant) for l in levels: - il = headers[l] - if il < len(row) and row[il] != '': + il = geIndexOfHeader(headers, [l]) + if 0 <= il < len(row) and row[il] != '': if l not in samplelevels[sample]: samplelevels[sample][l] = [] sampleleveltreatments[sample][l] = [] @@ -988,15 +988,15 @@ def processclinicaldata(annotatedmutfiles, clinicalfile, outfile): sampleactionablecount[sample][variant] = True for l in dxLevels: - il = headers[l] - if il < len(row) and row[il] != '': + il = geIndexOfHeader(headers, [l]) + if 0 <= il < len(row) and row[il] != '': if l not in samplelevels[sample]: samplelevels[sample][l] = [] samplelevels[sample][l].append(row[il] + "(" + variant + ")") for l in pxLevels: - il = headers[l] - if il < len(row) and row[il] != '': + il = geIndexOfHeader(headers, [l]) + if 0 <= il < len(row) and row[il] != '': if l not in samplelevels[sample]: samplelevels[sample][l] = [] samplelevels[sample][l].append(row[il] + "(" + variant + ")")