distSquareMatrix = dist.squareform(distMatrix) linkageMatrix = hier.linkage(distMatrix,method='ward') dendro = hier.dendrogram(linkageMatrix) leaves2 = dendro['leaves'] transformedData = transformedData[:,leaves2] ##### leaves1 for the mutations sites ##### leaves2 for the taxa fig_ = plt.figure(figsize=(6,6)) ax_ = fig_.add_subplot(111) cax_ = ax_.matshow(transformedData,cmap='Blues',aspect="auto") ax_.set_ylabel('Cells') ax_.set_xlabel('Genomic Positions') # fig_.colorbar(cax_) fig_.savefig(out_path+"hier_clust_heatmap.png", dpi=1200) ########################################################################### ######################## Generate the VCF output ########################## ########################################################################### VCF.gen_VCF(out_dir=out_path, genotype_mat=mat_, read_count_mat_=read_counts, chrs=chroms, posits=positions, alt_counts=alts, rfs=refs, ids=names, dps=depths) ################################################################################### ######################## Generate Perfect Phylogeny Newick ######################## ################################################################################### if K_==0: Phylo_module.gen_Newick(genotype=mat_, PerfectPhy_path=PerfectPhy_path_, out_dir_path=out_path, names_=names)