Skip to content

Commit

Permalink
update for revised paper
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoTianze committed Aug 13, 2023
1 parent c94bee1 commit 30975dd
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 144 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ See [plotnineSeqSuite Documentation](https://caotianze.github.io/plotnineseqsuit
PyCharm 2022.1 (Community Edition) and Spyder version: 5.4.1 (conda)
## Dependencies
Python version: 3.10.9 64-bit
plotnine: 0.10.1
plotnine: 0.12.2
## Similar projects
R package [ggmsa](https://github.com/YuLab-SMU/ggmsa) and [ggseqlogo](https://github.com/omarwagih/ggseqlogo)
12 changes: 12 additions & 0 deletions compare/test_ggmsa.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
library(ggseqlogo)
library(Biostrings)
data(ggseqlogo_sample)
library(ggplot2)
library(ggmsa)
aastr=seqs_aa[['CSNK2A2']]
names(aastr)=1:80
seqstr = AAStringSet(aastr)

A=seqlogo(seqstr, adaptive = TRUE)+ggtitle('C')
A=A+theme(panel.grid=element_blank(),panel.background=element_rect(fill='white',color=NA),plot.background=element_rect(fill='white',color=NA),axis.ticks.x=element_blank())
ggsave('Fig. 3C.png',width=7,height=7,dpi=300)
7 changes: 7 additions & 0 deletions compare/test_ggseqlogo.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
library(ggplot2)
library(ggseqlogo)
data(ggseqlogo_sample)

A=ggplot() + geom_logo(seqs_aa[['CSNK2A2']], method = 'probability', col_scheme='chemistry')+ggtitle('B')+guides(fill=FALSE)
A=A+theme(panel.grid=element_blank(),panel.background=element_rect(fill='white'),axis.ticks.x=element_blank())
ggsave('Fig. 3B.png',width=7,height=7,dpi=300)
8 changes: 8 additions & 0 deletions compare/test_plotnineSeqSuite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from plotnine import ggplot, ggtitle, theme, guides, element_blank, element_rect
from plotnineseqsuite.data import seqs_aa
from plotnineseqsuite.logo import geom_logo

A=ggplot() + geom_logo(seqs_aa['CSNK2A2'], method='probability', col_scheme='chemistry') + ggtitle('A')+ guides(fill=False)
A=A+theme(panel_grid=element_blank(),panel_background=element_rect(fill='white'),axis_ticks_major_x=element_blank())

A.save("Fig. 3A.png",width=7,height=7,dpi=300)
3 changes: 2 additions & 1 deletion plotnineseqsuite/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ def __radd__(self, gg):
mapping=aes(x='x', y='y', width='width', height='height', fill='group'),
**self.__kwargs)
params.append(bg_layer)
params.append(self.colscale_opts)
if self.letter_data is not None:
letter_layer = geom_polygon(data=self.letter_data, mapping=aes(x='x', y='y', group='group_by'),
fill=self.__font_col, **self.__kwargs)
params.append(letter_layer)
params.extend([self.scale_x_continuous, self.scale_y_continuous, self.ylab, self.xlab, self.colscale_opts])
params.extend([self.scale_x_continuous, self.scale_y_continuous, self.ylab, self.xlab])
gg = gg + params
return gg
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="plotnineseqsuite",
version="0.9.0",
version="0.9.1",
author="Cao Tianze",
author_email="[email protected]",
description="A Python package for visualizing sequence data using ggplot2",
Expand All @@ -24,9 +24,9 @@
],
packages=['plotnineseqsuite','plotnineseqsuite.font','plotnineseqsuite.data'],
python_requires=">=3.10",
install_requires=['plotnine>=0.10.1'],
install_requires=['plotnine==0.12.2'],
license="MIT",
keywords=['ggplot2', 'plotnine', 'Bioinformatics', 'Sequence logo'],
keywords=['ggplot2', 'plotnine', 'Bioinformatics tool', 'Sequence logo'],
package_data={
"": ["*.csv"]
}
Expand Down
249 changes: 110 additions & 139 deletions tests/test_paper.py

Large diffs are not rendered by default.

0 comments on commit 30975dd

Please sign in to comment.