Previous changeset 1:b957f55f3955 (2015-11-11) Next changeset 3:10b75444feae (2019-11-01) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_filter commit f2582539542b33240234e8ea6093e25d0aee9b6a |
modified:
fastq_filter.xml |
added:
test-data/sanger_full_range_original_sanger.fastqsanger.gz |
removed:
fastq_filter.py tool_dependencies.xml |
b |
diff -r b957f55f3955 -r 06934412f56d fastq_filter.py --- a/fastq_filter.py Wed Nov 11 12:40:42 2015 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,36 +0,0 @@ -#Dan Blankenberg -import sys, os, shutil -from galaxy_utils.sequence.fastq import fastqReader, fastqWriter - -def main(): - #Read command line arguments - input_filename = sys.argv[1] - script_filename = sys.argv[2] - output_filename = sys.argv[3] - additional_files_path = sys.argv[4] - input_type = sys.argv[5] or 'sanger' - - #Save script file for debuging/verification info later - os.mkdir( additional_files_path ) - shutil.copy( script_filename, os.path.join( additional_files_path, 'debug.txt' ) ) - - ## Dan, Others: Can we simply drop the "format=input_type" here since it is specified in reader. - ## This optimization would cut runtime roughly in half (for my test case anyway). -John - out = fastqWriter( open( output_filename, 'wb' ), format = input_type ) - - i = None - reads_kept = 0 - execfile(script_filename, globals()) - for i, fastq_read in enumerate( fastqReader( open( input_filename ), format = input_type ) ): - ret_val = fastq_read_pass_filter( fastq_read ) ## fastq_read_pass_filter defined in script_filename - if ret_val: - out.write( fastq_read ) - reads_kept += 1 - out.close() - if i is None: - print "Your file contains no valid fastq reads." - else: - print 'Kept %s of %s reads (%.2f%%).' % ( reads_kept, i + 1, float( reads_kept ) / float( i + 1 ) * 100.0 ) - -if __name__ == "__main__": - main() |
b |
diff -r b957f55f3955 -r 06934412f56d fastq_filter.xml --- a/fastq_filter.xml Wed Nov 11 12:40:42 2015 -0500 +++ b/fastq_filter.xml Sat Sep 30 14:57:54 2017 -0400 |
[ |
b'@@ -1,294 +1,299 @@\n-<tool id="fastq_filter" name="Filter FASTQ" version="1.0.0">\n- <description>reads by quality score and length</description>\n- <requirements>\n- <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>\n- </requirements>\n- <command interpreter="python">fastq_filter.py $input_file $fastq_filter_file $output_file $output_file.files_path \'${input_file.extension[len( \'fastq\' ):]}\'</command>\n- <inputs>\n- <page>\n- <param name="input_file" type="data" format="fastqsanger,fastqcssanger" label="FASTQ File" help="Requires groomed data: if your data does not appear here try using the FASTQ groomer."/>\n- <param name="min_size" label="Minimum Size" value="0" type="integer">\n- <validator type="in_range" message="Minimum size must be positive" min="0"/>\n- </param>\n- <param name="max_size" label="Maximum Size" value="0" type="integer" help="A maximum size less than 1 indicates no limit."/>\n- <param name="min_quality" label="Minimum Quality" value="0" type="float"/>\n- <param name="max_quality" label="Maximum Quality" value="0" type="float" help="A maximum quality less than 1 indicates no limit."/>\n- <param name="max_num_deviants" label="Maximum number of bases allowed outside of quality range" value="0" type="integer">\n- <validator type="in_range" message="Maximum number of deviate bases must be positive" min="0"/>\n- </param>\n- <param name="paired_end" label="This is paired end data" type="boolean" truevalue="paired_end" falsevalue="single_end" checked="False"/>\n- <repeat name="fastq_filters" title="Quality Filter on a Range of Bases" help="The above settings do not apply to these filters.">\n- <conditional name="offset_type">\n- <param name="base_offset_type" type="select" label="Define Base Offsets as" help="Use Absolute for fixed length reads (Illumina, SOLiD)<br>Use Percentage for variable length reads (Roche/454)">\n- <option value="offsets_absolute" selected="true">Absolute Values</option>\n- <option value="offsets_percent">Percentage of Read Length</option>\n- </param>\n- <when value="offsets_absolute">\n- <param name="left_column_offset" label="Offset from 5\' end" value="0" type="integer" help="Values start at 0, increasing from the left">\n- <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>\n- <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>\n- </param>\n- <param name="right_column_offset" label="Offset from 3\' end" value="0" type="integer" help="Values start at 0, increasing from the right">\n- <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>\n- <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>\n- </param>\n- </when>\n- <when value="offsets_percent">\n- <param name="left_column_offset" label="Offset from 5\' end" value="0" type="float">\n- <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>\n- </param>\n- <param name="right_column_offset" label="Offset from 3\' end" value="0" type="float">\n- <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>\n- </param>\n- </when>\n- </conditional>\n- <param name="score_operation" type="select" label="Aggregate read score for specified range">\n- <option value="min" selected="True">min score</option>\n- <option value="max">max score</option>\n- <option value="sum">sum of scores</option>\n- <option value="mean">mean of scores</option>\n- </param>\n- <param name="score_comparison" type="select" label="Keep read when '..b' <param name="base_offset_type" value="offsets_absolute"/>\n+ <param name="left_column_offset" value="1"/>\n+ <param name="right_column_offset" value="1"/>\n+ <param name="score_operation" value="max"/>\n+ <param name="score_comparison" value="<="/>\n+ <param name="score" value="92"/>\n+ <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+ </test>\n+ <!-- percent based offsets -->\n+ <test>\n+ <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger"/>\n+ <param name="min_size" value="0"/>\n+ <param name="max_size" value="0"/>\n+ <param name="min_quality" value="0"/>\n+ <param name="max_quality" value="0"/>\n+ <param name="max_num_deviants" value="0"/>\n+ <param name="paired_end" value="false"/>\n+ <param name="base_offset_type" value="offsets_percent"/>\n+ <param name="left_column_offset" value="1.075"/>\n+ <param name="right_column_offset" value="1.075"/>\n+ <param name="score_operation" value="min"/>\n+ <param name="score_comparison" value=">="/>\n+ <param name="score" value="1"/>\n+ <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+ </test>\n+ <test>\n+ <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger"/>\n+ <param name="min_size" value="0"/>\n+ <param name="max_size" value="0"/>\n+ <param name="min_quality" value="0"/>\n+ <param name="max_quality" value="0"/>\n+ <param name="max_num_deviants" value="0"/>\n+ <param name="paired_end" value="true"/>\n+ <param name="base_offset_type" value="offsets_percent"/>\n+ <param name="left_column_offset" value="1"/>\n+ <param name="right_column_offset" value="1"/>\n+ <param name="score_operation" value="min"/>\n+ <param name="score_comparison" value=">="/>\n+ <param name="score" value="1"/>\n+ <output name="output_file" file="empty_file.dat" ftype="fastqsanger" />\n+ </test>\n+ </tests>\n+ <help><![CDATA[\n This tool allows you to build complex filters to be applied to each read in a FASTQ file.\n \n **Basic Options:**\n@@ -297,7 +302,7 @@\n * If your data is paired-end, select the proper checkbox; this will cause each read to be internally split down the middle and filters applied to each half using the offsets specified.\n \n **Advance Options:**\n- * You can specify any number of advanced filters. \n+ * You can specify any number of advanced filters.\n * 5\' and 3\' offsets are defined, starting at zero, increasing from the respective end of the reads. For example, a quality string of "ABCDEFG", with 5\' and 3\' offsets of 1 and 1, respectively, specified will yield "BCDEF".\n * You can specify either absolute offset values, or percentage offset values. *Absolute Values* based offsets are useful for fixed length reads (e.g. Illumina or SOLiD data). *Percentage of Read Length* based offsets are useful for variable length reads (e.g. 454 data). When using the percent-based method, offsets are rounded to the nearest integer.\n * The user specifies the aggregating action (min, max, sum, mean) to perform on the quality score values found between the specified offsets to be used with the user defined comparison operation and comparison value.\n@@ -308,14 +313,8 @@\n .. class:: warningmark\n \n Adapter bases in color space reads are excluded from filtering.\n-\n-------\n-\n-\n-</help>\n-\n-<citations>\n- <citation type="doi">10.1093/bioinformatics/btq281</citation>\n-</citations>\n-\n+ ]]></help>\n+ <citations>\n+ <citation type="doi">10.1093/bioinformatics/btq281</citation>\n+ </citations>\n </tool>\n' |
b |
diff -r b957f55f3955 -r 06934412f56d test-data/sanger_full_range_original_sanger.fastqsanger.gz |
b |
Binary file test-data/sanger_full_range_original_sanger.fastqsanger.gz has changed |
b |
diff -r b957f55f3955 -r 06934412f56d tool_dependencies.xml --- a/tool_dependencies.xml Wed Nov 11 12:40:42 2015 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<tool_dependency> - <package name="galaxy_sequence_utils" version="1.0.0"> - <repository changeset_revision="0643676ad5f7" name="package_galaxy_utils_1_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" /> - </package> -</tool_dependency> |