Skip to content

Commit

Permalink
Merge branch 'master' into fix/consume-filename-or-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
standage committed Sep 14, 2017
2 parents e2ca266 + 9323ca4 commit 921ad7d
Show file tree
Hide file tree
Showing 135 changed files with 23 additions and 186 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ INCLUDESTRING=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null \
INCLUDEOPTS=$(shell gcc -E -x c++ - -v < /dev/null 2>&1 >/dev/null \
| grep '^ /' | grep -v cc1plus | awk '{print "-I" $$1 " "}')

PYINCLUDE=$(shell python -c "from __future__ import print_function; \
import sysconfig; flags = ['-I' + sysconfig.get_path('include'), \
'-I' + sysconfig.get_path('platinclude')]; print(' '.join(flags))")
PYINCLUDE=$(shell python -c "import sysconfig; \
flags = ['-I' + sysconfig.get_path('include'), \
'-I' + sysconfig.get_path('platinclude')]; print(' '.join(flags))")

CPPCHECK_SOURCES=$(filter-out lib/test%, $(wildcard lib/*.cc khmer/_khmer.cc) )
CPPCHECK=cppcheck --enable=all \
Expand Down
1 change: 0 additions & 1 deletion doc/dev/guidelines-continued-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ When wrapping code from liboxli:

For imports,

- `__future__` imports at the top, as usual.
- `libc` cimports next,
- then `libcpp` imports and cimports.
- followed by cimports
Expand Down
1 change: 0 additions & 1 deletion examples/python-api/bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# khmer accrues a small false positive rate in order to save substantially on
# memory requirements.

from __future__ import print_function
import khmer

ksize = 21
Expand Down
1 change: 0 additions & 1 deletion examples/python-api/consume.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# A demonstration of khmer's primary sequence loading function.

from __future__ import print_function
import khmer
import sys

Expand Down
1 change: 0 additions & 1 deletion examples/python-api/exact-counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# A demonstration of using khmer for exact k-mer counting. The memory required
# is 4^k, which limits this to small values of k.

from __future__ import print_function
import khmer

# Note:
Expand Down
1 change: 0 additions & 1 deletion include/oxli/hashgraph.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Contact: khmer-project@idyll.org
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion include/oxli/hashtable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Contact: khmer-project@idyll.org
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
Expand Down
19 changes: 10 additions & 9 deletions include/oxli/oxli.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private:\

#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <list>
#include <functional>
Expand Down Expand Up @@ -129,22 +130,22 @@ typedef void (*CallbackFn)(const char * info, void * callback_data,
typedef unsigned int PartitionID;
typedef std::set<HashIntoType> SeenSet;
typedef std::set<PartitionID> PartitionSet;
typedef std::map<HashIntoType, PartitionID*> PartitionMap;
typedef std::map<PartitionID, PartitionID*> PartitionPtrMap;
typedef std::map<PartitionID, SeenSet*> PartitionsToTagsMap;
typedef std::unordered_map<HashIntoType, PartitionID*> PartitionMap;
typedef std::unordered_map<PartitionID, PartitionID*> PartitionPtrMap;
typedef std::unordered_map<PartitionID, SeenSet*> PartitionsToTagsMap;
typedef std::set<PartitionID *> PartitionPtrSet;
typedef std::map<PartitionID, PartitionPtrSet*> ReversePartitionMap;
typedef std::unordered_map<PartitionID, PartitionPtrSet*> ReversePartitionMap;
typedef std::queue<HashIntoType> NodeQueue;
typedef std::map<PartitionID, PartitionID*> PartitionToPartitionPMap;
typedef std::map<HashIntoType, unsigned int> TagCountMap;
typedef std::map<PartitionID, unsigned int> PartitionCountMap;
typedef std::unordered_map<PartitionID, PartitionID*> PartitionToPartitionPMap;
typedef std::unordered_map<HashIntoType, unsigned int> TagCountMap;
typedef std::unordered_map<PartitionID, unsigned int> PartitionCountMap;
typedef std::map<unsigned long long, unsigned long long>
PartitionCountDistribution;

// types used in @camillescott's sparse labeling extension
typedef unsigned long long int Label;
typedef std::multimap<HashIntoType, Label> TagLabelMap;
typedef std::multimap<Label, HashIntoType> LabelTagMap;
typedef std::unordered_multimap<HashIntoType, Label> TagLabelMap;
typedef std::unordered_multimap<Label, HashIntoType> LabelTagMap;
typedef std::pair<HashIntoType, Label> TagLabelPair;
typedef std::pair<Label, HashIntoType> LabelTagPair;
typedef std::set<Label> LabelSet;
Expand Down
3 changes: 2 additions & 1 deletion include/oxli/storage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ Contact: khmer-project@idyll.org
#include <cassert>
#include <array>
#include <mutex>
#include <unordered_map>
using MuxGuard = std::lock_guard<std::mutex>;

#include "gqf.h"

namespace oxli {
typedef std::map<HashIntoType, BoundedCounterType> KmerCountMap;
typedef std::unordered_map<HashIntoType, BoundedCounterType> KmerCountMap;

//
// base Storage class for hashtable-related storage of information in memory.
Expand Down
1 change: 0 additions & 1 deletion khmer/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"""This is khmer; please see http://khmer.readthedocs.io/."""


from __future__ import print_function
from collections import namedtuple
from math import log
import json
Expand Down
11 changes: 6 additions & 5 deletions khmer/_oxli/oxli_types.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from libcpp cimport bool
from libcpp.map cimport map
from libcpp.unordered_map cimport unordered_map
from libcpp.set cimport set
from libcpp.string cimport string

Expand All @@ -13,12 +14,12 @@ cdef extern from "oxli/oxli.hh" namespace "oxli":

ctypedef unsigned int PartitionID
ctypedef set[PartitionID] PartitionSet
ctypedef map[HashIntoType, PartitionID*] PartitionMap
ctypedef map[PartitionID, PartitionID*] PartitionPtrMap
ctypedef map[PartitionID, HashIntoTypeSet*] PartitionToTagsMap
ctypedef map[PartitionID, unsigned int] PartitionCountMap
ctypedef unordered_map[HashIntoType, PartitionID*] PartitionMap
ctypedef unordered_map[PartitionID, PartitionID*] PartitionPtrMap
ctypedef unordered_map[PartitionID, HashIntoTypeSet*] PartitionToTagsMap
ctypedef unordered_map[PartitionID, unsigned int] PartitionCountMap
ctypedef map[unsigned long long, unsigned long long] PartitionCountDistribution
ctypedef map[HashIntoType, unsigned int] TagCountMap
ctypedef unordered_map[HashIntoType, unsigned int] TagCountMap
ctypedef unsigned char WordLength
ctypedef unsigned short int BoundedCounterType

Expand Down
1 change: 0 additions & 1 deletion khmer/_oxli/parsing.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: UTF-8 -*-

from __future__ import unicode_literals

from libc.stdint cimport uintptr_t

Expand Down
2 changes: 0 additions & 2 deletions khmer/_oxli/parsing.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: UTF-8 -*-

from __future__ import print_function
from __future__ import unicode_literals

from cython.operator cimport dereference as deref
cimport cython
Expand Down
1 change: 0 additions & 1 deletion khmer/_oxli/utils.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: UTF-8 -*-

from __future__ import unicode_literals
from cpython.version cimport PY_MAJOR_VERSION

from cython import short, int, long
Expand Down
Empty file modified khmer/_version.py
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion khmer/kfile.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
# Contact: khmer-project@idyll.org
"""File handling/checking utilities for command-line scripts."""

from __future__ import print_function, unicode_literals, division

import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions khmer/khmer_args.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
# Contact: khmer-project@idyll.org
"""Common argparse constructs."""

from __future__ import unicode_literals
from __future__ import print_function

import sys
import argparse
Expand Down
1 change: 0 additions & 1 deletion khmer/khmer_logger.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# Contact: khmer-project@idyll.org
"""Lightweight logging framework for khmer."""

from __future__ import print_function, unicode_literals
import sys

__QUIET__ = False
Expand Down
1 change: 0 additions & 1 deletion khmer/thread_utils.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# pylint: disable=missing-docstring,too-few-public-methods
"""Utilities for dealing with multithreaded processing of short reads."""

from __future__ import print_function, unicode_literals

import threading
import sys
Expand Down
1 change: 0 additions & 1 deletion khmer/trimming.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#
# Contact: khmer-project@idyll.org
"""Common methods for trimming short reads on k-mer abundance."""
from __future__ import print_function, unicode_literals
import screed


Expand Down
1 change: 0 additions & 1 deletion khmer/utils.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#
# Contact: khmer-project@idyll.org
"""Helpful methods for performing common argument-checking tasks in scripts."""
from __future__ import print_function, unicode_literals
from khmer._oxli.parsing import (check_is_left, check_is_right, check_is_pair,
UnpairedReadsError, _split_left_right)
import itertools
Expand Down
1 change: 0 additions & 1 deletion oxli/build_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
Use '-h' for parameter help.
"""

from __future__ import print_function, absolute_import, unicode_literals

import sys

Expand Down
1 change: 0 additions & 1 deletion oxli/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

"""A collection of functions for use throughout khmer/oxli."""

from __future__ import print_function
import threading
import khmer.utils

Expand Down
1 change: 0 additions & 1 deletion oxli/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
# pylint: disable=missing-docstring,no-member
"""Common functions for partitioning."""
from __future__ import print_function, absolute_import, unicode_literals

import sys
import gc
Expand Down
1 change: 0 additions & 1 deletion sandbox/assemble-and-track.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python
from __future__ import print_function
import csv
import screed
import khmer
Expand Down
1 change: 0 additions & 1 deletion sandbox/assemble-on-the-go.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python
from __future__ import print_function
import screed
import khmer
import argparse
Expand Down
1 change: 0 additions & 1 deletion sandbox/assembly-diff-2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: khmer-project@idyll.org
from __future__ import print_function
import sys
import khmer
import screed
Expand Down
2 changes: 0 additions & 2 deletions sandbox/assembly-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: khmer-project@idyll.org
from __future__ import division
from __future__ import print_function
import sys
import khmer
import screed
Expand Down
2 changes: 0 additions & 2 deletions sandbox/assemstats3.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
You can obtain screed by running
pip install screed
'''
from __future__ import division
from __future__ import print_function

import screed
import sys
Expand Down
2 changes: 0 additions & 2 deletions sandbox/bloom-count.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#
# Contact: khmer-project@idyll.org
# pylint: disable=missing-docstring,no-member
from __future__ import print_function
from __future__ import absolute_import

import khmer
import sys
Expand Down
1 change: 0 additions & 1 deletion sandbox/build-sparse-graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#
# Contact: khmer-project@idyll.org

from __future__ import print_function
import khmer
import sys
import screed
Expand Down
1 change: 0 additions & 1 deletion sandbox/calc-best-assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: khmer-project@idyll.org
from __future__ import print_function
import screed
import argparse
import sys
Expand Down
2 changes: 0 additions & 2 deletions sandbox/calc-error-profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
Reads FASTQ and FASTA input.
"""
from __future__ import division
from __future__ import print_function

import sys
import argparse
Expand Down
2 changes: 0 additions & 2 deletions sandbox/calc-median-distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: khmer-project@idyll.org
from __future__ import division
from __future__ import print_function
import sys
import khmer
import argparse
Expand Down
2 changes: 0 additions & 2 deletions sandbox/collect-reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
Use '-h' for parameter help.
"""
from __future__ import division
from __future__ import print_function

import sys
import textwrap
Expand Down
1 change: 0 additions & 1 deletion sandbox/collect-variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
TODO: add to sandbox README
"""
from __future__ import print_function

import sys
import screed
Expand Down
1 change: 0 additions & 1 deletion sandbox/correct-reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
TODO: add to sandbox/README.
"""
from __future__ import print_function
import sys
import os
import tempfile
Expand Down
1 change: 0 additions & 1 deletion sandbox/count-kmers-single.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
Use '-h' for parameter help.
"""
from __future__ import print_function

import sys
import khmer
Expand Down
1 change: 0 additions & 1 deletion sandbox/count-kmers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
Use '-h' for parameter help.
"""
from __future__ import print_function

import sys
import khmer
Expand Down
1 change: 0 additions & 1 deletion sandbox/error-correct-pass2.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
Use '-h' for parameter help.
"""
from __future__ import print_function
import sys
import os
import screed
Expand Down
1 change: 0 additions & 1 deletion sandbox/estimate_optimal_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
Use '-h' for parameter help.
"""
from __future__ import print_function
import argparse
import khmer, oxli
from khmer.khmer_args import info, optimal_size, sanitize_help
Expand Down
1 change: 0 additions & 1 deletion sandbox/extract-compact-dbg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python
from __future__ import print_function
import khmer
import screed
import argparse
Expand Down
1 change: 0 additions & 1 deletion sandbox/extract-single-partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contact: khmer-project@idyll.org
from __future__ import print_function
import sys
from screed.fasta import fasta_iter

Expand Down
Loading

0 comments on commit 921ad7d

Please sign in to comment.