Mercurial > repos > blankenberg > naive_variant_caller
comparison tools/naive_variant_caller.py @ 12:ac0235d2d459 draft
planemo upload for repository https://github.com/blankenberg/tools-blankenberg/tree/master/tools/naive_variant_caller commit ce964ed3ab7e390754fa03bb32a593fbe79dcf04
author | blankenberg |
---|---|
date | Thu, 17 Sep 2015 14:56:15 -0400 |
parents | d5f866df45ae |
children |
comparison
equal
deleted
inserted
replaced
11:8af4e7a4d041 | 12:ac0235d2d459 |
---|---|
1 #!/usr/bin/env python | |
1 #Dan Blankenberg | 2 #Dan Blankenberg |
2 import sys | 3 import sys |
3 import optparse | 4 import optparse |
4 | 5 |
5 from pyBamParser.bam import Reader | 6 from pyBamParser.bam import Reader |
6 from pyBamTools.genotyping.naive import VCFReadGroupGenotyper | 7 from pyBamTools.genotyping.naive import VCFReadGroupGenotyper, PROGRAM_NAME, PROGRAM_VERSION |
7 | 8 |
8 def main(): | 9 def main(): |
9 #Parse Command Line | 10 #Parse Command Line |
10 parser = optparse.OptionParser() | 11 parser = optparse.OptionParser() |
11 parser.add_option( '-b', '--bam', dest='bam_file', action='append', type="string", default=[], help='BAM filename, optionally index filename. Multiple allowed.' ) | 12 parser.add_option( '-b', '--bam', dest='bam_file', action='append', type="string", default=[], help='BAM filename, optionally index filename. Multiple allowed.' ) |
20 parser.add_option( '-m', '--min_mapping_quality', dest='min_mapping_quality', action='store', type="int", default=None, help='Minimum mapping.' ) | 21 parser.add_option( '-m', '--min_mapping_quality', dest='min_mapping_quality', action='store', type="int", default=None, help='Minimum mapping.' ) |
21 parser.add_option( '-t', '--coverage_dtype', dest='coverage_dtype', action='store', type="string", default=None, help='dtype to use for coverage array' ) | 22 parser.add_option( '-t', '--coverage_dtype', dest='coverage_dtype', action='store', type="string", default=None, help='dtype to use for coverage array' ) |
22 parser.add_option( '--allow_out_of_bounds_positions', dest='allow_out_of_bounds_positions', action='store_true', default = False, help='Allows out of bounds positions to not throw fatal errors' ) | 23 parser.add_option( '--allow_out_of_bounds_positions', dest='allow_out_of_bounds_positions', action='store_true', default = False, help='Allows out of bounds positions to not throw fatal errors' ) |
23 parser.add_option( '--safe', dest='safe', action='store_true', default = False, help='Perform checks to prevent certain errors. Is slower.' ) | 24 parser.add_option( '--safe', dest='safe', action='store_true', default = False, help='Perform checks to prevent certain errors. Is slower.' ) |
24 parser.add_option( '--region', dest='region', action='append', type="string", default=[], help='region' ) | 25 parser.add_option( '--region', dest='region', action='append', type="string", default=[], help='region' ) |
26 parser.add_option( '', '--version', dest='version', action='store_true', default = False, help='Report version and quit' ) | |
25 (options, args) = parser.parse_args() | 27 (options, args) = parser.parse_args() |
28 | |
29 if options.version: | |
30 print "%s version %s" % ( PROGRAM_NAME, PROGRAM_VERSION ) | |
31 sys.exit(0) | |
26 | 32 |
27 if len( options.bam_file ) == 0: | 33 if len( options.bam_file ) == 0: |
28 print >>sys.stderr, 'You must provide at least one bam (-b) file.' | 34 print >>sys.stderr, 'You must provide at least one bam (-b) file.' |
29 parser.print_help( sys.stderr ) | 35 parser.print_help( sys.stderr ) |
30 sys.exit( 1 ) | 36 sys.exit( 1 ) |