I am writing and reading from a sparse array looking like this:
dom = tiledb.Domain(
tiledb.Dim(name="variantkey", domain=(0, 2 ** 64 - 2), tile=2, dtype=np.uint64),
tiledb.Dim(name="sample_idx", domain=(0, 9000), tile=2, dtype=np.uint64))
schemaGT = tiledb.ArraySchema(domain=dom, sparse=True,
attrs=(tiledb.Attr(name="GT", dtype=np.int8),
))
I am writing into said array:
with tiledb.SparseArray(path, mode='w') as A:
A[variantkey, sample] = {path: input}
with
variantkey= [5 6 7 8 5 6 7 8 5 6 7 8]
sample = [1 1 1 1 2 2 2 2 3 3 3 3]
input = [ 2 2 1 5 10 1 2 6 2 1 3 7]
Now I am trying to get the input for sample 1:
variantkey = [5 6 7 8]
sample = [1]
with tiledb.SparseArray( path, mode='r') as A:
output = A.multi_index[list(variantkey), list(sample)]["GT"]
The output I get looks like this:
[2. 2. 2. 2. 1. 1. 1. 5. 5. 5.]
When it should like this : [ 2. 2. 1. 5.]
Why do I suddenly have duplicates of my initial input?