Skip to content

Commit

Permalink
Name change to kameris
Browse files Browse the repository at this point in the history
  • Loading branch information
stephensolis committed Jul 11, 2018
1 parent 93fdf53 commit 9f2f2ed
Show file tree
Hide file tree
Showing 38 changed files with 68 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
language: generic
if: branch = master AND type != pull_request
install:
- brew upgrade python
- brew update && brew uninstall --ignore-dependencies --force python && brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
- unlink /usr/local/bin/python; ln -s /usr/local/bin/python3 /usr/local/bin/python
- export PATH=/usr/local/bin:$PATH
- sudo mkdir -p /usr/local/man
Expand Down
17 changes: 8 additions & 9 deletions Makefile
@@ -1,7 +1,6 @@
.PHONY: all pip-package bin-package distribute distribute-pip distribute-bin test lint install uninstall clean

CLEAN_CMD = bash -c 'rm -rf build dist modmap_toolkit.egg-info && find . -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete'
VERSION_NUMBER = $(shell python -c 'import modmap_toolkit; print(modmap_toolkit.__version__)')
VERSION_NUMBER = $(shell python -c 'import kameris; print(kameris.__version__)')
ifeq ($(OS),Windows_NT)
EXE_SUFFIX = -windows.exe
else
Expand All @@ -23,7 +22,7 @@ pip-package: clean

bin-package:
python -m pip install --upgrade pyinstaller
python -m PyInstaller modmap-toolkit.spec
python -m PyInstaller kameris.spec

distribute: distribute-pip distribute-bin

Expand All @@ -32,24 +31,24 @@ distribute-pip: pip-package
python -m twine upload dist/*.whl

distribute-bin: bin-package
tools/github-release/github-release$(EXE_SUFFIX) upload --user stephensolis --repo modmap-toolkit \
tools/github-release/github-release$(EXE_SUFFIX) upload --user stephensolis --repo kameris \
--tag v$(VERSION_NUMBER) \
--name modmap-toolkit$(EXE_SUFFIX) \
--file dist/modmap-toolkit$(EXE_SUFFIX)
--name kameris$(EXE_SUFFIX) \
--file dist/kameris$(EXE_SUFFIX)


test: lint

lint:
python -m flake8 modmap_toolkit modmap-toolkit.py setup.py
python -m flake8 kameris kameris.py setup.py


install:
python -m pip install -e .

uninstall:
python -m pip uninstall modmap-toolkit
python -m pip uninstall kameris


clean:
$(CLEAN_CMD)
bash -c 'rm -rf build dist kameris.egg-info && find . -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete'
28 changes: 14 additions & 14 deletions README.md
@@ -1,42 +1,42 @@
<h1 align="center">
<br>
<img src="https://raw.githubusercontent.com/stephensolis/modmap-toolkit/master/logo/logo.png" alt="modmap-toolkit" width="200">
<img src="https://raw.githubusercontent.com/stephensolis/kameris/master/logo/logo.png" alt="kameris" width="200">
<br>
modmap-toolkit
Kameris
<br>
</h1>

<h4 align="center">A fast, user-friendly analysis and evaluation pipeline for some DNA sequence classification tasks.</h4>

<p align="center">
<a href="https://pypi.python.org/pypi/modmap-toolkit">
<img src="https://badge.fury.io/py/modmap-toolkit.svg" alt="PyPI">
<a href="https://pypi.python.org/pypi/kameris">
<img src="https://badge.fury.io/py/kameris.svg" alt="PyPI">
</a>
<img src="http://img.shields.io/:license-mit-blue.svg" alt="License">
&nbsp;
<a href="https://travis-ci.org/stephensolis/modmap-toolkit">
<img src="https://travis-ci.org/stephensolis/modmap-toolkit.svg?branch=master" alt="Travis">
<a href="https://travis-ci.org/stephensolis/kameris">
<img src="https://travis-ci.org/stephensolis/kameris.svg?branch=master" alt="Travis">
</a>
<a href="https://ci.appveyor.com/project/stephensolis/modmap-toolkit">
<a href="https://ci.appveyor.com/project/stephensolis/kameris">
<img src="https://ci.appveyor.com/api/projects/status/v22hru9wvvdhsv8q?svg=true" alt="Appveyor">
</a>
&nbsp;
<a href="https://www.codacy.com/app/stephensolis/modmap-toolkit">
<a href="https://www.codacy.com/app/stephensolis/kameris">
<img src="https://api.codacy.com/project/badge/Grade/2286db6fde1d4b729127f820d7896cd0" alt="Codacy">
</a>
<a href="https://codebeat.co/projects/github-com-stephensolis-modmap-toolkit-maste">
<img src="https://codebeat.co/badges/d344663e-21af-402e-a95f-b030b6a6ca2d" alt="Codebeat">
<a href="https://codebeat.co/projects/github-com-stephensolis-kameris-master">
<img src="https://codebeat.co/badges/5826ce1f-ba26-4cd4-a641-d33845023d79" alt="Codebeat">
</a>
<a href="https://codeclimate.com/github/stephensolis/modmap-toolkit/maintainability">
<img src="https://api.codeclimate.com/v1/badges/7dcf996e9fcb35d8db7d/maintainability" alt="Codeclimate">
<a href="https://codeclimate.com/github/stephensolis/kameris/maintainability">
<img src="https://api.codeclimate.com/v1/badges/0ea51d670aba5f65c707/maintainability" alt="Codeclimate">
</a>
</p>

This project uses:

- [stephensolis/modmap-generator-cpp](https://github.com/stephensolis/modmap-generator-cpp) to generate kmer count vectors and distance matrices
- [stephensolis/kameris-backend](https://github.com/stephensolis/kameris-backend) to generate k-mer count vectors and distance matrices
- [scikit-learn](http://scikit-learn.org/) for supervised classifiers
- [Wolfram Mathematica](https://www.wolfram.com/mathematica/) and code based on [stephensolis/modmap-generator-mma](https://github.com/stephensolis/modmap-generator-mma) to generate interactive plots
- [Wolfram Mathematica](https://www.wolfram.com/mathematica/) and code based on [stephensolis/modmap-generator](https://github.com/stephensolis/modmap-generator) to generate interactive plots
- [NumPy](http://www.numpy.org/) and [SciPy](https://www.scipy.org/) for MultiDimensional Scaling (MDS)

## License ![License](http://img.shields.io/:license-mit-blue.svg)
Expand Down
2 changes: 1 addition & 1 deletion modmap-toolkit.py → kameris.py
Expand Up @@ -5,5 +5,5 @@
import multiprocessing
multiprocessing.freeze_support()

from modmap_toolkit.__main__ import main # NOQA
from kameris.__main__ import main # NOQA
main()
14 changes: 7 additions & 7 deletions modmap-toolkit.spec → kameris.spec
@@ -1,18 +1,18 @@
from modmap_toolkit.utils.platform_utils import platform_name
from kameris.utils.platform_utils import platform_name


a = Analysis(['modmap-toolkit.py'],
a = Analysis(['kameris.py'],
pathex=[os.getcwd()],
binaries=[],
datas=[
('modmap_toolkit/scripts/make_plots.wls', 'modmap_toolkit/scripts'),
('modmap_toolkit/scripts/generation_cgr_' + platform_name() + '_*', 'modmap_toolkit/scripts'),
('modmap_toolkit/scripts/generation_dists_' + platform_name() + '_*', 'modmap_toolkit/scripts')
('kameris/scripts/make_plots.wls', 'kameris/scripts'),
('kameris/scripts/generation_cgr_' + platform_name() + '_*', 'kameris/scripts'),
('kameris/scripts/generation_dists_' + platform_name() + '_*', 'kameris/scripts')
],
hiddenimports=[
'sklearn.neighbors.typedefs', 'sklearn.neighbors.quad_tree', 'sklearn.tree._utils',
'scipy._lib.messagestream',
'modmap_toolkit.subcommands.run_job', 'modmap_toolkit.subcommands.summarize'
'kameris.subcommands.run_job', 'kameris.subcommands.summarize'
],
hookspath=[],
runtime_hooks=[],
Expand All @@ -25,7 +25,7 @@ exe = EXE(pyz,
a.binaries,
a.zipfiles,
a.datas,
name='modmap-toolkit-' + platform_name(),
name='kameris-' + platform_name(),
debug=False,
strip=False,
upx=False,
Expand Down
2 changes: 1 addition & 1 deletion modmap_toolkit/__init__.py → kameris/__init__.py
@@ -1,3 +1,3 @@
from __future__ import unicode_literals

__version__ = '0.3.dev12'
__version__ = '0.4.dev5'
2 changes: 1 addition & 1 deletion modmap_toolkit/__main__.py → kameris/__main__.py
Expand Up @@ -28,7 +28,7 @@ def main():

args = parser.parse_args()
run_module = importlib.import_module('.subcommands.' + args.module_name,
'modmap_toolkit')
'kameris')
run_module.run(args)


Expand Down
@@ -1,17 +1,17 @@
from __future__ import absolute_import, division, unicode_literals

from . import backend
from . import classify
from . import command
from . import mds
from . import mmg
from . import selection


step_runners = {
'classify': classify.run_classify_step,
'command': command.run_command_step,
'kmers': mmg.run_mmg_kmers,
'distances': mmg.run_mmg_dists,
'kmers': backend.run_backend_kmers,
'distances': backend.run_backend_dists,
'mds': mds.run_mds_step,
'select': selection.run_select_step
}
File renamed without changes.
Expand Up @@ -29,7 +29,7 @@ def binary_path(bin_name):
))


def run_mmg_kmers(options, exp_options):
def run_backend_kmers(options, exp_options):
command.run_command_step({
'command': '"{}" cgr "{}" "{}" {} {}'.format(
binary_path('generation_cgr'),
Expand All @@ -38,7 +38,7 @@ def run_mmg_kmers(options, exp_options):
}, {})


def run_mmg_dists(options, exp_options):
def run_backend_dists(options, exp_options):
command.run_command_step({
'command': '"{}" "{}" "{}" {}'.format(
binary_path('generation_dists'),
Expand Down
Expand Up @@ -7,7 +7,7 @@
from collections import defaultdict
import json
import logging
import mmg_formats
import kameris_formats
import numpy as np
import scipy.sparse as sparse
from six import iteritems
Expand Down Expand Up @@ -172,20 +172,20 @@ def default(self, obj):


def run_classify_step(options, exp_options):
log = logging.getLogger('modmap.classify')
log = logging.getLogger('kameris.classify')

if options['classifiers'] == 'all':
classifier_names = classifiers_by_name.keys()
else:
classifier_names = options['classifiers']

if options['features_type'] == 'mmg-dists':
features = mmg_formats.dist_reader \
.read_matrix(options['features_file'])
if options['features_type'] == 'mm-dists':
features = kameris_formats.dist_reader \
.read_matrix(options['features_file'])
features_mode = 'dists'
elif options['features_type'] == 'mmg-repr':
elif options['features_type'] == 'mm-repr':
features = []
reader = mmg_formats.repr_reader(options['features_file'])
reader = kameris_formats.repr_reader(options['features_file'])
for i in range(reader.count):
features.append(reader.read_matrix(i, flatten=True))

Expand Down
Expand Up @@ -5,7 +5,7 @@


def run_command_logged(command, **kwargs):
log = logging.getLogger('modmap')
log = logging.getLogger('kameris')
log.info('running command "%s"', command)
process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down
6 changes: 3 additions & 3 deletions modmap_toolkit/job_steps/mds.py → kameris/job_steps/mds.py
Expand Up @@ -2,7 +2,7 @@

import json
import logging
import mmg_formats
import kameris_formats
import numpy as np
import scipy.sparse.linalg as linalg

Expand All @@ -26,7 +26,7 @@ def mds(delta, dim):

(eigenvals, eigenvecs) = linalg.eigsh(bMatr, k=dim)
if (eigenvals < 0).any():
logging.getLogger('modmap.mds') \
logging.getLogger('kameris.mds') \
.warning('some eigenvalues were negative')

# not sure why eigensystem is sorted in reverse order for eigsh...
Expand All @@ -36,7 +36,7 @@ def mds(delta, dim):


def run_mds_step(options, exp_options):
dists = mmg_formats.dist_reader.read_matrix(options['dists_file'])
dists = kameris_formats.dist_reader.read_matrix(options['dists_file'])
points = mds(dists, options['dimensions']).tolist()

with open(options['output_file'], 'w') as outfile:
Expand Down
Expand Up @@ -61,7 +61,7 @@ def run_select_step(options, exp_options):
file_counter = 1

for metadata_entry in tqdm(pick_group_metadata, mininterval=1,
file=job_utils.LoggerFileAdapter('modmap')):
file=job_utils.LoggerAsFile('kameris')):
group_options = groups[metadata_entry['group']]

# open archive file
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -3,7 +3,7 @@
(* plot settings *)

colorScheme = {
Blue, Red, Green, Magenta, Yellow, Orange, Darker@Green, Cyan, Brown
Blue, Red, Green, Magenta, Orange, Darker@Green, Cyan, Brown, Purple, Yellow
};


Expand Down
File renamed without changes.
Expand Up @@ -164,7 +164,7 @@ def run_experiment_copy(copy_options, paths, local_dirs, job_name):


def run_experiment_steps(steps, exp_options):
log = logging.getLogger('modmap')
log = logging.getLogger('kameris')

for i, step_options in enumerate(steps):
step_desc = "step '{}' ({}/{})".format(step_options['type'], i+1,
Expand All @@ -181,7 +181,7 @@ def run_experiment_steps(steps, exp_options):


def setup_logging(job_name, settings):
log = logging.getLogger('modmap')
log = logging.getLogger('kameris')
log.setLevel(logging.INFO)
formatter = logging.Formatter('%(levelname)-8s %(message)s')

Expand Down
Expand Up @@ -199,9 +199,9 @@ def accuracy_for_classifier(classifier_results):

if args.plot_output_dir is not None:
num_classes = len(curr_stats['classes'])
if num_classes > 9:
if num_classes > 10:
print('Warning: skipping plot generation because there are '
'too many classes ({} > 9)'.format(num_classes))
'too many classes ({} > 10)'.format(num_classes))
else:
base_output_path = os.path.join(
args.plot_output_dir, os.path.basename(args.job_dir)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -21,7 +21,7 @@ def call_string_extended_lambda(func_str, *args, **kwargs): # NOQA (cache line

# for formatted log output

class LoggerFileAdapter:
class LoggerAsFile:
def __init__(self, logger_name):
self.log = logging.getLogger(logger_name)

Expand All @@ -36,7 +36,7 @@ def flush(self):

@contextlib.contextmanager
def log_step(step_text, start_stars=False):
log = logging.getLogger('modmap')
log = logging.getLogger('kameris')
if start_stars:
step_format = '*** %s %s'
else:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion samples/settings.yml
Expand Up @@ -13,7 +13,7 @@ local_dirs:
#remote_logging:
# # only AWS CloudWatch is currently supported
# destination: cloudwatch
# log_group: modmap # the CloudWatch group (must already exist)
# log_group: kameris # the CloudWatch group (must already exist)
# region: us-east-1 # the AWS region
# aws_key: # your AWS Access Key ID
# aws_secret: # your AWS Secret Access Key

0 comments on commit 9f2f2ed

Please sign in to comment.