Skip to content

Commit

Permalink
Minor changes in dependencies + minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ivargr committed Dec 18, 2021
1 parent e00a496 commit 081a37d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
9 changes: 0 additions & 9 deletions kage/command_line_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import sys
from .util import log_memory_usage_now
#logging.basicConfig(level=logging.INFO, format='%(module)s %(asctime)s %(levelname)s: %(message)s')
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
import itertools
from itertools import repeat
Expand Down Expand Up @@ -40,14 +39,11 @@
np.random.seed(1)
np.seterr(all="ignore")

logging.info("Using Python version " + platform.python_version())


def main():
run_argument_parser(sys.argv[1:])



def analyse_variants(args):
from .node_count_model import NodeCountModel
from obgraph.genotype_matrix import MostSimilarVariantLookup
Expand Down Expand Up @@ -474,12 +470,9 @@ def analyse_kmer_index(args):
reverse_kmers = ReverseKmerIndex.from_file(args.reverse_kmer_index)
index = KmerIndex.from_file(args.kmer_index)
variant_to_nodes = VariantToNodes.from_file(args.variant_to_nodes)

from .variant_kmer_analyser import VariantKmerAnalyser
analyser = VariantKmerAnalyser(reverse_kmers, index, variant_to_nodes, args.write_good_variants_to_file)
analyser.analyse()


logging.info("Done")

# Analyse variant kmers
Expand Down Expand Up @@ -609,8 +602,6 @@ def create_helper_model(args):
to_shared_memory(model, "model"+args.shared_memory_unique_id)
logging.info("Put data in shared memory")

# genotyped_variants = VcfVariants(header_lines=variants.get_header())

for from_variant, to_variant, subhelpers, subcombo in pool.imap(create_helper_model_single_thread,
zip(variant_intervals, repeat(args))):
logging.info("Done with one chunk")
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, Extension

setup(name='kage-genotyper',
version='0.0.16',
version='0.0.18',
description='KAGE',
long_description_content_type="text/markdown",
url='http://github.com/ivargr/kage',
Expand All @@ -12,9 +12,10 @@
zip_safe=False,
install_requires=['numpy', 'tqdm', 'pyfaidx', 'pathos', 'cython', 'scipy',
'obgraph>=0.0.8',
'graph_kmer_index>=0.0.12',
'kmer_mapper',
'graph_read_simulator', 'shared_memory_wrapper'
'graph_kmer_index>=0.0.14',
'kmer_mapper>=0.0.15',
'graph_read_simulator',
'shared_memory_wrapper>=0.0.4'
],
include_dirs=["."],
classifiers=[
Expand Down
6 changes: 3 additions & 3 deletions tests/test_genotyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from kage.combination_model_genotyper import CombinationModelGenotyper
from kage.helper_index import make_helper_model_from_genotype_matrix,make_helper_model_from_genotype_matrix_and_node_counts

class Tester:
class Helper:
def __init__(self):

self.n_nodes = 8
Expand All @@ -24,7 +24,7 @@ def prepare(self):

self.variant_to_nodes = VariantToNodes(np.array([1, 2, 3, 4]), np.array([5, 6, 7, 8]))
self.most_simliar_variant_lookup = MostSimilarVariantLookup(np.arange(self.n_variants)-1, np.ones(self.n_variants))
self.node_count_model = NodeCountModelAdvanced(np.zeros(self.max_node_id), np.zeros(self.max_node_id), np.zeros(self.max_node_id), np.zeros((self.max_node_id, 5)), np.zeros(self.max_node_id, dtype=np.bool))
self.node_count_model = NodeCountModelAdvanced(np.zeros(self.max_node_id), np.zeros(self.max_node_id), np.zeros(self.max_node_id), np.zeros((self.max_node_id, 5)), np.zeros(self.max_node_id, dtype=bool))
# self.helper_variants, self.genotype_combo_matrix = make_helper_model_from_genotype_matrix(self.genotype_matrix, self.most_simliar_variant_lookup)
self.helper_variants, self.genotype_combo_matrix = \
make_helper_model_from_genotype_matrix_and_node_counts(self.genotype_matrix, self.node_count_model, self.variant_to_nodes)
Expand Down Expand Up @@ -106,7 +106,7 @@ def testcase2(self):
for variant in input_variants:
assert variant.genotype == "0/0"

tester = Tester()
tester = Helper()

def test1():
tester.testcase_all_homo_alt()
Expand Down

0 comments on commit 081a37d

Please sign in to comment.