From 7a911cc30ec904bd62cde3658653629dd7b2e42e Mon Sep 17 00:00:00 2001 From: Louis-Philippe Lemieux Perreault Date: Tue, 20 Feb 2018 09:23:17 -0500 Subject: [PATCH 1/3] Use of 'frombuffer' instead of 'fromstring' (numpy deprecation warning) --- pyplink/pyplink.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyplink/pyplink.py b/pyplink/pyplink.py index b44af26..35f24fa 100644 --- a/pyplink/pyplink.py +++ b/pyplink/pyplink.py @@ -198,7 +198,7 @@ def next(self): def _read_current_marker(self): """Reads the current marker and returns its genotypes.""" return self._geno_values[ - np.fromstring(self._bed.read(self._nb_bytes), dtype=np.uint8) + np.frombuffer(self._bed.read(self._nb_bytes), dtype=np.uint8) ].flatten(order="C")[:self._nb_samples] def seek(self, n): @@ -321,8 +321,8 @@ def get_nb_markers(self): def get_duplicated_markers(self): """Returns the duplicated markers, if any. - Args: - set: The set of duplicated marker (might be empty). + Returns: + dict: The set of duplicated marker (might be empty). """ if self._has_duplicated: @@ -398,7 +398,7 @@ def _read_bed(self): seek_index = self._get_seek_position(self._bim.iloc[-1, :].i) bed_file.seek(seek_index) geno = self._geno_values[ - np.fromstring(bed_file.read(self._nb_bytes), dtype=np.uint8) + np.frombuffer(bed_file.read(self._nb_bytes), dtype=np.uint8) ].flatten(order="C")[:self._nb_samples] if geno.shape[0] != self._nb_samples: raise ValueError("invalid number of entries: corrupted BED?") From e1621ad6695e074fb636fe9f1139e1651aa9e206 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Lemieux Perreault Date: Tue, 20 Feb 2018 09:24:13 -0500 Subject: [PATCH 2/3] Updated requirements and url --- README.mkd | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.mkd b/README.mkd index 08c125d..30de7e9 100644 --- a/README.mkd +++ b/README.mkd @@ -16,7 +16,7 @@ The tool requires a standard [Python](http://python.org/) installation (2.7 and 3.3 or higher are supported) with the following modules: 1. [numpy](http://www.numpy.org/) version 1.8.2 or latest -2. [pandas](http://pandas.pydata.org/) version 0.14.1 or latest +2. [pandas](http://pandas.pydata.org/) version 0.17.1 or latest 3. [six](https://pythonhosted.org/six/) version 1.9.0 or latest The tool has been tested on *Linux* only, but should work on *MacOS* and diff --git a/setup.py b/setup.py index e09bd84..b167e77 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def write_version_file(fn=None): def get_requirements(): # Initial requirements - requirements = ["numpy >= 1.8.2", "pandas >= 0.14.1", "six >= 1.9.0"] + requirements = ["numpy >= 1.8.2", "pandas >= 0.17.1", "six >= 1.9.0"] # Checking if python 2 (requires mock) if sys.version_info[0] == 2: @@ -62,7 +62,7 @@ def setup_package(): description="Python module to read binary Plink files.", author="Louis-Philippe Lemieux Perreault", author_email="louis-philippe.lemieux.perreault@statgen.org", - url="http://www.statgen.org", + url="https://github.com/lemieuxl/pyplink", license="MIT", packages=["pyplink", "pyplink.tests"], package_data={"pyplink.tests": ["data/*"], }, From 29af9fcb485620bbd2ab8f44d87fc3123c687502 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Lemieux Perreault Date: Tue, 20 Feb 2018 09:43:35 -0500 Subject: [PATCH 3/3] Updated version micro for next release --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b167e77..913501f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ MAJOR = 1 MINOR = 3 -MICRO = 4 +MICRO = 5 VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)