Skip to content

Commit

Permalink
Update test_zoom.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoTianze committed Aug 13, 2023
1 parent 62d6e55 commit c94bee1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_zoom.py
Original file line number Diff line number Diff line change
@@ -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')

Expand All @@ -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')
dst.save('Fig. zoom.png')

0 comments on commit c94bee1

Please sign in to comment.