sciv 0.0.80__py3-none-any.whl → 0.0.82__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sciv/tool/_algorithm_.py CHANGED
@@ -1023,7 +1023,10 @@ def calculate_fragment_weighted_accessibility(input_data: dict, block_size: int
1023
1023
 
1024
1024
  ul.log(__name__).info("Calculate expected counts matrix ===> (numerator)")
1025
1025
  global_scale_data = vector_multiply_block_storage(row_sum, col_sum, block_size=block_size)
1026
- global_scale_data = global_scale_data.astype(np.float32)
1026
+
1027
+ if block_size <= 0:
1028
+ global_scale_data = global_scale_data.astype(np.float32)
1029
+
1027
1030
  del row_sum, col_sum
1028
1031
 
1029
1032
  global_scale_data /= all_sum * 1.0
@@ -1034,7 +1037,7 @@ def calculate_fragment_weighted_accessibility(input_data: dict, block_size: int
1034
1037
  overlap_matrix = to_dense(overlap_matrix)
1035
1038
  global_scale_data = global_scale_data.dot(overlap_matrix)
1036
1039
 
1037
- global_scale_data[global_scale_data != 0] = global_scale_data[global_scale_data != 0].min() / 2
1040
+ global_scale_data[global_scale_data == 0] = global_scale_data[global_scale_data != 0].min() / 2
1038
1041
 
1039
1042
  ul.log(__name__).info("Calculate fragment weighted accessibility.")
1040
1043
  init_score = to_dense(init_score)
@@ -1127,7 +1130,10 @@ def calculate_init_score_weight(
1127
1130
 
1128
1131
  ul.log(__name__).info("Calculate expected counts matrix ===> (numerator)")
1129
1132
  global_scale_data = vector_multiply_block_storage(row_sum, col_sum, block_size=block_size)
1130
- global_scale_data = global_scale_data.astype(np.float32)
1133
+
1134
+ if block_size <= 0:
1135
+ global_scale_data = global_scale_data.astype(np.float32)
1136
+
1131
1137
  del row_sum, col_sum
1132
1138
 
1133
1139
  global_scale_data /= all_sum * 1.0
@@ -1139,7 +1145,7 @@ def calculate_init_score_weight(
1139
1145
  global_scale_data = global_scale_data.dot(overlap_matrix)
1140
1146
  del overlap_matrix
1141
1147
 
1142
- global_scale_data[global_scale_data != 0] = global_scale_data[global_scale_data != 0].min() / 2
1148
+ global_scale_data[global_scale_data == 0] = global_scale_data[global_scale_data != 0].min() / 2
1143
1149
 
1144
1150
  ul.log(__name__).info("Calculate fragment weighted accessibility.")
1145
1151
  _init_trs_ncw_ = to_dense(_init_trs_ncw_)
@@ -1147,7 +1153,7 @@ def calculate_init_score_weight(
1147
1153
 
1148
1154
  del global_scale_data
1149
1155
 
1150
- da_peaks_adata.obsm["cluster_weight"] = to_sparse(_cluster_weight_)
1156
+ da_peaks_adata.obsm["cluster_weight"] = to_dense(_cluster_weight_, is_array=True)
1151
1157
  del _cluster_weight_
1152
1158
 
1153
1159
  ul.log(__name__).info("Broadcasting the weight factor to the cellular level")
@@ -1157,9 +1163,7 @@ def calculate_init_score_weight(
1157
1163
 
1158
1164
  for cluster in da_peaks_adata.obs_names:
1159
1165
  mask = cluster_series == cluster
1160
- _cell_type_weight_[mask, :] = to_dense(
1161
- da_peaks_adata[cluster, :].obsm["cluster_weight"], is_array=True
1162
- ).flatten().astype(np.float32)
1166
+ _cell_type_weight_[mask, :] = da_peaks_adata[cluster, :].obsm["cluster_weight"].flatten().astype(np.float32)
1163
1167
 
1164
1168
  ul.log(__name__).info("Calculate initial trait relevance scores")
1165
1169
  _init_trs_weight_ = np.multiply(_init_trs_ncw_, _cell_type_weight_)
sciv/tool/_matrix_.py CHANGED
@@ -449,10 +449,10 @@ def matrix_operation_memory_efficient(
449
449
  result_chunk = chunk1.multiply(chunk2)
450
450
  elif operation == '/':
451
451
  # Sparse matrix division: convert to dense, perform element-wise division, then convert back to sparse
452
- dense_chunk1 = chunk1.todense()
452
+ dense_chunk1 = chunk1 if isinstance(chunk1, dense_data) else chunk1.todense()
453
453
 
454
454
  if isinstance(data2, matrix_data):
455
- dense_chunk2 = chunk2.todense()
455
+ dense_chunk2 = chunk2 if isinstance(chunk2, dense_data) else chunk2.todense()
456
456
  dense_chunk2[dense_chunk2 == 0] = default
457
457
  else:
458
458
  dense_chunk2 = data2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sciv
3
- Version: 0.0.80
3
+ Version: 0.0.82
4
4
  Summary: Unveiling the pivotal cell types involved in variant function regulation at a single-cell resolution
5
5
  Project-URL: github, https://github.com/YuZhengM/sciv
6
6
  Author-email: Zheng-Min Yu <yuzmbio@163.com>
@@ -27,13 +27,13 @@ sciv/preprocessing/_scanpy_.py,sha256=mmkk4cMCzJCziF49RnOuXBiF4frS6aSiwZdUmfDAg4
27
27
  sciv/preprocessing/_scvi_.py,sha256=ZIDkQ_4deYmzSMiAbu5C3j_jMMl7hBTFLCBXHCNj3B4,10332
28
28
  sciv/preprocessing/_snapatac_.py,sha256=Dq8CHF7Psl3CQszaEokQYO56Oe2uzyWOy_cGlaOywfc,27798
29
29
  sciv/tool/__init__.py,sha256=WXzHkWt6RgBC3qqD-98nR5wQmt6oC850ox_VpMrapSU,2468
30
- sciv/tool/_algorithm_.py,sha256=ggMW1tWxojQElbZcSdugHwwOm68KGFvuujtV7Zg-n4A,48003
31
- sciv/tool/_matrix_.py,sha256=NDQf7yTuN4_GaKL7jK5i1BGYCIOGFQHcmpWgQkuquK8,24230
30
+ sciv/tool/_algorithm_.py,sha256=6xLGB1-FRfRiHSCVb_tHvzY_N-RoMZ79p0O2fEio688,48030
31
+ sciv/tool/_matrix_.py,sha256=O1EAhA9wxh06P_eOxEBesK7kO7IExKlhH6uJzGh1HBM,24322
32
32
  sciv/tool/_random_walk_.py,sha256=98HLa9X2xx3Tj7VKKwQ2oS-CWL7HbOURAXiYKky2OYs,47338
33
33
  sciv/util/__init__.py,sha256=nOxZ8if27X7AUJ6hZwTwxOJwIBJb0obWlHjqCzjg_Gc,1964
34
34
  sciv/util/_constant_.py,sha256=w0wKQd8guLd1ZTW24_5aECrWsIWDiNQmEpLsWlHar1A,3000
35
35
  sciv/util/_core_.py,sha256=ZD2uSnEBHVu0i9TmXWzri_3bXZzYKnIZk818gW3zadE,14751
36
- sciv-0.0.80.dist-info/METADATA,sha256=YIURiNcqDzxUamWuaHg89UIvX4rsDHR4XrKs4S6jAMQ,3465
37
- sciv-0.0.80.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
38
- sciv-0.0.80.dist-info/licenses/LICENSE,sha256=4UvHVf3qCOZjHLs4LkYz8u96XRpXnZrpTKrkUQPs5_A,1075
39
- sciv-0.0.80.dist-info/RECORD,,
36
+ sciv-0.0.82.dist-info/METADATA,sha256=JTluLyVcmc6vYfTh76ejiHiT0fnqSEVJa9XngVEGj2U,3465
37
+ sciv-0.0.82.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
38
+ sciv-0.0.82.dist-info/licenses/LICENSE,sha256=4UvHVf3qCOZjHLs4LkYz8u96XRpXnZrpTKrkUQPs5_A,1075
39
+ sciv-0.0.82.dist-info/RECORD,,
File without changes