diff tools/get_orfs_or_cdss/get_orfs_or_cdss.py @ 11:d51db443aaa4 draft

v0.2.3 Python 3 compatible print function.
author peterjc
date Wed, 30 May 2018 08:33:20 -0400
parents a06ad07431ba
children 71905a6d52a7
line wrap: on
line diff
--- a/tools/get_orfs_or_cdss/get_orfs_or_cdss.py	Tue May 16 09:11:27 2017 -0400
+++ b/tools/get_orfs_or_cdss/get_orfs_or_cdss.py	Wed May 30 08:33:20 2018 -0400
@@ -18,14 +18,18 @@
 See accompanying text file for licence details (MIT licence).
 """
 
+from __future__ import print_function
+
 import re
 import sys
 
 from optparse import OptionParser
 
-usage = """Use as follows:
+usage = r"""Use as follows:
 
-$ python get_orfs_or_cdss.py -i genome.fa -f fasta --table 11 -t CDS -e open -m all -s both --on cds.nuc.fa --op cds.protein.fa --ob cds.bed --og cds.gff3
+$ python get_orfs_or_cdss.py -i genome.fa -f fasta --table 11 \
+-t CDS -e open -m all -s both --on cds.nuc.fa --op cds.protein.fa \
+--ob cds.bed --og cds.gff3
 """
 
 try:
@@ -79,7 +83,7 @@
 options, args = parser.parse_args()
 
 if options.version:
-    print("v0.2.0")
+    print("v0.2.3")
     sys.exit(0)
 
 if not options.input_file:
@@ -102,8 +106,8 @@
 else:
     sys.exit("Unsupported file type %r" % options.seq_format)
 
-print "Genetic code table %i" % options.table
-print "Minimum length %i aa" % options.min_len
+print("Genetic code table %i" % options.table)
+print("Minimum length %i aa" % options.min_len)
 # print "Taking %s ORF(s) from %s strand(s)" % (mode, strand)
 
 starts = sorted(table_obj.start_codons)
@@ -283,4 +287,4 @@
 if out_bed and out_bed is not sys.stdout:
     out_bed.close()
 
-print "Found %i %ss in %i sequences" % (out_count, options.ftype, in_count)
+print("Found %i %ss in %i sequences" % (out_count, options.ftype, in_count))