sanger-pathogens/ariba

Summarising MLST reports?

wanyuac opened this issue · 1 comments

Hi,

Is there a way to summarise MLST reports, namely, mlst_report.tsv, and even mlst_report.details.tsv files across a number of samples? The command ariba summary outprefix sample1/mlst_report.tsv sample2/mlst_report.tsv did not work for this purpose:

Traceback (most recent call last):
  File "./anaconda3/envs/ariba/bin/ariba", line 312, in <module>
    args.func(args)
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/tasks/summary.py", line 78, in run
    s.run()
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/summary.py", line 358, in run
    self.samples = self._load_input_files(self.filenames, self.min_id, verbose=self.verbose, only_clusters=self.only_clusters)
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/summary.py", line 99, in _load_input_files
    samples[filename].run()
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/summary_sample.py", line 76, in run
    self.clusters = self._load_file(self.report_tsv, self.min_pc_id, only_clusters=self.only_clusters)
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/summary_sample.py", line 30, in _load_file
    data_dict = summary_cluster.SummaryCluster.line2dict(line, filename=filename)
  File "./anaconda3/envs/ariba/lib/python3.6/site-packages/ariba/summary_cluster.py", line 41, in line2dict
    raise Error(filename_message + 'Wrong number of columns in the following line. Expected ' + str(len(report.columns)) + ' but got ' + str(len(data)) + '\n' + line)
ariba.summary_cluster.Error: Error reading ariba summary file "./sample1/mlst_report.tsv". Wrong number of columns in the following line. Expected 31 but got 8
ST      adk     fumC    gyrB    icd     mdh     purA    recA

Thanks

Since I have eventually created a script compileMLST.py for this problem, I would like to close this issue.