Skip to content

Commit

Permalink
pairwise linear cms
Browse files Browse the repository at this point in the history
  • Loading branch information
Arina Danilina committed Mar 14, 2024
1 parent 67aee99 commit 4f1a15b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/moscot/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import urllib.request
from types import MappingProxyType
from typing import Any, Dict, List, Literal, Mapping, Optional, Tuple
from itertools import combinations

import networkx as nx
import numpy as np
Expand Down Expand Up @@ -412,7 +413,7 @@ def simulate_data(
Literal indicating whether to add costs corresponding to a specific problem setting.
If `None`, no quadratic cost element is generated.
lin_cost_matrix
Key where to save the linear cost matrix. It is generated according to the sequential policy.
Key where to save the linear cost matrix. It is generated according to the pairwise policy.
If `None`, no linear cost matrix is generated.
quad_cost_matrix
Key where to save the quadratic cost matrices. If `None`, no quadratic cost matrix is generated.
Expand Down Expand Up @@ -460,8 +461,8 @@ def simulate_data(
adata.obsm["barcode"] = rng.choice(n_intBCs, size=(adata.n_obs, barcode_dim))
if lin_cost_matrix is not None:
adata.uns[lin_cost_matrix] = {}
for i in range(n_distributions):
adata.uns[lin_cost_matrix][(str(i), str(i + 1))] = np.abs(
for i,j in combinations(range(n_distributions), 2):
adata.uns[lin_cost_matrix][(str(i), str(j))] = np.abs(
rng.normal(size=(cells_per_distribution, cells_per_distribution))
)
if quad_cost_matrix is not None:
Expand Down

0 comments on commit 4f1a15b

Please sign in to comment.