code: def freebayes(args):
      
      p = OptionParser(freebayes.__doc__)
      p.add_option("--mindepth", default=3, type="int",
                   help="Minimum depth [default: %default]")
      p.add_option("--minqual", default=20, type="int",
                   help="Minimum quality [default: %default]")
      opts, args = p.parse_args(args)
  
      if len(args) < 2:
          sys.exit(not p.print_help())
  
      prefix, ref = args[0:2]
      bams = args[2:]
      cmd = "bamaddrg -R {0}"
      cmd += " " + " ".join("-b {0}".format(x) for x in bams)
      fmd = "freebayes --stdin -C {0} -f {1}".format(opts.mindepth, ref)
      seqids = list(Fasta(ref).iterkeys_ordered())
      for s in seqids:
          outfile = prefix + ".{0}.vcf".format(s)
          print(cmd.format(s), "|", fmd + " -r {0} -v {1}".format(s, outfile))
docs: %prog freebayes prefix ref.fa *.bam
  
      Call SNPs using freebayes.