Skip to content

Commit

Permalink
Merge pull request #69 from churchmanlab/update2023
Browse files Browse the repository at this point in the history
Update2023
  • Loading branch information
ri23 authored May 15, 2023
2 parents af52c05 + e6c7c6c commit d36f44b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.8
- name: Install without INDRA
run: |
pip install nose coverage
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation](https://readthedocs.org/projects/genewalk/badge/?version=latest)](https://genewalk.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/genewalk.svg)](https://badge.fury.io/py/genewalk)
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/genewalk/README.html)
[![Python 3.6+](https://img.shields.io/pypi/pyversions/genewalk.svg)](https://www.python.org/downloads/release)
[![Python 3.8+](https://img.shields.io/pypi/pyversions/genewalk.svg)](https://www.python.org/downloads)

GeneWalk determines for individual genes the functions that are relevant in a
particular biological context and experimental condition. GeneWalk quantifies
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
author = 'GeneWalk Developers'

# The short X.Y version
version = '1.5'
version = '1.6'
# The full version, including alpha/beta/rc tags
release = '1.5.3'
release = '1.6.0'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion genewalk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
logging.getLogger('gensim.summarization.textcleaner').setLevel(logging.WARNING)


__version__ = '1.5.3'
__version__ = '1.6.0'
5 changes: 3 additions & 2 deletions genewalk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def run_main(args):
save_pickle(MG.graph, project_folder, 'multi_graph')
for i in range(args.nreps_graph):
logger.info('%s/%s' % (i + 1, args.nreps_graph))
DW = run_walks(MG.graph, workers=args.nproc, size=args.dim_rep)
DW = run_walks(MG.graph, workers=args.nproc,
vector_size=args.dim_rep)

# Pickle the node vectors (embeddings) and DW object
if args.save_dw:
Expand All @@ -218,7 +219,7 @@ def run_main(args):
for i in range(args.nreps_null):
logger.info('%s/%s' % (i + 1, args.nreps_null))
RG = get_rand_graph(MG)
DW = run_walks(RG, workers=args.nproc, size=args.dim_rep)
DW = run_walks(RG, workers=args.nproc, vector_size=args.dim_rep)

# Pickle the node vectors (embeddings) and DW object
if args.save_dw:
Expand Down
9 changes: 5 additions & 4 deletions genewalk/deepwalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_walks(self, workers=1):
end = time.time()
logger.info('Running random walks done in %.2fs' % (end - start))

def word2vec(self, sg=1, size=8, window=1, min_count=1, negative=5,
def word2vec(self, sg=1, vector_size=8, window=1, min_count=1, negative=5,
workers=1, sample=0):
"""Set the model based on Word2Vec
Source: https://radimrehurek.com/gensim/models/word2vec.html
Expand All @@ -108,7 +108,7 @@ def word2vec(self, sg=1, size=8, window=1, min_count=1, negative=5,
sg : Optional[int] {1, 0}
Defines the training algorithm. If 1, skip-gram is employed;
otherwise, CBOW is used. For GeneWalk this is set to 1.
size : Optional[int]
vector_size : Optional[int]
Dimensionality of the node vectors. Default for GeneWalk is 8.
window : Optional[int]
a.k.a. context size. Maximum distance between the current and
Expand All @@ -132,7 +132,8 @@ def word2vec(self, sg=1, size=8, window=1, min_count=1, negative=5,
"""
logger.info('Generating node vectors...')
start = time.time()
self.model = Word2Vec(sentences=self.walks, sg=sg, size=size,
self.model = Word2Vec(sentences=self.walks, sg=sg,
vector_size=vector_size,
window=window, min_count=min_count,
negative=negative, workers=workers,
sample=sample)
Expand Down Expand Up @@ -223,4 +224,4 @@ def run_walks(graph, **kwargs):
DW = DeepWalk(graph, **dw_args)
DW.get_walks(kwargs.get('workers', 1))
DW.word2vec(**kwargs)
return DW
return DW
4 changes: 2 additions & 2 deletions genewalk/perform_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def generate_output(self, alpha_fdr=1):
df.drop(['pval_rep'+str(i) for i in range(len(self.nvs))],
axis=1, inplace=True)
df[self.gene_id_type] = df[self.gene_id_type].astype('category')
df[self.gene_id_type].cat.set_categories(df[self.gene_id_type].unique(),
inplace=True)
df[self.gene_id_type] = \
df[self.gene_id_type].cat.set_categories(df[self.gene_id_type].unique())
df[['ncon_gene', 'ncon_go']] = \
df[['ncon_gene', 'ncon_go']].astype('str')
df = df.sort_values(by=[self.gene_id_type, 'global_padj', 'gene_padj',
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@


def main():
install_list = ['numpy', 'pandas', 'networkx>=2.1', 'gensim<4', 'goatools',
install_list = ['numpy', 'pandas', 'networkx>=2.1', 'gensim>=4.0.0', 'goatools',
'scipy>=1.3.0', 'matplotlib', 'seaborn', 'plotly>=4.0.0']

setup(name='genewalk',
version='1.5.3',
version='1.6.0',
description='Determine gene function based on network embeddings.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -25,9 +25,10 @@ def main():
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering :: Bio-Informatics',
],
keywords=['gene function', 'network', 'embedding'],
Expand Down

0 comments on commit d36f44b

Please sign in to comment.