# HG changeset patch # User artbio # Date 1501103528 14400 # Node ID 7c913274e22a5b7ef6a5d9b0e313dfdec2b2118e # Parent ad6b978daa2e82d32d94687bb2e1b9d6ab9d1b38 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/yac_clipper commit 7edb6f8c9744ec9bccee42aecf80207f0984330c diff -r ad6b978daa2e -r 7c913274e22a yac.py --- a/yac.py Wed Jul 26 13:35:39 2017 -0400 +++ b/yac.py Wed Jul 26 17:12:08 2017 -0400 @@ -2,11 +2,8 @@ # yac = yet another clipper # v 1.2.1 - 23-08-2014 - Support FastQ output # v 1.1.0 - 23-08-2014 - argparse implementation -# Usage yac.py $input $output $adapter_to_clip $min $max $Nmode # Christophe Antoniewski -import sys -import string import argparse from itertools import islice @@ -16,17 +13,23 @@ the_parser.add_argument( '--input', action="store", nargs='+', help="input fastq files") the_parser.add_argument( - '--output', action="store", type=str, help="output, clipped fasta file") + '--output', action="store", type=str, + help="output, clipped fasta file") the_parser.add_argument( - '--output_format', action="store", type=str, help="output format, fasta or fastq") + '--output_format', action="store", type=str, + help="output format, fasta or fastq") the_parser.add_argument( - '--adapter_to_clip', action="store", type=str, help="adapter sequence to clip") + '--adapter_to_clip', action="store", type=str, + help="adapter sequence to clip") the_parser.add_argument( - '--min', action="store", type=int, help="minimal size of clipped sequence to keep") + '--min', action="store", type=int, + help="minimal size of clipped sequence to keep") the_parser.add_argument( - '--max', action="store", type=int, help="maximal size of clipped sequence to keep") + '--max', action="store", type=int, + help="maximal size of clipped sequence to keep") the_parser.add_argument('--Nmode', action="store", type=str, choices=[ - "accept", "reject"], help="accept or reject sequences with N for clipping") + "accept", "reject"], + help="accept or reject Ns in clipped sequences") args = the_parser.parse_args() args.adapter_to_clip = args.adapter_to_clip.upper() return args @@ -34,7 +37,8 @@ class Clip: - def __init__(self, inputfile, outputfile, output_format, adapter, minsize, maxsize, Nmode): + def __init__(self, inputfile, outputfile, output_format, + adapter, minsize, maxsize, Nmode): self.inputfile = inputfile self.outputfile = outputfile self.output_format = output_format @@ -44,9 +48,12 @@ self.Nmode = Nmode def motives(sequence): - '''return a list of motives for perfect (6nt) or imperfect (7nt with one mismatch) search on import string module''' + ''' + return a list of motives for perfect (6nt) or + imperfect (7nt with one mismatch) search on import string module + ''' sequencevariants = [ - sequence[0:6]] # initializes the list with the 6mer perfect match + sequence[0:6]] # initializes list with 6mer perfect match dicsubst = {"A": "TGCN", "T": "AGCN", "G": "TACN", "C": "GATN"} for pos in enumerate(sequence[:6]): for subst in dicsubst[pos[1]]: @@ -100,6 +107,7 @@ instanceClip = Clip(*argv) instanceClip.handle_io() + if __name__ == "__main__": args = Parser() id = 0 diff -r ad6b978daa2e -r 7c913274e22a yac.xml --- a/yac.xml Wed Jul 26 13:35:39 2017 -0400 +++ b/yac.xml Wed Jul 26 17:12:08 2017 -0400 @@ -1,4 +1,4 @@ - + yac.py --input $input --output $output @@ -14,7 +14,7 @@ - + @@ -39,9 +39,9 @@ - + - + @@ -92,4 +92,5 @@ A fastq or fasta file containing clipped sequences satisfying the selected criteria. +