diff --git a/pipes/rules/reports.rules b/pipes/rules/reports.rules index 95853c429..9d2fc4b33 100644 --- a/pipes/rules/reports.rules +++ b/pipes/rules/reports.rules @@ -63,5 +63,5 @@ rule consolidate_spike_count: sample=read_samples_file(config["samples_per_run"])) output: '{dir}/summary.spike_count.txt' params: logid="all" - shell: "{config[binDir]}/reports.py consolidate_spike_count {input} {output}" + shell: "{config[binDir]}/reports.py consolidate_spike_count {dir}/spike_count {output}" diff --git a/reports.py b/reports.py index 71e6464f9..0a04d8978 100755 --- a/reports.py +++ b/reports.py @@ -199,10 +199,10 @@ def get_earliest_date(inDir): -def consolidate_spike_count(inFiles, outFile): +def consolidate_spike_count(inDir, outFile): '''Consolidate multiple spike count reports into one.''' with open(outFile, 'wt') as outf: - for fn in inFiles: + for fn in os.listdir(inDir): s = os.path.basename(fn) if not s.endswith('.spike_count.txt'): raise Exception() @@ -213,7 +213,7 @@ def consolidate_spike_count(inFiles, outFile): spike, count = line.strip().split('\t') outf.write('\t'.join([s, spike, count])+'\n') def parser_consolidate_spike_count(parser=argparse.ArgumentParser()): - parser.add_argument('inFiles', help='Input coverage files.', nargs='+') + parser.add_argument('inDir', help='Input spike count directory.') parser.add_argument('outFile', help='Output report file.') util.cmd.attach_main(parser, consolidate_spike_count, split_args=True) return parser