Skip to content

Commit

Permalink
Removed enriched function
Browse files Browse the repository at this point in the history
  • Loading branch information
naderm committed Sep 19, 2020
1 parent fab0827 commit e4c0cf4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
3 changes: 2 additions & 1 deletion pyproteome/motifs/logo.py
Expand Up @@ -462,7 +462,8 @@ def logo(
Returns
-------
fig, axes
fig : :class:`matplotlib.figure.Figure`
axes : :class:`matplotlib.axes.Axes`
'''
if len(back) == 0:
return None, None
Expand Down
31 changes: 4 additions & 27 deletions pyproteome/motifs/phosphosite.py
Expand Up @@ -51,6 +51,10 @@ def generate_logos(
kinases : list of str, optional
min_foreground : int, optional
Minimum number of substrates needed for logo generation.
Returns
-------
list of :class:`matplotlib.figure.Figure`
'''
species = pyp.species.ORGANISM_MAPPING.get(species, species).lower()

Expand Down Expand Up @@ -82,30 +86,3 @@ def generate_logos(
figs.append(f)

return figs


def enriched(data, species=None):
df = get_data()

if species:
df = df[
np.logical_and(
df['KIN_ORGANISM'] == species,
df['SUB_ORGANISM'] == species,
)
]

return df[
df['SITE_+/-7_AA'].isin(
motif.generate_n_mers(
data['Sequence'],
fill_left='_',
fill_right='_',
mods=[(None, 'Phospho')],
)
)
].style.set_table_styles(
[
{'selector': 'th:first-child', 'props': [('display', 'none')]},
]
)
7 changes: 0 additions & 7 deletions tests/integration_test.py
Expand Up @@ -332,13 +332,6 @@ def test_weblogo(self):
for data in self.data.values():
motifs.weblogo.make_logo(data)

def test_phosphosite_enriched(self):
for data in self.data.values():
phosphosite.enriched(
data,
species='Mouse',
)

def test_cluster(self):
for d in self.data.values():
data = cluster.get_data(d)
Expand Down

0 comments on commit e4c0cf4

Please sign in to comment.