def call_variant_gatk_hc(bam, orig_genome_path, bed, conf=None): vcfoutput = "output-hc.vcf" err = open("/dev/null") no_et = "" try: no_et = " -et NO_ET -K " + conf.get("main", "gatk_no_et") except: pass cmd = ( "java -Xmx1g -Djava.io.tmpdir=. -jar " + conf.get("main", "gatk_path") + " -T HaplotypeCaller " + no_et + " -R " + orig_genome_path + " -I " + bam + " -L " + bed + " -o " + vcfoutput ) subprocess.check_output(cmd, shell=True, stderr=err) err.close() return util.compress_vcf(vcfoutput, conf)
def call_variant_gatk_hc(bam, genome, bed, conf=None): vcfoutput = "output-hc.vcf" cmd='''java -Xmx1g -Djava.io.tmpdir=. -jar {gatk} -T HaplotypeCaller -R {genome} -I {bam} -U ALLOW_SEQ_DICT_INCOMPATIBILITY \ -L {bed} -o {vcfoutput}''' cmd = cmd.format(gatk=conf.get('main', 'gatk'), genome=genome, bam=bam, bed=bed, vcfoutput=vcfoutput) subprocess.check_call(cmd, stdout=open('/dev/null'), stderr=subprocess.STDOUT, shell=True) return util.compress_vcf(vcfoutput, conf)
def call_variant_gatk_hc_emit_all(bam, genome, bed, conf=None): vcfoutput = "output-hc.vcf" no_et = "" try: no_et = " -et NO_ET -K " + conf.get('main', 'gatk_no_et') except: pass cmd="java -Xmx1g -Djava.io.tmpdir=. -jar " + conf.get('main', 'gatk') + " -T HaplotypeCaller -stand_emit_conf 1.0 " + no_et + " -R " + genome +" -I " + bam + " -U ALLOW_SEQ_DICT_INCOMPATIBILITY -L " + bed + " -o " + vcfoutput subprocess.check_call(cmd, stdout=open('/dev/null'), stderr=subprocess.STDOUT) return util.compress_vcf(vcfoutput, conf)
def call_variant_gatk_ug(bam, genome, bed, conf=None): vcfoutput = "output-ug.vcf" no_et = "" try: no_et = " -et NO_ET -K " + conf.get('main', 'gatk_no_et') except: pass cmd="java -Xmx1g -Djava.io.tmpdir=. -jar " + conf.get('main', 'gatk') + " -T UnifiedGenotyper -glm BOTH " + no_et + " -R " + genome +" -I " + bam + " -L " + bed + " -o " + vcfoutput subprocess.check_call(cmd, stdout=open('/dev/null'), stderr=subprocess.STDOUT) return util.compress_vcf(vcfoutput, conf)
def call_wecall(bam, orig_genome_path, bed, conf=None): vcfoutput = "output-wc.vcf" cmd = ( conf.get("main", "wecall_path") + " --refFile " + orig_genome_path + " --inputs " + bam + " --regions " + bed + " --output " + vcfoutput ) subprocess.check_call(cmd, shell=True) return util.compress_vcf(vcfoutput, conf)
def call_variant_platypus(bam, orig_genome_path, bed, conf=None): vcfoutput = "output-platypus.vcf" cmd = ( "python " + conf.get("main", "platypus_path") + " callVariants --refFile " + orig_genome_path + " --bamFiles " + bam + " --regions " + bed + " -o " + vcfoutput ) subprocess.check_call(cmd, shell=True) return util.compress_vcf(vcfoutput, conf)
def call_variant_fb_minrepeatentropy(bam, orig_genome_path, bed, conf=None): vcfoutput = "output-fb.vcf" cmd = [ conf.get("main", "freebayes_path"), "-f", orig_genome_path, "--min-repeat-entropy", "1", "-t", bed, "-b", bam, "-v", vcfoutput, ] subprocess.check_output(cmd) return util.compress_vcf(vcfoutput, conf)
def call_variant_sentieon_hc(bam, genome, bed, conf=None): vcfoutput = "output-sentieonhc.vcf" cmd='{sentieon} driver -r {genome} -i {bam} --algo Haplotyper {vcfoutput}' cmd=cmd.format(sentieon=conf.get('main', 'sentieon'), genome=genome, bam=bam, vcfoutput=vcfoutput) subprocess.check_call(cmd, stdout=open('/dev/null'), stderr=subprocess.STDOUT, shell=True) return util.compress_vcf(vcfoutput, conf)
def call_wecall(bam, genome, bed, conf=None): vcfoutput = "output-wc.vcf" cmd=conf.get('main', 'wecall') + " --refFile " + genome + " --inputs " + bam + " --regions " + bed + " --output " + vcfoutput subprocess.check_call(cmd, stdout=open('/dev/null')) return util.compress_vcf(vcfoutput, conf)
def call_variant_platypus(bam, genome, bed, conf=None): vcfoutput = "output-platypus.vcf" cmd= "python " + conf.get('main', 'platypus') + " callVariants --refFile " + genome + " --bamFiles " + bam + " --regions " + bed + " -o " + vcfoutput subprocess.check_call(cmd, stdout=open('/dev/null')) return util.compress_vcf(vcfoutput, conf)
def call_variant_fb_minrepeatentropy(bam, genome, bed, conf=None): vcfoutput = "output-fb.vcf" cmd=[conf.get('main', 'freebayes'), "-f", genome, "--no-partial-observations", "--min-repeat-entropy", "1", "-t", bed, "-b", bam, "-v", vcfoutput] subprocess.check_call(cmd, stdout=open('/dev/null')) sorted_vcf = util.sort_vcf(vcfoutput, conf) return util.compress_vcf(sorted_vcf, conf)
def call_variant_fb(bam, genome, bed, conf=None): vcfoutput = "output-fb.vcf" cmd=[conf.get('main', 'freebayes'), "-f", genome, "-t", bed, "-b", bam, "-v", vcfoutput] subprocess.check_call(cmd, stdout=open('/dev/null')) sorted_vcf = util.sort_vcf(vcfoutput, conf) return util.compress_vcf(sorted_vcf, conf)
def call_variant_platypus_asm(bam, genome, bed, conf=None): vcfoutput = "output-platypus.vcf" cmd= "python " + conf.get('main', 'platypus') + " callVariants --assemble=1 --assembleBadReads=1 --refFile " + genome + " --bamFiles " + bam + " --regions " + bed + " -o " + vcfoutput subprocess.check_call(cmd) return util.compress_vcf(vcfoutput, conf)