def plot5(sg, tids, locs, edges): sg.plot_transcript_path('ENST04') swan.save_fig('scratch/enst04.png') check_subset(sg, tids, edges, locs) node_colors_ctrl = [(0, 'gray_light_blue'), (1, 'gray_yellow'), (2, 'light_blue'), (3, 'yellow'), (4, 'yellow'), (5, 'orange'), (6, 'gray_orange')] curve_ctrl = [((0, 1), None), ((1, 2), None), ((2, 3), None), ((3, 4), None), ((4, 5), None), ((0, 3), 'curved'), ((4, 6), 'curved'), ((1, 4), 'curved')] edge_color_ctrl = [((0, 1), 'gray_green'), ((1, 2), 'gray_pink'), ((2, 3), 'green'), ((3, 4), 'pink'), ((4, 5), 'green'), ((0, 3), 'gray_green'), ((4, 6), 'gray_green'), ((1, 4), 'gray_pink')] used_edges = [(2, 3), (3, 4), (4, 5)] check_nodes(sg.pg.loc_df, node_colors_ctrl) check_edges(sg.pg.edge_df, edge_color_ctrl, curve_ctrl) return sg
def plot6(sg, tids, locs, edges): sg.plot_graph('ENSG02', indicate_dataset='a') swan.save_fig('scratch/ensg02_dataset') check_subset(sg, tids, edges, locs) edgecolor_ctrl = [(0, 'k'), (1, 'k'), (2, None), (3, 'k'), (4, 'k'), (5, 'k'), (6, 'k')] node_colors_ctrl = [(0, 'light_blue'), (1, 'yellow'), (2, 'light_blue'), (3, 'yellow'), (4, 'yellow'), (5, 'orange'), (6, 'orange')] curve_ctrl = [((0, 1), None), ((1, 2), None), ((2, 3), None), ((3, 4), None), ((4, 5), None), ((0, 3), 'curved'), ((4, 6), 'curved'), ((1, 4), 'curved')] edge_color_ctrl = [((0, 1), 'green'), ((1, 2), 'pink'), ((2, 3), 'green'), ((3, 4), 'pink'), ((4, 5), 'green'), ((0, 3), 'green'), ((4, 6), 'green'), ((1, 4), 'pink')] style_ctrl = [((0, 1), 'dashed'), ((1, 2), None), ((2, 3), None), ((3, 4), 'dashed'), ((4, 5), 'dashed'), ((0, 3), 'dashed'), ((4, 6), 'dashed'), ((1, 4), 'dashed')] check_nodes(sg.pg.loc_df, node_colors_ctrl, edgecolor_ctrl) check_edges(sg.pg.edge_df, edge_color_ctrl, curve_ctrl, style_ctrl) return sg
def plot4(sg, tids, locs, edges): sg.plot_transcript_path('ENST01', indicate_novel=True) swan.save_fig('scratch/ENST01_novel.png') check_subset(sg, tids, edges, locs) node_colors_ctrl = [(0, 'light_blue'), (1, 'yellow'), (2, 'yellow'), (3, 'yellow'), (4, 'yellow'), (5, 'orange'), (6, 'gray_orange')] edgecolor_ctrl = [(0, None), (1, None), (2, None), (3, None), (4, None), (5, None), (6, '#999999')] curve_ctrl = [((0, 1), None), ((1, 2), None), ((2, 3), None), ((3, 4), None), ((4, 5), None), ((0, 3), 'curved'), ((4, 6), 'curved'), ((1, 4), 'curved')] edge_color_ctrl = [((0, 1), 'green'), ((1, 2), 'pink'), ((2, 3), 'green'), ((3, 4), 'pink'), ((4, 5), 'green'), ((0, 3), 'gray_green'), ((4, 6), 'gray_green'), ((1, 4), 'gray_pink')] style_ctrl = [((0, 1), None), ((1, 2), None), ((2, 3), None), ((3, 4), None), ((4, 5), None), ((0, 3), None), ((4, 6), 'dashed'), ((1, 4), 'dashed')] used_edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)] check_nodes(sg.pg.loc_df, node_colors_ctrl, edgecolor_ctrl) check_edges(sg.pg.edge_df, edge_color_ctrl, curve_ctrl, style_ctrl) return sg
# returns a list of genes, transcripts, and specific edges in # the SwanGraph with novel exon skipping events es_genes, es_transcripts, es_edges = sg.find_es_genes() # returns a list of genes, transcripts, and specific edges in # the SwanGraph with novel intron retention events ir_genes, ir_transcripts, ir_edges = sg.find_ir_genes() ### Visualization # plot a gene summary graph sg.plot_graph('ADRM1') # save the currently-plotted figure with the given filename and location swan.save_fig('figures/my_gene_summary.png') # plot a gene summary graph with novel splice sites and # splice junctions plotted as outlined nodes and dashed edges respectively sg.plot_graph('ADRM1', indicate_novel=True) # plot a gene summary graph with splice sites and splice junctions # that are present in the indicated dataset as outlined nodes # and dashed edges respectively sg.plot_graph('ADRM1', indicate_dataset='HepG2_1') # plot a gene summary graph with novel splice sites and junctions # outlined and dashed respectively # save the figure with the given prefix sg.plot_graph('ADRM1', indicate_novel=True, prefix='figures/adrm1')