def test_plot_heterozygous_haplotypes(self): heterozygous = haplotyper.Zygosity.HET haplotype_wrapper = genotyper.process(self.vcf_path, self.chrom, self.parental_sample, self.phase, heterozygous) plotter = hplot.Plotter(haplotype_wrapper) user_conf = list(["show=False", "xtickslabels=False", "size_y=5"]) plotter.plot_haplotypes(override_conf=user_conf)
def test_generate_homozygous_yticks(self): homozygous = haplotyper.Zygosity.HOM haplotype_wrapper = genotyper.process(self.vcf_path, self.chrom, self.parental_sample, self.phase, homozygous) plotter = hplot.Plotter(haplotype_wrapper) labels = plotter.get_ytickslabels() logger.debug("Parent: {parent}".format(parent=self.parental_sample)) logger.debug(labels)
def main(): args = parse_args() haplotype_wrapper = genotyper.process(args.vcf, args.chr, args.parental, args.phase, haplotyper.Zygosity[args.zygosis]) plotter = hplot.Plotter(haplotype_wrapper) plotter.plot_haplotypes(output_file=args.output, override_conf=args.conf) if args.phase: writer.save_phased_variants(haplotype_wrapper, args.vcf)
def test_genotype_filtering(self): haplotype_wrapper = genotyper.process(self.vcf_one_chr_path, self.chrom, self.parental_sample, self.phase, Zygosity.HOM) genotypes_uc_len = len(haplotype_wrapper.genotypes) variants_uc_len = len(haplotype_wrapper.variants) logger.debug( "Length genotypes: {length}".format(length=genotypes_uc_len)) logger.debug( "Length variants: {length}".format(length=variants_uc_len)) assert genotypes_uc_len == variants_uc_len
def test_plot_homozygous_haplotypes(self): homozygous = haplotyper.Zygosity.HOM haplotype_wrapper = genotyper.process(self.vcf_path, self.chrom, self.parental_sample, self.phase, homozygous) plotter = hplot.Plotter(haplotype_wrapper) ytickslabels = plotter.get_ytickslabels() custom_config = hplot.PlotConfig( title="Parental '{parent}' in '{chrom}'".format( parent=self.parental_sample, chrom=self.chrom), xtickslabels=plotter.get_xtickslabels(), ytickslabels=ytickslabels, start=0, end=1000, size_x=10, size_y=len(ytickslabels) * .2, show=True) plotter.plot_haplotypes(custom_config)
def test_save_phased_variants(self): haplotype_wrapper = genotyper.process(self.vcf_one_chr_path, self.chrom, self.parental_sample, True, Zygosity.HOM) assert haplotype_wrapper writer.save_phased_variants(haplotype_wrapper, self.vcf_one_chr_path)
def test_genotype_n_variants(self): haplotype_wrapper = genotyper.process(self.vcf_one_chr_path, self.chrom, self.parental_sample, self.phase, Zygosity.HOM) assert haplotype_wrapper