Blame bcftools-1.9-python3.patch

07332ca
diff --git a/misc/guess-ploidy.py b/misc/guess-ploidy.py
07332ca
index 816a5c6..6ad3d36 100755
07332ca
--- a/misc/guess-ploidy.py
07332ca
+++ b/misc/guess-ploidy.py
07332ca
@@ -24,6 +24,8 @@
07332ca
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
07332ca
 # DEALINGS IN THE SOFTWARE.
07332ca
 
07332ca
+from __future__ import print_function
07332ca
+
07332ca
 import matplotlib as mpl
07332ca
 mpl.use('Agg')
07332ca
 import matplotlib.pyplot as plt
07332ca
@@ -33,8 +35,9 @@ import csv
07332ca
 csv.register_dialect('tab', delimiter='\t', quoting=csv.QUOTE_NONE)
07332ca
 
07332ca
 if len(sys.argv) != 3:
07332ca
-    print >> sys.stderr, 'About: Plot output of "bcftools +guess-ploidy -v"'
07332ca
-    print >> sys.stderr, 'Usage: guess-ploidy.py <guess-ploidy.out> <image-prefix>'
07332ca
+    print("""\
07332ca
+About: Plot output of "bcftools +guess-ploidy -v"
07332ca
+Usage: guess-ploidy.py <guess-ploidy.out> <image-prefix>""", file = sys.stderr)
07332ca
     sys.exit()
07332ca
 
07332ca
 prefix = sys.argv[2]
07332ca
diff --git a/misc/plot-roh.py b/misc/plot-roh.py
07332ca
index 81efaaa..90dd63e 100755
07332ca
--- a/misc/plot-roh.py
07332ca
+++ b/misc/plot-roh.py
07332ca
@@ -29,26 +29,27 @@ csv.register_dialect('tab', delimiter='\t', quoting=csv.QUOTE_NONE)
07332ca
 
07332ca
 def usage(msg=None):
07332ca
     if msg==None:
07332ca
-        print 'Usage: plot.py [OPTIONS] <dir>'
07332ca
-        print 'Options:'
07332ca
-        print '   -H, --highlight +group1,-group2       Highlight calls shared within group1 but not present in group2'
07332ca
-        print '   -i, --interactive                     Run interactively'
07332ca
-        print '   -l, --min-length <num>                Filter input regions shorter than this [0]'
07332ca
-        print '   -n, --min-markers <num>               Filter input regions with fewer marker than this [0]'
07332ca
-        print '   -o, --outfile <file>                  Output file name [plot.png]'
07332ca
-        print '   -q, --min-qual <num>                  Filter input regions with quality smaller than this [0]'
07332ca
-        print '   -r, --region [^]<chr|chr:beg-end>     Plot this chromosome/region only'
07332ca
-        print '   -s, --samples <file>                  List of samples to show, rename or group: "name[\\tnew_name[\\tgroup]]"'
07332ca
-        print '   -h, --help                            This usage text'
07332ca
-        print 'Matplotlib options:'
07332ca
-        print '   +adj, --adjust <str>          Set plot adjust [bottom=0.18,left=0.07,right=0.98]'
07332ca
-        print '   +dpi, --dpi <num>             Set bitmap DPI [150]'
07332ca
-        print '   +sxt, --show-xticks           Show x-ticks (genomic coordinate)'
07332ca
-        print '   +twh, --track-wh <num,num>    Set track width and height [20,1]'
07332ca
-        print '   +xlb, --xlabel <str>          Set x-label'
07332ca
-        print '   +xli, --xlimit <num>          Extend x-range by this fraction [0.05]'
07332ca
+        print("""\
07332ca
+Usage: plot-roh.py [OPTIONS] <dir>
07332ca
+Options:
07332ca
+   -H, --highlight +group1,-group2       Highlight calls shared within group1 but not present in group2
07332ca
+   -i, --interactive                     Run interactively
07332ca
+   -l, --min-length <num>                Filter input regions shorter than this [0]
07332ca
+   -n, --min-markers <num>               Filter input regions with fewer marker than this [0]
07332ca
+   -o, --outfile <file>                  Output file name [plot.png]
07332ca
+   -q, --min-qual <num>                  Filter input regions with quality smaller than this [0]
07332ca
+   -r, --region [^]<chr|chr:beg-end>     Plot this chromosome/region only
07332ca
+   -s, --samples <file>                  List of samples to show, rename or group: "name[\\tnew_name[\\tgroup]]"
07332ca
+   -h, --help                            This usage text
07332ca
+Matplotlib options:
07332ca
+   +adj, --adjust <str>          Set plot adjust [bottom=0.18,left=0.07,right=0.98]
07332ca
+   +dpi, --dpi <num>             Set bitmap DPI [150]
07332ca
+   +sxt, --show-xticks           Show x-ticks (genomic coordinate)
07332ca
+   +twh, --track-wh <num,num>    Set track width and height [20,1]
07332ca
+   +xlb, --xlabel <str>          Set x-label
07332ca
+   +xli, --xlimit <num>          Extend x-range by this fraction [0.05]""")
07332ca
     else:
07332ca
-        print msg
07332ca
+        print(msg)
07332ca
     sys.exit(1)
07332ca
 
07332ca
 dir          = None