Skip to content

Commit

Permalink
csr
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kofman committed Dec 20, 2024
1 parent d156d7c commit e0ae4b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def pivot_edits_to_sparse(df, output_folder):
pivoted_df = pivoted_df.fillna(0)

# Convert to a sparse matrix
sparse_matrix = sp.csr_matrix(pivoted_df.values)
sparse_matrix = csr_matrix(pivoted_df.values)

# Create an AnnData object
adata = ad.AnnData(
Expand Down Expand Up @@ -993,7 +993,7 @@ def merge_files_by_chromosome(args):
df = pd.read_csv(merged_file, sep='\t', index_col=0) # Assuming first column is positions

# Convert DataFrame to sparse matrix
sparse_matrix = sp.csr_matrix(df.values) # Use csr_matrix here
sparse_matrix = csr_matrix(df.values)

# Create AnnData object with sparse matrix
adata = sc.AnnData(sparse_matrix)
Expand Down

0 comments on commit e0ae4b0

Please sign in to comment.