# HG changeset patch # User drosofff # Date 1458948580 14400 # Node ID 330dd8a8c31aff214767e3b0a2dd280ae3c49d06 # Parent 2f7278120be93a1919e3f81e76afb7b281162e76 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/msp_fasta_tabular_converter commit 030207144f0811822dbdda9a10e036ff8e794d7c diff -r 2f7278120be9 -r 330dd8a8c31a fasta_tabular_converter.py --- a/fasta_tabular_converter.py Tue Mar 22 18:54:00 2016 -0400 +++ b/fasta_tabular_converter.py Fri Mar 25 19:29:40 2016 -0400 @@ -26,7 +26,9 @@ stringlist=[] else: stringlist.append(line[:-1]) - seqdic["".join(stringlist)] += 1 # for the last sequence + try: + seqdic["".join(stringlist)] += 1 # for the last sequence + except: pass # in case file to convert is empty F.close() F = open(tabular, "w") for seq in sorted(seqdic, key=seqdic.get, reverse=True): @@ -105,4 +107,4 @@ if __name__ == "__main__": seqdic = defaultdict(int) args = Parser() - main (args.input, args.output, args.type) \ No newline at end of file + main (args.input, args.output, args.type)