Next changeset 1:92034dcbb40a (2015-11-11) |
Commit message:
Imported from capsule None |
added:
tabular_to_fastq.py tabular_to_fastq.xml test-data/fastq_to_tabular_out_1.tabular test-data/fastq_to_tabular_out_2.tabular test-data/sanger_full_range_as_cssanger.fastqcssanger test-data/sanger_full_range_original_sanger.fastqsanger tool_dependencies.xml |
b |
diff -r 000000000000 -r b334cd1095ea tabular_to_fastq.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tabular_to_fastq.py Mon Jan 27 09:27:43 2014 -0500 |
[ |
@@ -0,0 +1,29 @@ +#Dan Blankenberg +import sys + +def main(): + input_filename = sys.argv[1] + output_filename = sys.argv[2] + identifier_col = int( sys.argv[3] ) - 1 + sequence_col = int( sys.argv[4] ) - 1 + quality_col = int( sys.argv[5] ) - 1 + + max_col = max( identifier_col, sequence_col, quality_col ) + num_reads = None + fastq_read = None + skipped_lines = 0 + out = open( output_filename, 'wb' ) + for num_reads, line in enumerate( open( input_filename ) ): + fields = line.rstrip( '\n\r' ).split( '\t' ) + if len( fields ) > max_col: + out.write( "@%s\n%s\n+\n%s\n" % ( fields[identifier_col], fields[sequence_col], fields[quality_col] ) ) + else: + skipped_lines += 1 + + out.close() + if num_reads is None: + print "Input was empty." + else: + print "%i tabular lines were written as FASTQ reads. Be sure to use the FASTQ Groomer tool on this output before further analysis." % ( num_reads + 1 - skipped_lines ) + +if __name__ == "__main__": main() |
b |
diff -r 000000000000 -r b334cd1095ea tabular_to_fastq.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tabular_to_fastq.xml Mon Jan 27 09:27:43 2014 -0500 |
b |
@@ -0,0 +1,47 @@ +<tool id="tabular_to_fastq" name="Tabular to FASTQ" version="1.0.0"> + <description>converter</description> + <requirements> + <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement> + </requirements> + <command interpreter="python">tabular_to_fastq.py '$input_file' '$output_file' '$identifier' '$sequence' '$quality'</command> + <inputs> + <param name="input_file" type="data" format="tabular" label="Tabular file to convert" /> + <param name="identifier" label="Identifier column" type="data_column" data_ref="input_file" /> + <param name="sequence" label="Sequence column" type="data_column" data_ref="input_file" /> + <param name="quality" label="Quality column" type="data_column" data_ref="input_file" /> + </inputs> + <outputs> + <data name="output_file" format="fastq" /> + </outputs> + <tests> + <!-- basic test --> + <test> + <param name="input_file" value="fastq_to_tabular_out_1.tabular" ftype="tabular" /> + <param name="identifier" value="1" /> + <param name="sequence" value="2" /> + <param name="quality" value="3" /> + <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> + </test> + <!-- color space test --> + <test> + <param name="input_file" value="fastq_to_tabular_out_2.tabular" ftype="tabular" /> + <param name="identifier" value="1" /> + <param name="sequence" value="2" /> + <param name="quality" value="3" /> + <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" /> + </test> + </tests> + <help> +**What it does** + +This tool attempts to convert a tabular file containing sequencing read data to a FASTQ formatted file. The FASTQ Groomer tool should always be used on the output of this tool. + +------ + +**Citation** + +If you use this tool, please cite `Blankenberg D, Gordon A, Von Kuster G, Coraor N, Taylor J, Nekrutenko A; Galaxy Team. Manipulation of FASTQ data with Galaxy. Bioinformatics. 2010 Jul 15;26(14):1783-5. <http://www.ncbi.nlm.nih.gov/pubmed/20562416>`_ + + + </help> +</tool> |
b |
diff -r 000000000000 -r b334cd1095ea test-data/fastq_to_tabular_out_1.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fastq_to_tabular_out_1.tabular Mon Jan 27 09:27:43 2014 -0500 |
[ |
@@ -0,0 +1,2 @@ +FAKE0001 Original version has PHRED scores from 0 to 93 inclusive (in that order) ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTAC !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +FAKE0002 Original version has PHRED scores from 93 to 0 inclusive (in that order) CATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCA ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! |
b |
diff -r 000000000000 -r b334cd1095ea test-data/fastq_to_tabular_out_2.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fastq_to_tabular_out_2.tabular Mon Jan 27 09:27:43 2014 -0500 |
[ |
@@ -0,0 +1,2 @@ +FAKE0001 Original version has PHRED scores from 0 to 93 inclusive (in that order) G2131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +FAKE0002 Original version has PHRED scores from 93 to 0 inclusive (in that order) G3131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 ~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! |
b |
diff -r 000000000000 -r b334cd1095ea test-data/sanger_full_range_as_cssanger.fastqcssanger --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sanger_full_range_as_cssanger.fastqcssanger Mon Jan 27 09:27:43 2014 -0500 |
[ |
@@ -0,0 +1,8 @@ +@FAKE0001 Original version has PHRED scores from 0 to 93 inclusive (in that order) +G2131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 ++ +!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +@FAKE0002 Original version has PHRED scores from 93 to 0 inclusive (in that order) +G3131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131 ++ +~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! |
b |
diff -r 000000000000 -r b334cd1095ea test-data/sanger_full_range_original_sanger.fastqsanger --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sanger_full_range_original_sanger.fastqsanger Mon Jan 27 09:27:43 2014 -0500 |
[ |
@@ -0,0 +1,8 @@ +@FAKE0001 Original version has PHRED scores from 0 to 93 inclusive (in that order) +ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTAC ++ +!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +@FAKE0002 Original version has PHRED scores from 93 to 0 inclusive (in that order) +CATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCA ++ +~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! |
b |
diff -r 000000000000 -r b334cd1095ea tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Mon Jan 27 09:27:43 2014 -0500 |
b |
@@ -0,0 +1,6 @@ +<?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" prior_installation_required="False" toolshed="http://toolshed.g2.bx.psu.edu" /> + </package> +</tool_dependency> |