Skip to content

Commit

Permalink
Set names when reading LISI CSV files (#380)
Browse files Browse the repository at this point in the history
Fix bug when reading LISI outputs

Co-authored-by: Michaela Mueller <[email protected]>
  • Loading branch information
lazappi and mumichae authored Jul 24, 2023
1 parent cce7aaa commit d9f9e50
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scib/metrics/lisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ def lisi_graph_py(
print("LISI score estimation")

if n_cores > 1:

if verbose:
print(f"{n_cores} processes started.")
pool = mp.Pool(processes=n_cores)
Expand Down Expand Up @@ -448,10 +447,13 @@ def compute_simpson_index_graph(
return lists

# read distances and indices with nan value handling
indices = pd.read_table(index_file, index_col=0, header=None, sep=",")
header = ["index"] + list(range(1, n_neighbors + 1))
indices = pd.read_table(index_file, index_col=0, header=None, sep=",", names=header)
indices = indices.T

distances = pd.read_table(distance_file, index_col=0, header=None, sep=",")
distances = pd.read_table(
distance_file, index_col=0, header=None, sep=",", names=header
)
distances = distances.T

# get cell ids
Expand Down

0 comments on commit d9f9e50

Please sign in to comment.