# HG changeset patch # User refinery-platform # Date 1519326843 18000 # Node ID b87749d7a24c3b4388f9ece3683156803bd41f28 # Parent 5b28174e774dba8b5dced917034f79b632f6ca90 planemo upload commit 4fb0a789956149e5a58f4e370d7fe14f4e8bcf79 diff -r 5b28174e774d -r b87749d7a24c refinery_file_splitter.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/refinery_file_splitter.py Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +''' +Test tool for splitting output files from Refinery Test Tools + +@author: Scott Ouellette + +Input: one text file +Output: N output files based on the amount of input files that +got concatenated from Refinery test tool runs + +Requires Python v2.7 + +''' + +import re +import argparse + + +def main(args): + create_many_files(args.input_file) + + +def create_many_files(input_file): + # Split file's content when we see data that wasn't added by test tool runs + file_content = re.split("Output.*|Input.*", input_file.read()) + + sanitized_data = [ + data.lstrip("\n") for data in file_content if data.rstrip("\n")] + + # Create N ouput files based on the number of inputs run through test tools + for num, file_content in enumerate(sanitized_data): + open("Output file {}.txt".format(num + 1), 'w').write(file_content) + + +if __name__ == '__main__': + version = "%(prog)s 0.1" + description = "Test tool for running workflows on Galaxy platform from Refinery" + parser = argparse.ArgumentParser(description=description, version=version) + + parser.add_argument('-i', '--in-file', dest='input_file', + type=file, metavar='INPUT_FILE', required=True, + help='name of the input file') + + # check argument values for errors + try: + args = parser.parse_args() + except IOError as e: + parser.error(e) + + main(args) diff -r 5b28174e774d -r b87749d7a24c refinery_test_1-N.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/refinery_test_1-N.xml Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,54 @@ + + + + for testing Galaxy workflow execution from Refinery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .. class:: infomark + + **Purpose** + + To test Galaxy workflow execution and monitoring from Refinery. + + ----- + + .. class:: infomark + + **Inputs and outputs** + + This wrapper will accept one input file with the concatenated data of N input files run through refinery test tools and will partition said data into N output files containing the afforementioned N input files original contents + + diff -r 5b28174e774d -r b87749d7a24c refinery_test_N-1.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/refinery_test_N-1.xml Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,73 @@ + + + + for testing Galaxy workflow execution from Refinery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .. class:: infomark + + **Purpose** + + To test Galaxy workflow execution and monitoring from Refinery. + + ----- + + .. class:: infomark + + **Inputs and outputs** + + This wrapper will accept A Dataset collection list as input and produce a single output file with the concatenated, annotated content of each element in the Dataset Collection. + + *Note:* You must set the "Probability of failure" parameter to a non-zero value + for "Write to standard out", "Write to standard error" or "Exit code" to take effect. + + diff -r 5b28174e774d -r b87749d7a24c test-data/concat_output.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/concat_output.txt Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,29 @@ +Output file name: ""/galaxy/database/files/009/dataset_9980.dat + +Input file name: ""/galaxy/database/files/009/dataset_9977.dat + +Output file name: ""/galaxy/database/files/009/dataset_9977.dat + +Input file name: ""/galaxy/database/files/009/dataset_9808.dat + +Contents of File 3: +TEST TEST TEST TEST +TEST TEST TEST TEST +Input file name: ""/galaxy/database/files/009/dataset_9978.dat + +Output file name: ""/galaxy/database/files/009/dataset_9978.dat + +Input file name: ""/galaxy/database/files/009/dataset_9807.dat + +Contents of File 2: +TEST TEST TEST TEST +TEST TEST TEST TEST +Input file name: ""/galaxy/database/files/009/dataset_9979.dat + +Output file name: ""/galaxy/database/files/009/dataset_9979.dat + +Input file name: ""/galaxy/database/files/009/dataset_9806.dat + +Contents of File 1: +TEST TEST TEST TEST +TEST TEST TEST TEST diff -r 5b28174e774d -r b87749d7a24c test-data/file1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/file1.txt Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,4 @@ +Contents of File 1: +TEST TEST TEST TEST +TEST TEST TEST TEST + diff -r 5b28174e774d -r b87749d7a24c test-data/file2.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/file2.txt Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,4 @@ +Contents of File 2: +TEST TEST TEST TEST +TEST TEST TEST TEST + diff -r 5b28174e774d -r b87749d7a24c test-data/file3.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/file3.txt Thu Feb 22 14:14:03 2018 -0500 @@ -0,0 +1,4 @@ +Contents of File 3: +TEST TEST TEST TEST +TEST TEST TEST TEST +