diff options
author | Arun Isaac | 2022-06-20 13:56:57 +0530 |
---|---|---|
committer | Arun Isaac | 2022-06-20 14:04:46 +0530 |
commit | 89764d9abb42f0bad7f4403e827a0434d1a6c31e (patch) | |
tree | 3e934c511a13dfe2e7a2aa4df9d88b1589932623 /gn3 | |
parent | 98df35cf1302817f7f21ab0c6957c759433135b8 (diff) | |
download | genenetwork3-89764d9abb42f0bad7f4403e827a0434d1a6c31e.tar.gz |
gn3: genodb: Remove db, nrows and ncols fields from GenotypeMatrix.
db is unused. nrows and ncols are available in the array and transpose numpy
arrays.
* gn3/genodb.py (GenotypeMatrix)[db, nrows, ncols]: Delete fields.
* gn3/genodb.py (matrix): Do not initialize db, nrows and ncols fields.
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/genodb.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gn3/genodb.py b/gn3/genodb.py index abbc32e..7255d6e 100644 --- a/gn3/genodb.py +++ b/gn3/genodb.py @@ -29,7 +29,7 @@ import numpy as np # pylint: disable=invalid-name,redefined-builtin GenotypeDatabase = namedtuple('GenotypeDatabase', 'txn hash_length') -GenotypeMatrix = namedtuple('Matrix', 'db nrows ncols array transpose') +GenotypeMatrix = namedtuple('Matrix', 'array transpose') @contextmanager def open(path): @@ -54,8 +54,7 @@ def matrix(db): read_optimized_blob = get(db, get(db, b'current')) nrows = int.from_bytes(get_metadata(db, hash, 'nrows'), byteorder='little') ncols = int.from_bytes(get_metadata(db, hash, 'ncols'), byteorder='little') - return GenotypeMatrix(db, nrows, ncols, - np.reshape(np.frombuffer(read_optimized_blob[0 : nrows*ncols], + return GenotypeMatrix(np.reshape(np.frombuffer(read_optimized_blob[0 : nrows*ncols], dtype=np.uint8), (nrows, ncols)), np.reshape(np.frombuffer(read_optimized_blob[nrows*ncols :], |