<commit_before>#!/usr/bin/env python

'''
Abstract: Iterate through all folders and execute a shell/python command.

Date: 08/06/2015

Author: <NAME>
'''

import os
import subprocess as sp
import argparse
try:
    import shlex
except ImportError as ie:
    sys.exit('Please install {} module before executing this script.'\
             .format(ie))


def prog_options():
    parser = argparse.ArgumentParser(
                description='Iterate through each folder in a file and run '
                            'FLASh command on sample fastq files.')
    parser.add_argument('sample_dir',
                        help='Directory containing sample folders.')
    return parser.parse_args()


def main():
    args = prog_options()

    for root, dirs, files in os.walk(args.sample_dir):
        if root != args.sample_dir:
            os.chdir(root)
            print root

            for file in files:
                if file.endswith('R1_001.fastq.gz'):<commit_msg>Updated summary of run_flash_cmd.py<commit_after>#!/usr/bin/env python

'''
Abstract: Iterate through all folders and execute FLASh command.

Date: 08/06/2015

Author: <NAME>
'''

import os
import subprocess as sp
import argparse
try:
    import shlex
except ImportError as ie:
    sys.exit('Please install {} module before executing this script.'\
             .format(ie))


def prog_options():
    parser = argparse.ArgumentParser(
                description='Iterate through each folder in a file and run '
                            'FLASh command on zipped Read 1 and Read 2 fastq '
                            'files.')
    parser.add_argument('sample_dir',
                        help='Directory containing sample folders.')
    return parser.parse_args()


def main():
    args = prog_options()

    for root, dirs, files in os.walk(args.sample_dir):
        if root != args.sample_dir:
            os.chdir(root)
            print root[29:32]

            for file in files:
                if file.endswith('R1_001.fastq.gz'):
{'fraction_non_alphanumeric': 0.0939830929885629, 'fraction_numerical': 0.014917951268025857, 'mean_word_length': 2.2089314194577354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5796142', 'n_tokens_mistral': 603, 'n_tokens_neox': 554, 'n_words': 180}