1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a14006775b08/ changeset: a14006775b08 user: jgoecks date: 2013-01-29 16:37:16 summary: Add parameter to filtering tool to optionally skip header lines. Add test for new parameter usage as well. affected #: 4 files
diff -r 22788c1262a2756a50e03d92f8ee14705d019b98 -r a14006775b085be19454aa6d47655a6ebb68c8a1 test-data/filter1_in5.tab --- /dev/null +++ b/test-data/filter1_in5.tab @@ -0,0 +1,5 @@ +tracking_id class_code nearest_ref_id gene_id gene_short_name tss_id locus length coverage replicate 1_FPKM replicate 1_conf_lo replicate 1_conf_hi replicate 1_status replicate 2_FPKM replicate 2_conf_lo replicate 2_conf_hi replicate 2_status +CUFF.1.1 - - CUFF.1 - - chr19:305598-306225 627 - 0 0 0 OK 206.177 0 694.583 OK +CUFF.10.1 - - CUFF.10 - - chr19:618402-618611 209 - 0 0 0 OK 767.201 0 2801.16 OK +CUFF.100.1 - - CUFF.100 - - chr19:1625589-1652356 888 - 0 0 0 OK 172.566 0 2879.98 OK +CUFF.100.2 - - CUFF.100 - - chr19:1625589-1652356 581 - 0 0 0 OK 1147.8 0 5922.31 OK
diff -r 22788c1262a2756a50e03d92f8ee14705d019b98 -r a14006775b085be19454aa6d47655a6ebb68c8a1 test-data/filter1_test5.tab --- /dev/null +++ b/test-data/filter1_test5.tab @@ -0,0 +1,4 @@ +tracking_id class_code nearest_ref_id gene_id gene_short_name tss_id locus length coverage replicate 1_FPKM replicate 1_conf_lo replicate 1_conf_hi replicate 1_status replicate 2_FPKM replicate 2_conf_lo replicate 2_conf_hi replicate 2_status +CUFF.1.1 - - CUFF.1 - - chr19:305598-306225 627 - 0 0 0 OK 206.177 0 694.583 OK +CUFF.100.1 - - CUFF.100 - - chr19:1625589-1652356 888 - 0 0 0 OK 172.566 0 2879.98 OK +CUFF.100.2 - - CUFF.100 - - chr19:1625589-1652356 581 - 0 0 0 OK 1147.8 0 5922.31 OK
diff -r 22788c1262a2756a50e03d92f8ee14705d019b98 -r a14006775b085be19454aa6d47655a6ebb68c8a1 tools/stats/filtering.py --- a/tools/stats/filtering.py +++ b/tools/stats/filtering.py @@ -36,6 +36,7 @@ in_column_types = sys.argv[5].split( ',' ) except: stop_err( "Data does not appear to be tabular. This tool can only be used with tab-delimited data." ) +num_header_lines = int( sys.argv[6] )
# Unescape if input has been escaped mapped_str = { @@ -98,6 +99,12 @@ for i, line in enumerate( file( in_fname ) ): total_lines += 1 line = line.rstrip( '\r\n' ) + + if i < num_header_lines: + lines_kept += 1 + print >> out, line + continue + if not line or line.startswith( '#' ): skipped_lines += 1 continue
diff -r 22788c1262a2756a50e03d92f8ee14705d019b98 -r a14006775b085be19454aa6d47655a6ebb68c8a1 tools/stats/filtering.xml --- a/tools/stats/filtering.xml +++ b/tools/stats/filtering.xml @@ -1,13 +1,14 @@ <tool id="Filter1" name="Filter" version="1.1.0"><description>data on any column using simple expressions</description><command interpreter="python"> - filtering.py $input $out_file1 "$cond" ${input.metadata.columns} "${input.metadata.column_types}" + filtering.py $input $out_file1 "$cond" ${input.metadata.columns} "${input.metadata.column_types}" $header_lines </command><inputs><param format="tabular" name="input" type="data" label="Filter" help="Dataset missing? See TIP below."/><param name="cond" size="40" type="text" value="c1=='chr22'" label="With following condition" help="Double equal signs, ==, must be used as shown above. To filter for an arbitrary string, use the Select tool."><validator type="empty_field" message="Enter a valid filtering condition, see syntax and examples below."/></param> + <param name="header_lines" type="integer" value="0" label="Number of header lines to skip"/></inputs><outputs><data format="input" name="out_file1" metadata_source="input"/> @@ -16,24 +17,34 @@ <test><param name="input" value="1.bed"/><param name="cond" value="c1=='chr22'"/> + <param name="header_lines" value="0"/><output name="out_file1" file="filter1_test1.bed"/></test><test><param name="input" value="7.bed"/><param name="cond" value="c1=='chr1' and c3-c2>=2000 and c6=='+'"/> + <param name="header_lines" value="0"/><output name="out_file1" file="filter1_test2.bed"/></test><!-- Test filtering of file with a variable number of columns. --><test><param name="input" value="filter1_in3.sam"/><param name="cond" value="c3=='chr1' and c5>5"/> + <param name="header_lines" value="0"/><output name="out_file1" file="filter1_test3.sam"/></test><test><param name="input" value="filter1_inbad.bed"/><param name="cond" value="c1=='chr22'"/> + <param name="header_lines" value="0"/><output name="out_file1" file="filter1_test4.bed"/></test> + <test> + <param name="input" value="filter1_in5.tab"/> + <param name="cond" value="c8>500"/> + <param name="header_lines" value="1"/> + <output name="out_file1" file="filter1_test5.tab"/> + </test></tests><help>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
galaxy-commits@lists.galaxyproject.org