Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate summary of assembly graph visuals #4

Open
matinnuhamunada opened this issue Apr 23, 2022 · 0 comments
Open

Generate summary of assembly graph visuals #4

matinnuhamunada opened this issue Apr 23, 2022 · 0 comments

Comments

@matinnuhamunada
Copy link
Owner

from pathlib import Path
import matplotlib.pyplot as plt

def draw_graph_summary(input_dir, outfile):
    assembly_graphs = Path(input_dir)
    title_dict = {0 : "A_flye",
                  1: "B_minipolish",
                  2: "C_raven",
                  3: "D_flye",
                  4: "E_minipolish",
                  5: "F_raven",
                  6: "G_flye",
                  7: "H_minipolish",
                  8: "I_raven",
                  9: "J_flye",
                  10: "K_minipolish",
                  11: "L_raven",
                 }
    images = [plt.imread(s) for s in assembly_graphs.glob("*.png")]
    plt.figure(figsize=(18,24))
    columns = 3
    for i, image in enumerate(images):
        plt.subplot(int(len(images) / columns + 1), columns, i + 1)
        plt.title(title_dict[i], fontsize=10)
        plt.axis('off')
        plt.imshow(image)
    plt.savefig(outfile)
    return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant