import genomenotebook as gn
import os
Multi genbank and stacking
Plotting a linked stack of contigs
colored_genbank.gb
is a genbank file with four identical contigs. Plotting the contigs as a GenomeStack links the x-axes.
= gn.get_example_data_dir()
data_path = os.path.join(data_path, "colored_genbank.gb")
gb_path = gn.GenomeStack.from_genbank(gb_path,
g =700,
width=True,
show_seq=False,
search=["CDS", "Domainator"],
feature_types="Color",
color_attribute=0,
label_angle=True,
show_labels=0.15,
feature_height=-0.15,
label_vertical_offset="left",
label_justify= 5,
label_horizontal_offset =gn.get_default_glyphs(box_colors=("Cyan",)),
glyphs={"CDS":"gene_id","Domainator":"name"},
feature_name=True)
z_stack g.show()
Additional examples of plotting stacks of contigs
= gn.get_example_data_dir()
data_path = os.path.join(data_path, "MT_nbs.gb")
gb_path = gn.GenomeStack.from_genbank(gb_path,
g =700,
width=True,
show_seq=False,
search=["source", "CDS", "Domainator", "Domain_Search"],
feature_types="Color",
color_attribute=0,
label_angle=True,
show_labels=0.15,
feature_height=-0.15,
label_vertical_offset="left",
label_justify= 5,
label_horizontal_offset =gn.get_default_glyphs(arrow_colors=("grey",), box_colors=("Cyan",)),
glyphs={"CDS":"gene_id","Domainator":"name", "Domain_Search":"name"},
feature_name=True) #, "Domainator", "Domain_Search"
z_stack g.show()