diff --git a/tests/test_zoom.py b/tests/test_zoom.py index c4553e3..759417a 100644 --- a/tests/test_zoom.py +++ b/tests/test_zoom.py @@ -1,11 +1,11 @@ -from plotnine import ggplot, coord_fixed, ggtitle, theme, element_text, scale_x_continuous -from plotnineseqsuite.align import geom_alignedSeq, theme_seq, extract +from plotnine import ggplot, coord_fixed, ggtitle, scale_x_continuous +from plotnineseqsuite import geom_alignedSeq, theme_seq, extract from math import floor, ceil seqs = ['TTGTGAAAGAC', 'AAGTAAACTAA', 'TAATAAACAAA', 'TAATAAACAAA', 'CTGTAAATATT', 'TAGAAAGGTAT'] result = extract(seqs, start=1, end=4) -a=ggplot() + geom_alignedSeq(data=seqs) + coord_fixed() + theme_seq()+ggtitle('Completed sequences') + theme(plot_title=element_text(size=30, ha='left')) -b=ggplot() + geom_alignedSeq(data=result) + scale_x_continuous(breaks=lambda x: range(floor(x[0]), ceil(x[1])), labels=lambda x:x+1, expand=(0,0)) + coord_fixed() + theme_seq()+ggtitle('Fragmented sequences') + theme(plot_title=element_text(size=30, ha='left')) +a=ggplot() + geom_alignedSeq(data=seqs) + coord_fixed() + theme_seq()+ggtitle('Completed sequences') +b=ggplot() + geom_alignedSeq(data=result) + scale_x_continuous(breaks=lambda x: range(floor(x[0]), ceil(x[1])), labels=lambda x: range(x[0]+1, x[0]+1+len(x)), expand=(0,0)) + coord_fixed() + theme_seq()+ggtitle('Fragmented sequences') a.save('Fig. complete.png') b.save('Fig. fragment.png') @@ -19,4 +19,4 @@ dst = Image.new('RGB', (a_width+b_width, b_height), color='white') dst.paste(a_pic, (0, 0)) dst.paste(b_pic, (a_width, 0)) -dst.save('Fig. zoom.png') \ No newline at end of file +dst.save('Fig. zoom.png')