code: def parse_theta2_report (self, fh):
          
          parsed_data = {}
          for l in fh:
              if l.startswith('#'):
                  continue
              else:
                  s = l.split("\t")
                  purities = s[1].split(',')
                  parsed_data['proportion_germline'] = float(purities[0]) * 100.0
                  for i, v in enumerate(purities[1:]):
                      if i <= 5:
                          parsed_data['proportion_tumour_{}'.format(i+1)] = float(v) * 100.0
                      else:
                          parsed_data['proportion_tumour_gt5'] = (float(v) * 100.0) + parsed_data.get('proportion_tumour_gt5', 0)
                  break
          return parsed_data
docs: Parse the final THetA2 log file.