# HG changeset patch # User peterjc # Date 1550849176 18000 # Node ID e61d180e8debef743d9a855e0d5aff867d0cc544 # Parent 67bababc1f8870d69beb14f8ecfced500ed280c0 planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/seq_rename commit d67596914a7bbe183851437eaafe8c7305877e5a-dirty diff -r 67bababc1f88 -r e61d180e8deb tools/seq_rename/seq_rename.py --- a/tools/seq_rename/seq_rename.py Fri Nov 09 11:12:10 2018 -0500 +++ b/tools/seq_rename/seq_rename.py Fri Feb 22 10:26:16 2019 -0500 @@ -34,9 +34,11 @@ try: tabular_file, old_col_arg, new_col_arg, in_file, seq_format, out_file = sys.argv[1:] except ValueError: - sys.exit("Expected six arguments (tabular file, old col, new col, " - "input file, format, output file), got %i:\n%s" - % (len(sys.argv) - 1, " ".join(sys.argv))) + sys.exit( + "Expected six arguments (tabular file, old col, new col, " + "input file, format, output file), got %i:\n%s" + % (len(sys.argv) - 1, " ".join(sys.argv)) + ) try: if old_col_arg.startswith("c"): @@ -77,11 +79,15 @@ old = parts[old_col].strip().split(None, 1) new = parts[new_col].strip().split(None, 1) if not old_warn and len(old) > 1: - old_warn = "WARNING: Some of your old identifiers had white space in them, " + \ - "using first word only. e.g.:\n%s\n" % parts[old_col].strip() + old_warn = ( + "WARNING: Some of your old identifiers had white space in them, " + + "using first word only. e.g.:\n%s\n" % parts[old_col].strip() + ) if not new_warn and len(new) > 1: - new_warn = "WARNING: Some of your new identifiers had white space in them, " + \ - "using first word only. e.g.:\n%s\n" % parts[new_col].strip() + new_warn = ( + "WARNING: Some of your new identifiers had white space in them, " + + "using first word only. e.g.:\n%s\n" % parts[new_col].strip() + ) yield old[0], new[0] handle.close() if old_warn: @@ -133,13 +139,17 @@ in_handle.close() else: # Use Galaxy for FASTA, QUAL or FASTQ - if seq_format.lower() in ["fasta", "csfasta"] or seq_format.lower().startswith("qual"): + if seq_format.lower() in ["fasta", "csfasta"] or seq_format.lower().startswith( + "qual" + ): from galaxy_utils.sequence.fasta import fastaReader, fastaWriter + reader = fastaReader(open(in_file, "rU")) writer = fastaWriter(open(out_file, "w")) marker = ">" elif seq_format.lower().startswith("fastq"): from galaxy_utils.sequence.fastq import fastqReader, fastqWriter + reader = fastqReader(open(in_file, "rU")) writer = fastqWriter(open(out_file, "w")) marker = "@" diff -r 67bababc1f88 -r e61d180e8deb tools/seq_rename/tool_dependencies.xml --- a/tools/seq_rename/tool_dependencies.xml Fri Nov 09 11:12:10 2018 -0500 +++ b/tools/seq_rename/tool_dependencies.xml Fri Feb 22 10:26:16 2019 -0500 @@ -1,9 +1,9 @@ - + - + - + - + \ No newline at end of file