<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import os
import argparse

def launch_fastq_join(args, dirpath, file_format):
    current_directory = os.getcwd()

    command = current_directory + '/trunk/clipper/fastq-join'

    command += ' -p ' + args.max_diff_perc
    command += ' -m ' + args.min_overlap
    if args.smaller_insert == 'yes':
        command += ' -x '

    command += ' ' + args.r1_sequence_file
    command += ' ' + args.r2_sequence_file
    command += ' -o ' + dirpath + '/%.' + file_format
    command += ' > ' + dirpath + '/fastq_join_verbose_output' 

    os.system(command)

def generate_outputs(dirpath, args):
    output_files = os.listdir(dirpath)
    print output_files

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--r1_sequence_file', required=True)
    parser.add_argument('--r2_sequence_file', required=True)
    parser.add_argument('--min_overlap', required=True)
    parser.add_argument('--max_diff_perc', required=True)
    parser.add_argument('--smaller_insert', required=True)
    parser.add_argument('--join_sequence_file', required=True)
    parser.add_argument('--single_R1_sequence_file', required=True)
    parser.add_argument('--single_R2_sequence_file', required=True)
    parser.add_argument('--report', required=True)
    args = parser.parse_args()
<commit_msg>Get fastq_join working and formate outputs<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import os
import argparse

def launch_fastq_join(args, dirpath, file_format):
    src_directory = dirpath.split('galaxy/')[0] 
    src_directory += 'galaxy/tools/paired_end_assembly/fastq_join'

    command = src_directory + '/trunk/clipper/fastq-join'

    command += ' -p ' + args.max_diff_perc
    command += ' -m ' + args.min_overlap
    if args.smaller_insert == 'yes':
        command += ' -x '

    command += ' ' + args.r1_sequence_file
    command += ' ' + args.r2_sequence_file
    command += ' -o ' + dirpath + '/%'
    command += ' > ' + dirpath + '/fastq_join_verbose_output' 

    os.system(command)

def copy_file(input_filepath, output_filepath):
    if not os.path.exists(input_filepath):
        string = input_filepath + " not found"
        raise ValueError(string)
    command = 'cp ' + input_filepath + ' ' + output_filepath
    os.system(command)

def generate_outputs(dirpath, args):
    output_files = os.listdir(dirpath)
    copy_file(dirpath + '/join', args.join_sequence_file)
    copy_file(dirpath + '/un1', args.single_R1_sequence_file)
    copy_file(dirpath + '/un2', args.single_R2_sequence_file)
    copy_file(dirpath + '/fastq_join_verbose_output', args.report)

    

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--r1_sequence_file', required=True)
    parser.add_argument('--r2_sequence_file', required=True)
    parser.add_argument('--min_overlap', required=True)
    parser.add_argument('--max_diff_perc', required=True)
    parser.add_argument('--smaller_insert', required=True)
    parser.add_argument('--join_sequence_file', required=True)
    parser.add_argument('--single_R1_sequence_file', required=True)
    parser.add_argument('--single_R2_sequence_file', required=True)
    parser.add_argument('--report', required=True)
    args = parser.parse_args()

{'fraction_non_alphanumeric': 0.1398559423769508, 'fraction_numerical': 0.005702280912364946, 'mean_word_length': 3.9304733727810652, 'pattern_counts': {'":': 0, '<': 3, '<?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': '414745', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1114, 'n_words': 179}