Skip to content
Snippets Groups Projects
Commit 43fa9dfd authored by bbauvin's avatar bbauvin
Browse files

Trying to fix segmentation fault

parent b1d14b53
No related branches found
No related tags found
No related merge requests found
......@@ -430,6 +430,7 @@ def getAdjacenceMatrix(sortedRNASeq, k=1):
# indices.append(patient[i-1]+patient[i]*nbGenes)
# data.append(True)
indptr[patientIndex+1] = pointer
mat = sparse.csr_matrix((data, indices, indptr), shape=(sortedRNASeq.shape[0], sortedRNASeq.shape[1]*sortedRNASeq.shape[1]), dtype=bool)
return mat
......
......@@ -8,6 +8,12 @@ def getV(DATASET, viewIndex, usedIndices=None):
if not DATASET.get("View"+str(viewIndex)).attrs["sparse"]:
return DATASET.get("View"+str(viewIndex))[usedIndices, :]
else:
sparse_mat = sparse.csr_matrix((DATASET.get("View"+str(viewIndex)).get("data").value,
DATASET.get("View"+str(viewIndex)).get("indices").value,
DATASET.get("View"+str(viewIndex)).get("indptr").value),
shape=DATASET.get("View"+str(viewIndex)).attrs["shape"])[usedIndices,:]
print sparse_mat.shape
print sparse_mat.indptr
return sparse.csr_matrix((DATASET.get("View"+str(viewIndex)).get("data").value,
DATASET.get("View"+str(viewIndex)).get("indices").value,
DATASET.get("View"+str(viewIndex)).get("indptr").value),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment