<commit_before>import module_helper, os

def init(param):
   module_helper.checkParameter(param,key='cutadapt_exec',dType=str, checkFile=True)
   module_helper.checkParameter(param,key='cutadapt_python_version',dType=str)
   module_helper.checkParameter(param,key='cutadapt_first_adapter',dType=str)
   if param['paired']:
       module_helper.checkParameter(param,key='cutadapt_second_adapter',dType=str)
   module_helper.checkParameter(param,key='cutadapt_m',dType=str)
   
   
def run_cutadapt(param,infile,outfile,adapter):
    #run the clipper

    call = param['cutadapt_python_version']+' '+param['cutadapt_exec']+' -m '+param['cutadapt_m']+' -a '+adapter+' -o "'+outfile+'" "'+param[infile]+'"'
    print '\n'
    print call
    print '\n'

    output,error = subprocess.Popen(call ,stdout = subprocess.PIPE, shell=True, stderr= subprocess.PIPE).communicate()
    print output
    print error   

    param['file_handle'].write(error)
    param['file_handle'].write(output)

    with open(outfile+'.txt','w') as f:<commit_msg>cutadapt is a script on the path, not a file<commit_after>import module_helper, os

def init(param):
   module_helper.checkParameter(param,key='cutadapt_exec',dType=str)
   module_helper.checkParameter(param,key='cutadapt_python_version',dType=str)
   module_helper.checkParameter(param,key='cutadapt_first_adapter',dType=str)
   if param['paired']:
       module_helper.checkParameter(param,key='cutadapt_second_adapter',dType=str)
   module_helper.checkParameter(param,key='cutadapt_m',dType=str)
   
   
def run_cutadapt(param,infile,outfile,adapter):
    #run the clipper

    call = param['cutadapt_python_version']+' '+param['cutadapt_exec']+' -m '+param['cutadapt_m']+' -a '+adapter+' -o "'+outfile+'" "'+param[infile]+'"'
    print '\n'
    print call
    print '\n'

    output,error = subprocess.Popen(call ,stdout = subprocess.PIPE, shell=True, stderr= subprocess.PIPE).communicate()
    print output
    print error   

    param['file_handle'].write(error)
    param['file_handle'].write(output)

    with open(outfile+'.txt','w') as f:
{'fraction_non_alphanumeric': 0.1502640422467595, 'fraction_numerical': 0.0, 'mean_word_length': 5.65814696485623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2211600', 'n_tokens_mistral': 726, 'n_tokens_neox': 698, 'n_words': 109}