Mercurial > repos > peterjc > fastq_paired_unpaired
changeset 8:8cbc866b72ce draft
"Update all the pico_galaxy tools on main Tool Shed"
author | peterjc |
---|---|
date | Fri, 16 Apr 2021 22:36:15 +0000 |
parents | 2709a0f065c9 |
children | 422724644e24 |
files | tools/fastq_paired_unpaired/README.rst tools/fastq_paired_unpaired/fastq_paired_unpaired.py tools/fastq_paired_unpaired/fastq_paired_unpaired.xml tools/fastq_paired_unpaired/tool_dependencies.xml |
diffstat | 4 files changed, 39 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/fastq_paired_unpaired/README.rst Tue May 16 08:53:57 2017 -0400 +++ b/tools/fastq_paired_unpaired/README.rst Fri Apr 16 22:36:15 2021 +0000 @@ -105,7 +105,7 @@ $ planemo shed_upload --tar_only tools/fastq_paired_unpaired/ ... - $ tar -tzf shed_upload.tar.gz + $ tar -tzf shed_upload.tar.gz test-data/sanger-pairs-forward.fastq test-data/sanger-pairs-interleaved.fastq test-data/sanger-pairs-mixed.fastq
--- a/tools/fastq_paired_unpaired/fastq_paired_unpaired.py Tue May 16 08:53:57 2017 -0400 +++ b/tools/fastq_paired_unpaired/fastq_paired_unpaired.py Fri Apr 16 22:36:15 2021 +0000 @@ -4,7 +4,7 @@ The input file should be a valid FASTQ file which has been sorted so that any partner forward+reverse reads are consecutive. The output files all preserve this sort order. Pairing are recognised based on standard name -suffices. See below or run the tool with no arguments for more details. +suffixes. See below or run the tool with no arguments for more details. Note that the FASTQ variant is unimportant (Sanger, Solexa, Illumina, or even Color Space should all work equally well). @@ -122,8 +122,12 @@ re_illumina_r = re.compile(r"^[a-zA-Z0-9_:-]+ 2:.*$") assert re_illumina_f.match("HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 1:N:0:TGNCCA") assert re_illumina_r.match("HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 2:N:0:TGNCCA") -assert not re_illumina_f.match("HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 2:N:0:TGNCCA") -assert not re_illumina_r.match("HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 1:N:0:TGNCCA") +assert not re_illumina_f.match( + "HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 2:N:0:TGNCCA" +) +assert not re_illumina_r.match( + "HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 1:N:0:TGNCCA" +) FASTQ_TEMPLATE = "@%s\n%s\n+\n%s\n" @@ -147,7 +151,7 @@ # ============ # Forward read # ============ - template = name[:suffix.start()] + template = name[: suffix.start()] is_forward = True elif re_illumina_f.match(title): template = name # No suffix @@ -172,7 +176,7 @@ # ============ # Reverse read # ============ - template = name[:suffix.start()] + template = name[: suffix.start()] is_reverse = True elif re_illumina_r.match(title): template = name # No suffix @@ -226,12 +230,25 @@ pairs_r_handle.close() if neither: - print("%i reads (%i forward, %i reverse, %i neither), %i in pairs, %i as singles" - % (count, forward, reverse, neither, pairs, singles)) + print( + "%i reads (%i forward, %i reverse, %i neither), %i in pairs, %i as singles" + % (count, forward, reverse, neither, pairs, singles) + ) else: - print("%i reads (%i forward, %i reverse), %i in pairs, %i as singles" - % (count, forward, reverse, pairs, singles)) + print( + "%i reads (%i forward, %i reverse), %i in pairs, %i as singles" + % (count, forward, reverse, pairs, singles) + ) -assert count == pairs + singles == forward + reverse + neither, \ - "%i vs %i+%i=%i vs %i+%i+%i=%i" \ - % (count, pairs, singles, pairs + singles, forward, reverse, neither, forward + reverse + neither) +assert ( + count == pairs + singles == forward + reverse + neither +), "%i vs %i+%i=%i vs %i+%i+%i=%i" % ( + count, + pairs, + singles, + pairs + singles, + forward, + reverse, + neither, + forward + reverse + neither, +)
--- a/tools/fastq_paired_unpaired/fastq_paired_unpaired.xml Tue May 16 08:53:57 2017 -0400 +++ b/tools/fastq_paired_unpaired/fastq_paired_unpaired.xml Fri Apr 16 22:36:15 2021 +0000 @@ -1,5 +1,5 @@ <tool id="fastq_paired_unpaired" name="Divide FASTQ file into paired and unpaired reads" version="0.1.4"> - <description>using the read name suffices</description> + <description>using the read name suffixes</description> <requirements> <requirement type="package" version="1.0.1">galaxy_sequence_utils</requirement> <requirement type="package" version="1.67">biopython</requirement> @@ -17,7 +17,7 @@ $output_singles </command> <inputs> - <param name="input_fastq" type="data" format="fastq" label="FASTQ file to divide into paired and unpaired reads"/> + <param name="input_fastq" type="data" format="foobar" label="FASTQ file to divide into paired and unpaired reads"/> <conditional name="output_choice_cond"> <param name="output_choice" type="select" label="How to output paired reads?"> <option value="separate">Separate (two FASTQ files, for the forward and reverse reads, in matching order).</option> @@ -65,7 +65,7 @@ The input file should be a valid FASTQ file which has been sorted so that any partner forward+reverse reads are consecutive. The output files all preserve this sort order. Pairing are recognised based on standard name -suffices. See below or run the tool with no arguments for more details. +suffixes. See below or run the tool with no arguments for more details. Any reads where the forward/reverse naming suffix used is not recognised are treated as orphan reads. The tool supports the /1 and /2 convention @@ -75,7 +75,7 @@ with the fragment number in the description, for example: * @HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 1:N:0:TGNCCA - * @HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 2:N:0:TGNCCA + * @HWI-ST916:79:D04M5ACXX:1:1101:10000:100326 2:N:0:TGNCCA Note that this does support multiple forward and reverse reads per template (which is quite common with Sanger sequencing), e.g. this which is sorted @@ -106,7 +106,7 @@ Peter J.A. Cock, Björn A. Grüning, Konrad Paszkiewicz and Leighton Pritchard (2013). Galaxy tools and workflows for sequence analysis with applications in molecular plant pathology. PeerJ 1:e167 -http://dx.doi.org/10.7717/peerj.167 +https://doi.org/10.7717/peerj.167 This tool is available to install into other Galaxy Instances via the Galaxy Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/fastq_paired_unpaired
--- a/tools/fastq_paired_unpaired/tool_dependencies.xml Tue May 16 08:53:57 2017 -0400 +++ b/tools/fastq_paired_unpaired/tool_dependencies.xml Fri Apr 16 22:36:15 2021 +0000 @@ -1,9 +1,9 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <tool_dependency> <package name="galaxy_sequence_utils" version="1.0.1"> - <repository changeset_revision="c1ab450748ba" name="package_galaxy_sequence_utils_1_0_1" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> + <repository name="package_galaxy_sequence_utils_1_0_1" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" changeset_revision="c1ab450748ba"/> </package> <package name="biopython" version="1.67"> - <repository changeset_revision="a42f244cce44" name="package_biopython_1_67" owner="biopython" toolshed="https://toolshed.g2.bx.psu.edu" /> + <repository name="package_biopython_1_67" owner="biopython" toolshed="https://toolshed.g2.bx.psu.edu" changeset_revision="a12f73c3b116"/> </package> -</tool_dependency> +</tool_dependency> \ No newline at end of file