Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Commit

Permalink
Fixed issue #31: GSEA error
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuSetty committed Sep 6, 2016
1 parent ef87a3b commit 7d04edc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


setup(name='wishbone',
version='0.4',
version='0.4.1',
description='Wishbone algorithm for identifying bifurcating trajectories from single-cell data',
author='Manu Setty',
author_email='[email protected]',
Expand All @@ -24,7 +24,7 @@
'numpy>=1.10.0',
'pandas>=0.18.0',
'scipy>=0.14.0',
'tsne==0.1.3',
'bhtsne',
'matplotlib',
'seaborn',
'sklearn',
Expand Down
2 changes: 1 addition & 1 deletion src/wishbone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from . import wishbone_gui
from . import autocomplete_entry

__version__ = "0.4"
__version__ = "0.4.1"
13 changes: 7 additions & 6 deletions src/wishbone/wb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
warnings.simplefilter('ignore') # catch experimental ipython widget warning
import seaborn as sns

from tsne import bh_sne
import bhtsne
from scipy.sparse import csr_matrix, find
from scipy.sparse.linalg import eigs
from numpy.linalg import norm
Expand Down Expand Up @@ -417,8 +417,9 @@ def run_tsne(self, n_components=15, perplexity=30):
if data.shape[0] < 100 and perplexity > perplexity_limit:
print('Reducing perplexity to %d since there are <100 cells in the dataset. ' % perplexity_limit)
perplexity = perplexity_limit
self.tsne = pd.DataFrame(bh_sne(data, perplexity=perplexity),
index=self.data.index, columns=['x', 'y'])
self.tsne = pd.DataFrame(bhtsne.tsne(data, perplexity=perplexity),
index=self.data.index, columns=['x', 'y'])


def plot_tsne(self, fig=None, ax=None, title='tSNE projection'):
"""Plot tSNE projections of the data
Expand Down Expand Up @@ -782,8 +783,8 @@ def plot_gene_component_correlations(

@staticmethod
def _gmt_options():
mouse_options = os.listdir(os.path.expanduser('~/.seqc/tools/mouse'))
human_options = os.listdir(os.path.expanduser('~/.seqc/tools/human'))
mouse_options = os.listdir(os.path.expanduser('~/.wishbone/tools/mouse'))
human_options = os.listdir(os.path.expanduser('~/.wishbone/tools/human'))
print('Available GSEA .gmt files:\n\nmouse:\n{m}\n\nhuman:\n{h}\n'.format(
m='\n'.join(mouse_options),
h='\n'.join(human_options)))
Expand Down Expand Up @@ -863,7 +864,7 @@ def run_gsea(self, output_stem, gmt_file=None,
else:
if not len(gmt_file) == 2:
raise ValueError('gmt_file should be a tuple of (organism, filename).')
gmt_file = os.path.expanduser('~/.seqc/tools/{}/{}').format(*gmt_file)
gmt_file = os.path.expanduser('~/.wishbone/tools/{}/{}').format(*gmt_file)

if components is None:
components = self.diffusion_map_correlations.columns
Expand Down

0 comments on commit 7d04edc

Please sign in to comment.