8
|
1 <tool id="directory_table_reader" name="Directory Data Reader" version="0.2">
|
|
2 <description>Reads data from preconfigured directories table.</description>
|
|
3 <command interpreter="python">
|
|
4 <![CDATA[
|
|
5 directory_copier.py
|
|
6 --ending .${directory.fields.original_extension}
|
|
7 --new_ending .${directory.fields.galaxy_extension}
|
|
8 #if $results.required=="data"
|
|
9 --new_ending .${directory.fields.galaxy_extension}
|
|
10 --decompress ${directory.fields.decompress}
|
|
11 #if $results.start
|
|
12 --start $results.start
|
|
13 #end if
|
|
14 #if $results.last
|
|
15 --last $results.last
|
|
16 #end if
|
|
17 #end if
|
|
18 --path ${directory.fields.path}
|
|
19 --list ${listing}
|
|
20 ]]>
|
|
21 </command>
|
|
22 <inputs>
|
|
23 <param name="directory" type="select" label="Directory to import data from">
|
|
24 <options from_data_table="directory_data"/>
|
|
25 <validator type="no_options" message="No Data Directory Setup"/>
|
|
26 </param>
|
|
27 <param name="list_name" type="text" size="25" label="output name" value="input data"/>
|
|
28 <conditional name="results">
|
|
29 <param name="required" type="select" label="Download data or just directory listing" help="Select type of action required.">
|
|
30 <option value="data" selected="true">Data and listing of selected type</option>
|
|
31 <option value="listing">Get listing of selected file types </option>
|
|
32 </param>
|
|
33 <when value="data">
|
|
34 <param name="start" type="text" value="" label="String which must be at the start of each file name" />
|
|
35 <param name="last" type="text" value="" label="String which must be at the end of the file name (excluding the file type)" />
|
|
36 </when>
|
|
37 <when value="listing"/>
|
|
38 </conditional>
|
|
39 </inputs>
|
|
40 <outputs>
|
|
41 <data format="txt" name="listing" label="List of files in $list_name">
|
|
42 </data>
|
|
43 <!-- Ideally galaxy can get the type based on the file extensions. If so just add the type here -->
|
|
44 <collection type="list" label="$list_name" name="data_collection">
|
|
45 <filter>(results['required'] == 'data')</filter>
|
|
46 <discover_datasets pattern="__designation_and_ext__" directory="output" visible="true" />
|
|
47 </collection>
|
|
48 </outputs>
|
|
49 <tests>
|
|
50 <test>
|
|
51 <param name="directory" value="fastq.gz_files_id" />
|
|
52 <param name="list_name" value="test_files" />
|
|
53 <param name="results|required" value="listing"/>
|
|
54 <output name="listing">
|
|
55 <assert_contents>
|
|
56 <has_line line="sample1.fastqsanger" />
|
|
57 <has_line line="other.fastqsanger" />
|
|
58 </assert_contents>
|
|
59 </output>
|
|
60 </test>
|
|
61 <test>
|
|
62 <param name="directory" value="fastq.gz_files_id" />
|
|
63 <output name="listing_fastq_gz">
|
|
64 <assert_contents>
|
|
65 <has_line line="sample1.fastqsanger" />
|
|
66 </assert_contents>
|
|
67 </output>
|
|
68 <output_collection name="data_collection" type="list">
|
|
69 <element name="sample1" ftype="fastqsanger" file="sample1.fastq" />
|
|
70 <element name="other" ftype="fastqsanger" file="other.fastq" />
|
|
71 </output_collection>
|
|
72 </test>
|
|
73 <test>
|
|
74 <param name="directory" value="fastq_files_id" />
|
|
75 <param name="results|start" value="sam" />
|
|
76 <output name="listing_fastq">
|
|
77 <assert_contents>
|
|
78 <has_line line="sample1.fastq" />
|
|
79 <not_has_text text="other.fasta" />
|
|
80 </assert_contents>
|
|
81 </output>
|
|
82 <output_collection name="data_collection" type="list">
|
|
83 <element name="sample1" ftype="fastq" file="sample1.fastq" />
|
|
84 </output_collection>
|
|
85 </test>
|
|
86 </tests>
|
|
87
|
|
88 <help>
|
|
89 <![CDATA[
|
|
90 This tool will lookup files on the Galaxy server machine, including mounted directories.
|
|
91
|
|
92 Only directories and ending combinations set up by a Galaxy admin can be listed or loaded in this way.
|
|
93 These endings are case senitive.
|
|
94
|
|
95 ====
|
|
96
|
|
97 The data options will look for all files that have a particular ending in the selected directory.
|
|
98
|
|
99 The tool will return two things.
|
|
100
|
|
101 1. A Dataset collection of all the detected files. (If data requested)
|
|
102
|
|
103 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.
|
|
104
|
|
105 The files can be filtered by setting a specific start string for the file name.
|
|
106 Only files that start with this string (case senstive) will be included.
|
|
107
|
|
108 Files can also be filter for the last part before the file extsentions.
|
|
109
|
|
110 Assuming the directory has:
|
|
111 C01_R1_001.fasta C01_R2_001.fatsa C02_R1_001.fasta C02_R2_001.fatsa
|
|
112
|
|
113 Setting start C01 will return just the C01 files: C01_R1_001.fasta C01_R2_001.fatsa
|
|
114
|
|
115 Setting last R1_001 will return the read1 files: C01_R1_001.fasta C02_R1_001.fasta
|
|
116
|
|
117 As Galaxy detects the file type based on the extension this tool will change the exstension as setup by the admin.
|
|
118
|
|
119 This tool will unzip gz files if requested to by the admin,
|
|
120
|
|
121 ]]>
|
|
122 </help>
|
|
123 <citations>
|
|
124 </citations>
|
|
125
|
|
126 </tool>
|