Previous changeset 10:1ea4bc07d303 (2015-05-21) Next changeset 12:86cfa8eebb73 (2017-02-03) |
Commit message:
planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/seq_primer_clip commit 4bd49529e9ca2096cd875e98daf7190d13fa8d0b-dirty |
modified:
tools/seq_primer_clip/README.rst tools/seq_primer_clip/seq_primer_clip.py tools/seq_primer_clip/seq_primer_clip.xml tools/seq_primer_clip/tool_dependencies.xml |
b |
diff -r 1ea4bc07d303 -r 5ccb4e31510a tools/seq_primer_clip/README.rst --- a/tools/seq_primer_clip/README.rst Thu May 21 10:53:06 2015 -0400 +++ b/tools/seq_primer_clip/README.rst Wed Feb 01 13:18:48 2017 -0500 |
b |
@@ -1,7 +1,7 @@ Galaxy tool to primer clip (trim) FASTA, FASTQ or SFF reads =========================================================== -This tool is copyright 2011-2015 by Peter Cock, The James Hutton Institute +This tool is copyright 2011-2017 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below (MIT licence). @@ -68,6 +68,9 @@ v0.0.13 - Use ``format_source=...`` tag. - Reorder XML elements (internal change only). - Planemo for Tool Shed upload (``.shed.yml``, internal change only). + - Fixed input file help text. +v0.0.14 - Updated to point at Biopython 1.67 (latest version in Tool Shed). + - Explicit dependency on ``galaxy_sequence_utils``. ======= ====================================================================== @@ -86,12 +89,12 @@ Planemo commands (which requires you have set your Tool Shed access details in ``~/.planemo.yml`` and that you have access rights on the Tool Shed):: - $ planemo shed_update --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/seq_primer_clip/ + $ planemo shed_update -t testtoolshed --check_diff ~/repositories/pico_galaxy/tools/seq_primer_clip/ ... or:: - $ planemo shed_update --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/seq_primer_clip/ + $ planemo shed_update -t toolshed --check_diff ~/repositories/pico_galaxy/tools/seq_primer_clip/ ... To just build and check the tar ball, use:: |
b |
diff -r 1ea4bc07d303 -r 5ccb4e31510a tools/seq_primer_clip/seq_primer_clip.py --- a/tools/seq_primer_clip/seq_primer_clip.py Thu May 21 10:53:06 2015 -0400 +++ b/tools/seq_primer_clip/seq_primer_clip.py Wed Feb 01 13:18:48 2017 -0500 |
[ |
b'@@ -38,49 +38,45 @@\n print "v0.0.12"\n sys.exit(0)\n \n-def sys_exit(msg, err=1):\n- sys.stderr.write(msg)\n- sys.exit(err)\n-\n try:\n from Bio.Seq import reverse_complement\n from Bio.SeqIO.SffIO import SffIterator, SffWriter\n except ImportError:\n- sys_exit("Requires Biopython 1.54 or later")\n+ sys.exit("Requires Biopython 1.54 or later")\n try:\n from Bio.SeqIO.SffIO import ReadRocheXmlManifest\n except ImportError:\n- #Prior to Biopython 1.56 this was a private function\n+ # Prior to Biopython 1.56 this was a private function\n from Bio.SeqIO.SffIO import _sff_read_roche_index_xml as ReadRocheXmlManifest\n \n-#Parse Command Line\n+# Parse Command Line\n try:\n in_file, seq_format, primer_fasta, primer_type, mm, min_len, keep_negatives, out_file = sys.argv[1:]\n except ValueError:\n- sys_exit("Expected 8 arguments, got %i:\\n%s" % (len(sys.argv)-1, " ".join(sys.argv)))\n+ sys.exit("Expected 8 arguments, got %i:\\n%s" % (len(sys.argv) - 1, " ".join(sys.argv)))\n \n if in_file == primer_fasta:\n- sys_exit("Same file given as both primer sequences and sequences to clip!")\n+ sys.exit("Same file given as both primer sequences and sequences to clip!")\n if in_file == out_file:\n- sys_exit("Same file given as both sequences to clip and output!")\n+ sys.exit("Same file given as both sequences to clip and output!")\n if primer_fasta == out_file:\n- sys_exit("Same file given as both primer sequences and output!")\n+ sys.exit("Same file given as both primer sequences and output!")\n \n try:\n mm = int(mm)\n except ValueError:\n- sys_exit("Expected non-negative integer number of mismatches (e.g. 0 or 1), not %r" % mm)\n+ sys.exit("Expected non-negative integer number of mismatches (e.g. 0 or 1), not %r" % mm)\n if mm < 0:\n- sys_exit("Expected non-negtive integer number of mismatches (e.g. 0 or 1), not %r" % mm)\n-if mm not in [0,1,2]:\n+ sys.exit("Expected non-negtive integer number of mismatches (e.g. 0 or 1), not %r" % mm)\n+if mm not in [0, 1, 2]:\n raise NotImplementedError\n \n try:\n min_len = int(min_len)\n except ValueError:\n- sys_exit("Expected non-negative integer min_len (e.g. 0 or 1), not %r" % min_len)\n+ sys.exit("Expected non-negative integer min_len (e.g. 0 or 1), not %r" % min_len)\n if min_len < 0:\n- sys_exit("Expected non-negtive integer min_len (e.g. 0 or 1), not %r" % min_len)\n+ sys.exit("Expected non-negtive integer min_len (e.g. 0 or 1), not %r" % min_len)\n \n \n if keep_negatives.lower() in ["true", "yes", "on"]:\n@@ -88,7 +84,7 @@\n elif keep_negatives.lower() in ["false", "no", "off"]:\n keep_negatives = False\n else:\n- sys_exit("Expected boolean for keep_negatives (e.g. true or false), not %r" % keep_negatives)\n+ sys.exit("Expected boolean for keep_negatives (e.g. true or false), not %r" % keep_negatives)\n \n \n if primer_type.lower() == "forward":\n@@ -101,7 +97,7 @@\n forward = False\n rc = True\n else:\n- sys_exit("Expected foward, reverse or reverse-complement not %r" % primer_type)\n+ sys.exit("Expected foward, reverse or reverse-complement not %r" % primer_type)\n \n \n ambiguous_dna_values = {\n@@ -119,9 +115,9 @@\n "H": "ACTMWYH",\n "D": "AGTRWKD",\n "B": "CGTSYKB",\n- "X": ".", #faster than [GATCMRWSYKVVHDBXN] or even [GATC]\n+ "X": ".", # faster than [GATCMRWSYKVVHDBXN] or even [GATC]\n "N": ".",\n- }\n+}\n \n ambiguous_dna_re = {}\n for letter, values in ambiguous_dna_values.iteritems():\n@@ -134,39 +130,41 @@\n def make_reg_ex(seq):\n return "".join(ambiguous_dna_re[letter] for letter in seq)\n \n+\n def make_reg_ex_mm(seq, mm):\n if mm > 2:\n raise NotImplementedError("At most 2 mismatches allowed!")\n seq = seq.upper()\n yield make_reg_ex(seq)\n- for i in range(1,mm+1):\n- #Missing first/last i bases at very start/end of sequence\n- for reg in make_reg_ex_mm(seq[i:], mm-i):\n+ for i in range(1, mm + 1):\n+ # Missing first/last i bases at very start/end of sequence\n+ for reg in'..b'8 @@\n seq = str(record.seq)[left_clip:right_clip].upper()\n result = primer.search(seq)\n if result:\n- #Forward primer, take everything after it\n- #so move the left clip along\n+ # Forward primer, take everything after it\n+ # so move the left clip along\n if len(seq) - result.end() >= min_len:\n record.annotations["clip_qual_left"] = left_clip + result.end()\n clipped += 1\n@@ -231,8 +228,8 @@\n seq = str(record.seq)[left_clip:right_clip].upper()\n result = primer.search(seq)\n if result:\n- #Reverse primer, take everything before it\n- #so move the right clip back\n+ # Reverse primer, take everything before it\n+ # so move the right clip back\n new_len = result.start()\n if new_len >= min_len:\n record.annotations["clip_qual_right"] = left_clip + new_len\n@@ -246,7 +243,7 @@\n yield record\n else:\n short_neg += 1\n- \n+\n in_handle = open(in_file, "rb")\n try:\n manifest = ReadRocheXmlManifest(in_handle)\n@@ -256,7 +253,7 @@\n out_handle = open(out_file, "wb")\n writer = SffWriter(out_handle, xml=manifest)\n writer.write_file(process(SffIterator(in_handle)))\n- #End of SFF code\n+ # End of SFF code\n elif seq_format.lower().startswith("fastq"):\n in_handle = open(in_file, "rU")\n out_handle = open(out_file, "w")\n@@ -267,7 +264,7 @@\n seq = record.sequence.upper()\n result = primer.search(seq)\n if result:\n- #Forward primer, take everything after it\n+ # Forward primer, take everything after it\n cut = result.end()\n record.sequence = seq[cut:]\n if len(record.sequence) >= min_len:\n@@ -287,7 +284,7 @@\n seq = record.sequence.upper()\n result = primer.search(seq)\n if result:\n- #Reverse primer, take everything before it\n+ # Reverse primer, take everything before it\n cut = result.start()\n record.sequence = seq[:cut]\n if len(record.sequence) >= min_len:\n@@ -302,18 +299,18 @@\n writer.write(record)\n else:\n short_neg += 1\n-elif seq_format.lower()=="fasta":\n+elif seq_format.lower() == "fasta":\n in_handle = open(in_file, "rU")\n out_handle = open(out_file, "w")\n reader = fastaReader(in_handle)\n writer = fastaWriter(out_handle)\n- #Following code is identical to that for FASTQ but without editing qualities\n+ # Following code is identical to that for FASTQ but without editing qualities\n if forward:\n for record in reader:\n seq = record.sequence.upper()\n result = primer.search(seq)\n if result:\n- #Forward primer, take everything after it\n+ # Forward primer, take everything after it\n cut = result.end()\n record.sequence = seq[cut:]\n if len(record.sequence) >= min_len:\n@@ -332,7 +329,7 @@\n seq = record.sequence.upper()\n result = primer.search(seq)\n if result:\n- #Reverse primer, take everything before it\n+ # Reverse primer, take everything before it\n cut = result.start()\n record.sequence = seq[:cut]\n if len(record.sequence) >= min_len:\n@@ -347,7 +344,7 @@\n else:\n short_neg += 1\n else:\n- sys_exit("Unsupported file type %r" % seq_format)\n+ sys.exit("Unsupported file type %r" % seq_format)\n in_handle.close()\n out_handle.close()\n \n' |
b |
diff -r 1ea4bc07d303 -r 5ccb4e31510a tools/seq_primer_clip/seq_primer_clip.xml --- a/tools/seq_primer_clip/seq_primer_clip.xml Thu May 21 10:53:06 2015 -0400 +++ b/tools/seq_primer_clip/seq_primer_clip.xml Wed Feb 01 13:18:48 2017 -0500 |
b |
@@ -1,7 +1,8 @@ -<tool id="seq_primer_clip" name="Primer clip sequences" version="0.0.13"> +<tool id="seq_primer_clip" name="Primer clip sequences" version="0.0.14"> <description>Trim off 5' or 3' primers</description> <requirements> - <requirement type="package" version="1.62">biopython</requirement> + <requirement type="package" version="1.0.1">galaxy_sequence_utils</requirement> + <requirement type="package" version="1.67">biopython</requirement> <requirement type="python-module">Bio</requirement> </requirements> <stdio> @@ -14,7 +15,7 @@ seq_primer_clip.py $input_file $input_file.ext $primer_fasta $primer_type $mm $min_len $keep_negatives $output_file </command> <inputs> - <param name="input_file" type="data" format="fasta,fastq,sff" label="Sequence file to clip" description="FASTA, FASTQ, or SFF format."/> + <param name="input_file" type="data" format="fasta,fastq,sff" label="Sequence file to clip" help="FASTA, FASTQ, or SFF format."/> <param name="primer_fasta" type="data" format="fasta" label="FASTA file containing primer(s)"/> <param name="primer_type" type="select" label="Type of primers"> <option value="Forward">Forward (5') primers</option> |
b |
diff -r 1ea4bc07d303 -r 5ccb4e31510a tools/seq_primer_clip/tool_dependencies.xml --- a/tools/seq_primer_clip/tool_dependencies.xml Thu May 21 10:53:06 2015 -0400 +++ b/tools/seq_primer_clip/tool_dependencies.xml Wed Feb 01 13:18:48 2017 -0500 |
b |
@@ -1,6 +1,9 @@ <?xml version="1.0"?> <tool_dependency> - <package name="biopython" version="1.62"> - <repository changeset_revision="ac9cc2992b69" name="package_biopython_1_62" owner="biopython" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <package name="biopython" version="1.67"> + <repository changeset_revision="fc45a61abc2f" name="package_biopython_1_67" owner="biopython" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> + <package name="galaxy_sequence_utils" version="1.0.1"> + <repository changeset_revision="c38bd3fe9da6" name="package_galaxy_sequence_utils_1_0_1" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> </tool_dependency> |