Skip to content

Commit

Permalink
fix failure due to overly long command line
Browse files Browse the repository at this point in the history
  • Loading branch information
dpark01 committed Jan 28, 2015
1 parent 2358f77 commit 48572c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pipes/rules/reports.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

6 changes: 3 additions & 3 deletions reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 48572c0

Please sign in to comment.