# HG changeset patch # User artbio # Date 1518774944 18000 # Node ID 9ce7ccd468aa63a84d507e2f719e58b1c1b23924 # Parent a8aacccd79a381f0e32afab3340e96bd29490238 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/sequence_format_converter commit dfecfb40f245a3cdb09dd1cfe37be4cb164ad2eb diff -r a8aacccd79a3 -r 9ce7ccd468aa sequence_format_converter.py --- a/sequence_format_converter.py Mon Sep 04 07:13:28 2017 -0400 +++ b/sequence_format_converter.py Fri Feb 16 04:55:44 2018 -0500 @@ -40,7 +40,7 @@ try: for l in range(4): block.append(input.readline()[:-1]) - except: + except IndexError: logging.info("File hasn't at leat four lines !") sys.exit("File hasn't at leat four lines !") input.close() @@ -81,7 +81,7 @@ if line[0] == '>': int(line.split('_')[-1]) return 'fastaw' - except: + except ValueError: return 'fasta' if line1[0] == '@' and line3[0] == '+': nucleotides = set([base for base in line2]) @@ -98,7 +98,7 @@ sys.exit('No valid format detected') try: int(line.split('\t')[-1]) - except: + except ValueError: logging.info("No valid format detected") sys.exit('No valid format detected') for nucleotide in line.split('\t')[0]: @@ -112,22 +112,22 @@ if format == 'fasta': try: self.readfasta(input) - except: + except Exception: logging.info("an error occured while reading fasta") elif format == 'fastaw': try: self.readfastaw(input) - except: + except Exception: logging.info("an error occured while reading fastaw") elif format == 'tabular': try: self.readtabular(input) - except: + except Exception: logging.info("an error occured while reading tabular") elif format == 'fastq': try: self.readfastq(input) - except: + except Exception: logging.info("an error occured while reading fastq") else: logging.info("no valid format detected") diff -r a8aacccd79a3 -r 9ce7ccd468aa sequence_format_converter.xml --- a/sequence_format_converter.xml Mon Sep 04 07:13:28 2017 -0400 +++ b/sequence_format_converter.xml Fri Feb 16 04:55:44 2018 -0500 @@ -1,10 +1,19 @@ - + '${input}.tmp'; + python '$__tool_directory__'/sequence_format_converter.py + --input '${input}.tmp' + --output '$output' + --format '$output_format'; + rm '${input}.tmp'; + #else: python '$__tool_directory__'/sequence_format_converter.py --input '$input' --output '$output' --format '$output_format' + #end if ]]> @@ -79,6 +88,24 @@ + + + + + + + + + + + + + + + + + + diff -r a8aacccd79a3 -r 9ce7ccd468aa test-data/input.fastqsanger.gz Binary file test-data/input.fastqsanger.gz has changed