changeset 0:ccabef3f7d5f draft

Uploaded first version
author brenninc
date Sun, 08 May 2016 11:01:03 -0400
parents
children b2c1bf6f0f86
files README data_reader.xml directory_copier.py test-data/other.csv test-data/other.fa test-data/other.fasta test-data/other.fasta.gz test-data/sample1.bmp test-data/sample1.csv test-data/sample1.fa test-data/sample1.fasta test-data/sample1.fasta.gz test-data/sample1.fastq test-data/sample1.fastq.gz test-data/sample1.fq test-data/sample1.jpeg test-data/sample1.jpg test-data/sample1.png test-data/sample1.ps test-data/sample1.sam test-data/sample1.tabular test-data/sample1.text test-data/sample1.tiff test-data/sample1.tsv test-data/sample1.txt test-data/sample1.xls test-data/sample1.xlsx test-data/sample2.txt tool-data/black-list.ini tool-data/white-list.ini
diffstat 30 files changed, 1040 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,32 @@
+This tool will lookup files on the Galaxy server machine, including mounted directories.
+
+The user aspects of the tool are explained in the help section of data_reader.xml
+
+Only directories that are included in the white list and not in the black list are allowed.
+
+The white and black lists can be changed without the requirement to restart the server as these are read from the tools install directory each time the tool is run.
+
+====
+
+The white list is tool-data/white-list.ini
+
+Any directory that starts with any entry from this file will be considered to have passed.
+
+The default file includes a single / so all absolute paths will pass.
+
+====
+
+The black list is tool-data/black-list.ini
+
+Any directory that contains any of the blacklisted strings anywhere in the path are excluded.
+
+The default file excludes most of the standard linux systems directories where data is unlikely to be found.
+
+It also excludes the /galaxy/ pattern to avoid users getting access to galaxy files.
+
+Also .. and ~ are excluded for security reasons.
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_reader.xml	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,428 @@
+<tool id="directory_data_reader" name="Directory Data Finder" version="0.2">
+    <description>Reads a particular data type from a directory on the server</description>
+    <command interpreter="python">
+<![CDATA[
+        directory_copier.py  
+        #if $results.required=="data"
+            --ending .${results.extension.file_type} 
+            --link
+            #if $results.start
+                --start $results.start
+            #end if      
+            #if $results.last
+                --last $results.last
+            #end if      
+            #if $results.extension.file_type=="fa"
+                --new_ending .fasta
+            #end if
+            #if $results.extension.file_type=="fq"
+                --new_ending .fastq
+            #end if
+            #if $results.extension.file_type=="text"
+                --new_ending .txt
+            #end if
+            #if $results.extension.file_type=="tsv"
+                --new_ending .tabular
+            #end if
+            #if $results.extension.file_type in ["fasta.gz"]
+                --decompress
+                --new_ending .fasta
+            #end if
+            #if $results.extension.file_type=="fastq"
+                --new_ending .$results.extension.new_galaxy.new_ending
+            #end if
+            #if $results.extension.file_type=="fastq.gz"
+                --decompress
+                --new_ending .${results.extension.new_galaxy.new_ending}
+            #end if
+        #else
+            --ending bam 
+            --ending csv 
+            --ending fa 
+            --ending fasta 
+            --ending fasta.gz 
+            --ending fastq 
+            --ending fastq.gz 
+            --ending fasta 
+            --ending fq 
+            --ending sam 
+            --ending tabular 
+            --ending text 
+            --ending tsv 
+            --ending txt 
+            --ending xls 
+            --ending xlsx
+        #end if      
+        #if $directory.startswith('/'):
+            --path ${directory}
+        #else
+            --path $__tool_directory__/${directory}
+        #end if      
+        --list ${listing}
+]]>
+    </command>
+    <inputs>
+        <param name="directory" type="text" label="Directory to read data from." />
+        <param name="list_name" type="text" size="25" label="output name" value="input data"/>
+        <conditional name="results">
+            <param name="required" type="select" label="Download data or just directory listing" help="Select type of action required.">
+                <option value="data" selected="true">Data and listing of selected type</option>
+                <option value="listing">Get listing of selected file types </option>
+            </param>
+            <when value="data">
+                <param name="start" type="text" value="" label="String which must be at the start of each file name" />
+                <param name="last" type="text" value="" label="String which must be at the end of the file name (excluding the file type)" />
+                <conditional name="extension">
+                    <param name="file_type" type="select" label="File Type" help="File Type.">
+                        <option value="bam">*.bam files</option>
+                        <option value="csv">*.csv files</option>
+                        <option value="fa">*.fa files Files saved as *.fasta for galaxy</option>
+                        <option value="fasta">*.fasta files</option>
+                        <option value="fasta.gz">*.fasta.gz files</option>
+                        <option value="fastq">*.fastq files</option>
+                        <option value="fastq.gz">*.fastq.gz files</option>
+                        <option value="fastq">*.fastq files</option>
+                        <option value="fastq.gz">*.fastq.gz files</option>
+                        <option value="fq">*.fq files Files saved as *.fastq for galaxy</option>
+                        <option value="sam">*.sam files</option>
+                        <option value="tabular">*.tabular Files</option>
+                        <option value="text">*.text Files saved as *.txt for galaxy</option>
+                        <option value="tsv">*.tsv files saved as *.tabular for galaxy</option>
+                        <option value="txt">*.txt Files</option>
+                        <option value="xls">*.xls files</option>
+                        <option value="xlsx">*.xlsx files</option>
+                    </param>
+                    <when value="bam" />
+                    <when value="csv" />
+                    <when value="fa" />
+                    <when value="fasta" />
+                    <when value="fasta.gz" />
+                    <when value="fastq" >
+                        <conditional name="new_galaxy">
+                            <param name="new_ending" type="select" label="Ending to be used for Galaxy" help="Will determine which down stream tools can be used.">
+                                <option value="fastq" selected="true">Keep data as general fastq format</option>
+                                <option value="fastqsanger">Tag data as fastq sanger in galaxy</option>
+                                <option value="fastqsolexa">Tag data as fastq solexa in galaxy</option>
+                                <option value="fastqillumina">Tag data as fastq illumina in galaxy</option>
+                             </param>
+                            <when value="fastq" />
+                            <when value="fastqsanger" />
+                            <when value="fastqsolexa" />
+                            <when value="fastqillumina" />
+                        </conditional>
+                    </when>
+                    <when value="fastq.gz" >
+                        <conditional name="new_galaxy">
+                            <param name="new_ending" type="select" label="Ending to be used for Galaxy" help="Will determine which down stream tools can be used.">
+                                <option value="fastq" selected="true" >Keep data as general fastq format</option>
+                                <option value="fastqsanger">Tag data as fastq sanger in galaxy</option>
+                                <option value="fastqsolexa">Tag data as fastq solexa in galaxy</option>
+                                <option value="fastqillumina">Tag data as fastq illumina in galaxy</option>
+                             </param>
+                            <when value="fastq" />
+                            <when value="fastqsanger" />
+                            <when value="fastqsolexa" />
+                            <when value="fastqillumina" />
+                        </conditional>
+                    </when>
+                    <when value="fq" />
+                    <when value="sam" />
+                    <when value="tabular" />
+                    <when value="text" />
+                    <when value="tsv" />
+                    <when value="txt" />
+                    <when value="xls" />
+                    <when value="xlsx" />
+                </conditional>
+            </when>
+            <when value="listing">
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="txt" name="listing" label="List of files in $list_name">
+        </data>
+        <!-- Ideally galaxy can get the type based on the file extensions. If so just add the type here -->
+        <collection type="list" label="$list_name" name="data_collection">
+            <filter>(results['required'] == 'data')</filter>
+            <discover_datasets pattern="__designation_and_ext__" directory="output" visible="true" />
+        </collection>
+    </outputs>
+    <tests>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="list_name" value="csv_files" />
+            <param name="results|extension|file_type" value="csv"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.csv" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="csv" file="sample1.csv" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fa"/>
+             <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fasta" />
+                    <has_line line="other.fasta" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fasta" file="sample1.fasta" />
+                <element name="other" ftype="fasta" file="sample1.fasta" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fasta"/>
+            <param name="results|start" value="sam" />
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fasta" />
+                    <not_has_text text="other.fasta" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fasta" file="sample1.fasta" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fasta.gz"/>
+            <param name="results|last" value="le1" />
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fasta" />
+                    <not_has_text text="other.fasta" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fasta" file="sample1.fasta" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fq"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fastq" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fastq" file="sample1.fastq" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fastq"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fastq" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fastq" file="sample1.fastq" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fastq"/>
+            <param name="results|extension|new_galaxy|new_ending" value="fastqsanger"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.fastqsanger" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fastqsanger" file="sample1.fastq" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fastq.gz"/>
+            <output name="data_collection">
+                <assert_contents>
+                    <has_line line="sample1.fastq" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fastq" file="sample1.fastq" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="fastq.gz"/>
+            <param name="results|extension|new_galaxy|new_ending" value="fastqsanger"/>
+            <output name="listing_fastq_gz">
+                <assert_contents>
+                    <has_line line="sample1.fastqsanger" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="fastqsanger" file="sample1.fastq" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="sam"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.sam" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="sam" file="sample1.sam" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="tabular"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.tabular" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="tabular" file="sample1.tabular" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="text"/>
+            <output name="listing_text">
+                <assert_contents>
+                    <has_line line="sample1.txt" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="txt" file="sample1.text" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="tsv"/>
+            <output name="data_collection">
+                <assert_contents>
+                    <has_line line="sample1.tabular" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="tabular" file="sample1.tsv" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="txt" />
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.txt" />
+                </assert_contents>  
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="txt" file="sample1.txt" />
+                <element name="sample2" ftype="txt" file="sample2.txt" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="xls"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.xls" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="xls" file="sample1.xls" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|extension|file_type" value="xlsx"/>
+            <output name="listing">
+                <assert_contents>
+                    <has_line line="sample1.xlsx" />
+                </assert_contents>
+            </output>
+            <output_collection name="data_collection" type="list">
+                <element name="sample1" ftype="xlsx" file="sample1.xlsx" />
+           </output_collection>
+        </test>
+        <test>
+            <param name="directory" value="test-data" />
+            <param name="results|required" value="listing"/>
+            <output name="listing_all">
+                <assert_contents>
+                    <has_line line="sample1.csv" />
+                    <has_line line="sample1.fasta" />
+                    <has_line line="sample1.fasta.gz" />
+                    <has_line line="sample1.fastq" />
+                    <has_line line="sample1.fastq.gz" />
+                    <has_line line="sample1.sam" />
+                    <has_line line="sample1.tabular" />
+                    <has_line line="sample1.text" />
+                    <has_line line="sample1.tsv" />
+                    <has_line line="sample1.txt" />
+                    <has_line line="sample1.xls" />
+                    <has_line line="sample1.xlsx" />
+                 </assert_contents>
+            </output>
+        </test>
+
+    </tests>
+
+    <help>
+<![CDATA[
+This tool will lookup files on the Galaxy server machine, including mounted directories.
+
+Only directories that are included in the white list and not in the black list are allowed.
+If the directory you require does not pass the white list or blacklist test please contact the local galaxy admin.
+(Admins see README)
+
+This tool only supports a limited set of types and file extenstions. 
+No other files are ever returned either by data or listing.
+These endings are case senitive.
+
+====
+
+The data options will look for all files that have a particular ending in the selected directory.
+
+The tool will return two things.
+
+1. A Dataset collection of all the detected files.
+
+2. A file with the names of all the detected files. These will be sorted in the same order as galaxy builds the dataset collection. 
+
+The files can be filtered by setting a specific start strinf for the file name. 
+Only files that start with this string (case senstive) will be included.
+
+Files can also be filter for the last part before the file extsentions.
+
+Assuming the directory has:
+C01_R1_001.fasta   C01_R2_001.fatsa   C02_R1_001.fasta   C02_R2_001.fatsa
+
+Setting start C01 will return just the C01 files:   C01_R1_001.fasta   C01_R2_001.fatsa
+
+Setting last R1_001 will return the read1 files:   C01_R1_001.fasta   C02_R1_001.fasta
+
+As Galaxy detects the file type based on the extension this tool will change the exstension for supported alternative file ends.
+    This includes (manually) setting the exstension to fastqsanger, fastqsolexa, fastqillumina for tools that specify one of these.
+
+This tool will unzip gz files.
+
+====
+
+The listing option will return a txt file with all the files found with any of the supported endings. Other files in that directory are not included.
+
+The file exstensions are left as in the directory.
+
+File start and last filters are not supported in this mode.
+]]>
+    </help>
+    <citations>
+    </citations>
+
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/directory_copier.py	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,138 @@
+import gzip
+import optparse  # using optparse as hydra still python 2.6
+import os.path
+import shutil
+import sys
+
+def report_error(*args):
+    sys.stderr.write(' '.join(map(str,args)) + '\n')
+    sys.stderr.flush()
+    sys.exit(1)
+
+
+def get_tool_data(name):
+    root_dir = os.path.dirname((os.path.realpath(__file__)))
+    path = os.path.join(root_dir,"tool-data",name)
+    if not(os.path.isfile(path)): 
+        report_error(name,"file not found in tool's tool-data folder. Please ask you galaxy admin to add it back")
+    return path
+
+
+def check_white_list(path_to_check):
+    white_list = get_tool_data("white-list.ini")
+    with open(white_list, 'r') as white_list_file:
+        for line in white_list_file:
+            line = line.strip()
+            if len(line) >= 1 and path_to_check.startswith(line):
+                return True
+    report_error(path_to_check,"has not been included in the white list. Please contact the local galaxy admin to add it.")
+
+
+def check_black_list(path_to_check):
+    black_list = get_tool_data("black-list.ini")
+    with open(black_list, 'r') as black_list_file:
+        for line in black_list_file:
+            line = line.strip()
+            if len(line) >= 1 and line in path_to_check:
+                report_error(line,"has been black list so",path_to_check,"is not allowed. Please contact the local galaxy admin to change that, or add a symlink.")
+    return True
+
+
+def check_pattern_get_new_name(a_file, ending, options):
+    if options.start:
+        if not(a_file.startswith(options.start)):
+            return None
+    if options.last:
+        if ending[0] == ".":
+            last = options.last + ending
+        else:
+            if options.last[-1] == ".":
+                last = options.last + ending
+            else:
+                last = options.last + "." + ending
+        if not(a_file.endswith(last)):
+            return None
+    if options.new_ending:
+        name = a_file[:-len(ending)]
+        if options.new_ending[0] ==".":
+            if name[-1] == ".":
+                name = name[:-1]
+        return name + options.new_ending
+    if options.decompress:
+        if a_file.endswith(".gz"):
+            return a_file[:-3]
+    return a_file
+
+
+def check_and_get_new_name(a_file, options):
+    for ending in options.endings:
+        if a_file.endswith(ending):
+            return check_pattern_get_new_name (a_file, ending, options)
+    return None
+
+
+def link(a_file, new_name, path):
+    file_path = os.path.join(os.path.realpath(path), a_file)
+    sym_path = os.path.join(os.path.realpath("output"), new_name)
+    #if not(os.path.exists(sym_path)):
+    os.link(file_path, sym_path)
+
+
+def decompress(a_file, new_name, path):
+    file_path = os.path.join(os.path.realpath(path), a_file)
+    target_path = os.path.join(os.path.realpath("output"), new_name)
+    with gzip.open(file_path, 'rb') as f_in, open(target_path, 'wb') as f_out:
+        shutil.copyfileobj(f_in, f_out)
+
+
+def copy_and_link(path, options):
+    os.mkdir("output")
+    with open(options.list, 'w') as list_file:
+        files = os.listdir(path)
+        files.sort()
+        for a_file in files:
+            new_name = check_and_get_new_name(a_file, options)
+            if new_name:
+                list_file.write(new_name)
+                list_file.write("\n")
+                if options.decompress:
+                    if a_file.endswith(".gz"):
+                        decompress(a_file, new_name,path)
+                    else:
+                        link(a_file, new_name, path)
+                elif options.link:
+                    link(a_file, new_name, path)
+
+
+if __name__ == '__main__':
+    parser = optparse.OptionParser()
+    parser.add_option("--path", action="store", type="string",
+                      help="Path of directory to check. ")
+    parser.add_option("--ending", action="append", type="string", dest="endings",
+                      help="Ending that can be listed and if requested linked or decompressed. ")
+    parser.add_option("--start", action="store", type="string",
+                      help="String that must be at the start of the file name ")
+    parser.add_option("--last", action="store", type="string",
+                      help="String that must be the last bit of the file name before the endings")
+    parser.add_option("--new_ending", action="store", type="string", 
+                      help="New ending to replace any previous ending in list and if required links or decompressions. Note: If not set decompression will auto remove the compressioned part of the ending")
+    #parser.add_option("--regex", action="store", type="string",
+    #                  help="Regex pattern the file name (less . ending) must match before the endings")
+    parser.add_option("--list", action="store", type="string",
+                      help="Path to where all files should be listed. ")
+    parser.add_option("--link", action="store_true", default=False,
+                      help="If set will cause links to be added in output directory. ")
+    parser.add_option("--decompress", action="store_true", default=False,
+                      help="If set will cause gz files to be decompressed or if not a supported decompression ending linked.")
+    (options, args) = parser.parse_args()
+
+
+    path = options.path.strip()
+    if path[-1] != '/':
+        path = path + "/"
+    check_white_list(path)
+    print path, "white listed"
+    check_black_list(path)
+    print path, "not black listed"
+    copy_and_link(path, options)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/other.csv	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,18 @@
+A,top,line,with,fluff,across,many,columns
+more,,,,,,,
+stuff,,,,,,,
+in,,,,,,,
+several,,,,,,,
+lines,,,,,,,
+then blanks,,,,,,,
+,,,,,,,
+,,,,,,,
+An,the,the,more,the,more,,
+unimportant,x,y,unimportant,value,more,,
+column,axis,axis,stuff,column,fluff,,
+asas,alpha,foo,23,2,999,,
+dad,alpha,bar,21,3,23,,
+sd,beta,foo,21,999,34,,
+wwd,gamma,foo,34,3,999,,
+sd,gamma,bar,32,5,23,,
+sdee,beta,bar,323,5,23,,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/other.fa	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/other.fasta	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
+
Binary file test-data/other.fasta.gz has changed
Binary file test-data/sample1.bmp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.csv	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,18 @@
+A,top,line,with,fluff,across,many,columns
+more,,,,,,,
+stuff,,,,,,,
+in,,,,,,,
+several,,,,,,,
+lines,,,,,,,
+then blanks,,,,,,,
+,,,,,,,
+,,,,,,,
+An,the,the,more,the,more,,
+unimportant,x,y,unimportant,value,more,,
+column,axis,axis,stuff,column,fluff,,
+asas,alpha,foo,23,2,999,,
+dad,alpha,bar,21,3,23,,
+sd,beta,foo,21,999,34,,
+wwd,gamma,foo,34,3,999,,
+sd,gamma,bar,32,5,23,,
+sdee,beta,bar,323,5,23,,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.fa	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.fasta	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
+
Binary file test-data/sample1.fasta.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.fastq	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,12 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
++SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+hhhhhhhhhhghhghhhhhfhhhhhfffffe`ee[`X]b[d[ed`[Y[^Y
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
++SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+hhhhgfhhcghghggfcffdhfehhhhcehdchhdhahehffffde`bVd
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
++SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+dhhhgchhhghhhfhhhhhdhhhhehhghfhhhchfddffcffafhfghe
Binary file test-data/sample1.fastq.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.fq	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,12 @@
+@SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+TTGCCTGCCTATCATTTTAGTGCCTGTGAGGTGGAGATGTGAGGATCAGT
++SRR566546.970 HWUSI-EAS1673_11067_FC7070M:4:1:2299:1109 length=50
+hhhhhhhhhhghhghhhhhfhhhhhfffffe`ee[`X]b[d[ed`[Y[^Y
+@SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+GATTTGTATGAAAGTATACAACTAAAACTGCAGGTGGATCAGAGTAAGTC
++SRR566546.971 HWUSI-EAS1673_11067_FC7070M:4:1:2374:1108 length=50
+hhhhgfhhcghghggfcffdhfehhhhcehdchhdhahehffffde`bVd
+@SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+TGCATGATCTTCAGTGCCAGGACCTTATCAAGCGGTTTGGTCCCTTTGTT
++SRR566546.972 HWUSI-EAS1673_11067_FC7070M:4:1:2438:1109 length=50
+dhhhgchhhghhhfhhhhhdhhhhehhghfhhhchfddffcffafhfghe
Binary file test-data/sample1.jpeg has changed
Binary file test-data/sample1.jpg has changed
Binary file test-data/sample1.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.ps	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,284 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%DocumentNeededResources: font Helvetica
+%%+ font Helvetica-Bold
+%%+ font Helvetica-Oblique
+%%+ font Helvetica-BoldOblique
+%%+ font Symbol
+%%Title: R Graphics Output
+%%Creator: R Software
+%%Pages: (atend)
+%%BoundingBox: 0 0 720 720
+%%EndComments
+%%BeginProlog
+/bp  { gs sRGB gs } def
+% begin .ps.prolog
+/gs  { gsave } bind def
+/gr  { grestore } bind def
+/ep  { showpage gr gr } bind def
+/m   { moveto } bind def
+/l  { rlineto } bind def
+/np  { newpath } bind def
+/cp  { closepath } bind def
+/f   { fill } bind def
+/o   { stroke } bind def
+/c   { newpath 0 360 arc } bind def
+/r   { 4 2 roll moveto 1 copy 3 -1 roll exch 0 exch rlineto 0 rlineto -1 mul 0 exch rlineto closepath } bind def
+/p1  { stroke } bind def
+/p2  { gsave bg fill grestore newpath } bind def
+/p3  { gsave bg fill grestore stroke } bind def
+/p6  { gsave bg eofill grestore newpath } bind def
+/p7  { gsave bg eofill grestore stroke } bind def
+/t   { 5 -2 roll moveto gsave rotate
+       1 index stringwidth pop
+       mul neg 0 rmoveto show grestore } bind def
+/ta  { 4 -2 roll moveto gsave rotate show } bind def
+/tb  { 2 -1 roll 0 rmoveto show } bind def
+/cl  { grestore gsave newpath 3 index 3 index moveto 1 index
+       4 -1 roll lineto  exch 1 index lineto lineto
+       closepath clip newpath } bind def
+/rgb { setrgbcolor } bind def
+/s   { scalefont setfont } bind def
+% end   .ps.prolog
+/sRGB { [ /CIEBasedABC
+          << /DecodeLMN
+               [ { dup 0.03928 le
+                        {12.92321 div}
+                        {0.055 add 1.055 div 2.4 exp }
+                     ifelse
+                 } bind dup dup
+               ]
+             /MatrixLMN [0.412457 0.212673 0.019334
+                         0.357576 0.715152 0.119192
+                         0.180437 0.072175 0.950301]
+             /WhitePoint [0.9505 1.0 1.0890]
+           >>
+         ] setcolorspace } bind def
+/srgb { setcolor } bind def
+%%IncludeResource: font Helvetica
+/Helvetica findfont
+dup length dict begin
+  {1 index /FID ne {def} {pop pop} ifelse} forall
+  /Encoding ISOLatin1Encoding def
+  currentdict
+  end
+/Font1 exch definefont pop
+%%IncludeResource: font Helvetica-Bold
+/Helvetica-Bold findfont
+dup length dict begin
+  {1 index /FID ne {def} {pop pop} ifelse} forall
+  /Encoding ISOLatin1Encoding def
+  currentdict
+  end
+/Font2 exch definefont pop
+%%IncludeResource: font Helvetica-Oblique
+/Helvetica-Oblique findfont
+dup length dict begin
+  {1 index /FID ne {def} {pop pop} ifelse} forall
+  /Encoding ISOLatin1Encoding def
+  currentdict
+  end
+/Font3 exch definefont pop
+%%IncludeResource: font Helvetica-BoldOblique
+/Helvetica-BoldOblique findfont
+dup length dict begin
+  {1 index /FID ne {def} {pop pop} ifelse} forall
+  /Encoding ISOLatin1Encoding def
+  currentdict
+  end
+/Font4 exch definefont pop
+%%IncludeResource: font Symbol
+/Symbol findfont
+dup length dict begin
+  {1 index /FID ne {def} {pop pop} ifelse} forall
+  currentdict
+  end
+/Font5 exch definefont pop
+%%EndProlog
+%%Page: 1 1
+bp
+59.04 433.44 689.76 660.96 cl
+0 0 0 srgb
+2.25 setlinewidth
+[] 0 setdash
+0 setlinecap
+1 setlinejoin
+10.00 setmiterlimit
+np
+101.87 476.98 m
+155.73 0 l
+o
+0.75 setlinewidth
+[ 2.25 3.75] 0 setdash
+1 setlinecap
+np
+179.73 441.87 m
+0 0 l
+o
+np
+179.73 512.09 m
+0 0 l
+o
+0.75 setlinewidth
+[] 0 setdash
+np
+140.80 441.87 m
+77.87 0 l
+o
+np
+140.80 512.09 m
+77.87 0 l
+o
+np
+101.87 441.87 m
+155.73 0 l
+0 70.22 l
+-155.73 0 l
+0 -70.22 l
+o
+2.25 setlinewidth
+[] 0 setdash
+0 setlinecap
+np
+296.53 652.53 m
+155.74 0 l
+o
+0.75 setlinewidth
+[ 2.25 3.75] 0 setdash
+1 setlinecap
+np
+374.40 652.53 m
+0 0 l
+o
+np
+374.40 652.53 m
+0 0 l
+o
+0.75 setlinewidth
+[] 0 setdash
+np
+335.47 652.53 m
+77.86 0 l
+o
+np
+335.47 652.53 m
+77.86 0 l
+o
+np
+296.53 652.53 m
+155.74 0 l
+0 0 l
+-155.74 0 l
+0 0 l
+o
+2.25 setlinewidth
+[] 0 setdash
+0 setlinecap
+np
+491.20 582.31 m
+155.73 0 l
+o
+0.75 setlinewidth
+[ 2.25 3.75] 0 setdash
+1 setlinecap
+np
+569.07 512.09 m
+0 0 l
+o
+np
+569.07 652.53 m
+0 0 l
+o
+0.75 setlinewidth
+[] 0 setdash
+np
+530.13 512.09 m
+77.87 0 l
+o
+np
+530.13 652.53 m
+77.87 0 l
+o
+np
+491.20 512.09 m
+155.73 0 l
+0 140.44 l
+-155.73 0 l
+0 -140.44 l
+o
+0.00 0.00 720.00 720.00 cl
+0 0 0 srgb
+0.75 setlinewidth
+[] 0 setdash
+1 setlinecap
+1 setlinejoin
+10.00 setmiterlimit
+np
+179.73 433.44 m
+389.34 0 l
+o
+np
+179.73 433.44 m
+0 -7.20 l
+o
+np
+374.40 433.44 m
+0 -7.20 l
+o
+np
+569.07 433.44 m
+0 -7.20 l
+o
+/Font1 findfont 7 s
+182.25 419.04 (alpha) 1 90 t
+376.91 419.04 (beta) 1 90 t
+571.58 419.04 (gamma) 1 90 t
+np
+59.04 441.87 m
+0 210.66 l
+o
+np
+59.04 441.87 m
+-7.20 0 l
+o
+np
+59.04 476.98 m
+-7.20 0 l
+o
+np
+59.04 512.09 m
+-7.20 0 l
+o
+np
+59.04 547.20 m
+-7.20 0 l
+o
+np
+59.04 582.31 m
+-7.20 0 l
+o
+np
+59.04 617.42 m
+-7.20 0 l
+o
+np
+59.04 652.53 m
+-7.20 0 l
+o
+44.64 439.35 (2.0) 1 0 t
+44.64 474.46 (2.5) 1 0 t
+44.64 509.58 (3.0) 1 0 t
+44.64 544.69 (3.5) 1 0 t
+44.64 579.80 (4.0) 1 0 t
+44.64 614.91 (4.5) 1 0 t
+44.64 650.02 (5.0) 1 0 t
+np
+59.04 433.44 m
+630.72 0 l
+0 227.52 l
+-630.72 0 l
+0 -227.52 l
+o
+ep
+%%Trailer
+%%Pages: 1
+%%EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.sam	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,14 @@
+@SQ	SN:ref	LN:45
+@SQ	SN:ref2	LN:40
+r001	163	ref	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112
+r002	0	ref	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*
+r003	0	ref	9	30	5H6M	*	0	0	AGCTAA	*
+r004	0	ref	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*
+r003	16	ref	29	30	6H5M	*	0	0	TAGGC	*
+r001	83	ref	37	30	9M	=	7	-39	CAGCGCCAT	*
+x1	0	ref2	1	30	20M	*	0	0	aggttttataaaacaaataa	????????????????????
+x2	0	ref2	2	30	21M	*	0	0	ggttttataaaacaaataatt	?????????????????????
+x3	0	ref2	6	30	9M4I13M	*	0	0	ttataaaacAAATaattaagtctaca	??????????????????????????
+x4	0	ref2	10	30	25M	*	0	0	CaaaTaattaagtctacagagcaac	?????????????????????????
+x5	0	ref2	12	30	24M	*	0	0	aaTaattaagtctacagagcaact	????????????????????????
+x6	0	ref2	14	30	23M	*	0	0	Taattaagtctacagagcaacta	???????????????????????
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.tabular	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+An_unimportant_column	the_x_axis	the_y_axis	stuff	the_value_column	more_more_fluff
+13	asas	alpha	foo	23	2	999
+14	dad	alpha	bar	21	3	23
+15	sd	beta	foo	21	999	34
+16	wwd	gamma	foo	34	3	999
+17	sd	gamma	bar	32	5	23
+18	sdee	beta	bar	323	5	23
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.text	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,1 @@
+text1
Binary file test-data/sample1.tiff has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.tsv	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,7 @@
+An_unimportant_column	the_x_axis	the_y_axis	stuff	the_value_column	more_more_fluff
+13	asas	alpha	foo	23	2	999
+14	dad	alpha	bar	21	3	23
+15	sd	beta	foo	21	999	34
+16	wwd	gamma	foo	34	3	999
+17	sd	gamma	bar	32	5	23
+18	sdee	beta	bar	323	5	23
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample1.txt	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,1 @@
+1
Binary file test-data/sample1.xls has changed
Binary file test-data/sample1.xlsx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sample2.txt	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,1 @@
+2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/black-list.ini	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,24 @@
+# This file only works if saved as {tool}/tool-data/black_list.ini
+# It may be empty but it must exists
+
+# Parts of paths that will be blocked even if whitelisted.
+# so for example /usr/home/galaxy/ will be blocked if /galaxy/ if nlisted here
+
+/bin/
+/boot/
+/dev/
+/galaxy/
+/lib/
+/lib32/
+/lib64/
+/media/
+/opt/
+/root/
+/run/
+/sbin/
+/srv/
+/sys/
+/var/
+/usr/
+..
+~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/white-list.ini	Sun May 08 11:01:03 2016 -0400
@@ -0,0 +1,15 @@
+# This file only works if saved as {tool}/tool-data/white_list.ini
+
+# Start of paths that will be accepted by the directory reader
+# No jokers including * currently supported.
+# Even files listed here will be checked against the black list
+
+# To accept all paths just keep line with a single slash
+/
+
+# Add directories absolulute for example
+/home/joe_blog/galaxy_data
+
+# relative test_data as it only make sense for planemo tests
+test-data/
+