M3Drop 0.4.40__py3-none-any.whl → 0.4.42__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.
m3Drop/diagnosticsGPU.py CHANGED
@@ -64,40 +64,19 @@ def NBumiFitBasicModelGPU(
64
64
  if start_idx == end_idx:
65
65
  continue
66
66
 
67
- # Process in smaller sub-chunks if needed
68
- max_elements = 5_000_000 # Process max 5M elements at a time
69
-
70
- if end_idx - start_idx > max_elements:
71
- # Process in sub-chunks
72
- for sub_start in range(start_idx, end_idx, max_elements):
73
- sub_end = min(sub_start + max_elements, end_idx)
74
-
75
- data_slice = h5_data[sub_start:sub_end]
76
- indices_slice = h5_indices[sub_start:sub_end]
77
-
78
- data_gpu = cp.asarray(data_slice, dtype=cp.float64)
79
- indices_gpu = cp.asarray(indices_slice)
80
-
81
- # Accumulate the sum of squares for each gene
82
- cp.add.at(sum_x_sq_gpu, indices_gpu, data_gpu**2)
83
-
84
- # Free GPU memory
85
- del data_gpu, indices_gpu
86
- cp.get_default_memory_pool().free_all_blocks()
87
- else:
88
- # Original processing for smaller chunks
89
- data_slice = h5_data[start_idx:end_idx]
90
- indices_slice = h5_indices[start_idx:end_idx]
67
+ # Original processing for smaller chunks
68
+ data_slice = h5_data[start_idx:end_idx]
69
+ indices_slice = h5_indices[start_idx:end_idx]
91
70
 
92
- data_gpu = cp.asarray(data_slice, dtype=cp.float64)
93
- indices_gpu = cp.asarray(indices_slice)
71
+ data_gpu = cp.asarray(data_slice, dtype=cp.float64)
72
+ indices_gpu = cp.asarray(indices_slice)
94
73
 
95
- # Accumulate the sum of squares for each gene
96
- cp.add.at(sum_x_sq_gpu, indices_gpu, data_gpu**2)
97
-
98
- # Clean up
99
- del data_gpu, indices_gpu
100
- cp.get_default_memory_pool().free_all_blocks()
74
+ # Accumulate the sum of squares for each gene
75
+ cp.add.at(sum_x_sq_gpu, indices_gpu, data_gpu**2)
76
+
77
+ # Clean up
78
+ del data_gpu, indices_gpu
79
+ cp.get_default_memory_pool().free_all_blocks()
101
80
 
102
81
  print(f"Phase [2/2]: COMPLETE ")
103
82
 
@@ -146,8 +125,9 @@ def NBumiCheckFitFSGPU(
146
125
  print(f"FUNCTION: NBumiCheckFitFS() | FILE: {cleaned_filename}")
147
126
 
148
127
  # [GOVERNOR INTEGRATION] Adaptive chunk sizing
128
+ # [CRITICAL FIX] Increased multiplier to 20.0 to prevent VRAM overflow during dense expansion
149
129
  if chunk_size is None:
150
- chunk_size = get_optimal_chunk_size(cleaned_filename, multiplier=5.0, is_dense=True)
130
+ chunk_size = get_optimal_chunk_size(cleaned_filename, multiplier=20.0, is_dense=True)
151
131
 
152
132
  # --- Phase 1: Initialization ---
153
133
  print("Phase [1/2]: Initializing parameters and arrays on GPU...")
@@ -344,6 +324,7 @@ def NBumiCompareModelsGPU(
344
324
 
345
325
  data_gpu /= size_factors_for_chunk[row_indices]
346
326
 
327
+ # [RESTORED LEGACY LOGIC] Rounding matches original file.
347
328
  data_cpu = np.round(data_gpu.get())
348
329
 
349
330
  num_cells_in_chunk = end_row - i
@@ -378,7 +359,8 @@ def NBumiCompareModelsGPU(
378
359
 
379
360
  print("Phase [3/4]: Evaluating fits of both models on ORIGINAL data...")
380
361
  # [GOVERNOR INTEGRATION] Chunk size for check fit
381
- chunk_size_check = get_optimal_chunk_size(cleaned_filename, multiplier=5.0, is_dense=True)
362
+ # [CRITICAL FIX] Multiplier 20.0 prevents VRAM overflow
363
+ chunk_size_check = get_optimal_chunk_size(cleaned_filename, multiplier=20.0, is_dense=True)
382
364
 
383
365
  check_adjust = NBumiCheckFitFSGPU(cleaned_filename, fit_adjust, suppress_plot=True, chunk_size=chunk_size_check)
384
366
 
@@ -456,11 +438,6 @@ def NBumiPlotDispVsMeanGPU(
456
438
  ):
457
439
  """
458
440
  Generates a diagnostic plot of the dispersion vs. mean expression.
459
-
460
- Args:
461
- fit (dict): The 'fit' object from NBumiFitModelGPU.
462
- suppress_plot (bool): If True, the plot will not be displayed on screen.
463
- plot_filename (str, optional): Path to save the plot. If None, not saved.
464
441
  """
465
442
  print("FUNCTION: NBumiPlotDispVsMean()")
466
443
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: M3Drop
3
- Version: 0.4.40
3
+ Version: 0.4.42
4
4
  Summary: A Python implementation of the M3Drop single-cell RNA-seq analysis tool.
5
5
  Home-page: https://github.com/PragalvhaSharma/m3DropNew
6
6
  Author: Tallulah Andrews
@@ -21,6 +21,7 @@ Requires-Dist: matplotlib-venn>=0.11
21
21
  Requires-Dist: memory_profiler>=0.60.0
22
22
  Requires-Dist: numpy>=1.21.0
23
23
  Requires-Dist: pandas>=1.5.0
24
+ Requires-Dist: py-cpuinfo
24
25
  Requires-Dist: scanpy>=1.9.0
25
26
  Requires-Dist: scikit-learn>=1.0.0
26
27
  Requires-Dist: scipy>=1.8.0
@@ -2,11 +2,11 @@ m3Drop/__init__.py,sha256=yaUXhUArnwgLf01Zlpqa5qm9K1aByGqQupIoCaLYiDw,2462
2
2
  m3Drop/coreCPU.py,sha256=3kPYlSVlYrJEhRUCIoVzmR8CYBaHpxVM5nx-3YQI4d4,17204
3
3
  m3Drop/coreGPU.py,sha256=k7A06VNgfJ59J8g1VpfKxhTIKrEbW7Bj8pTbQqHaQL8,24571
4
4
  m3Drop/diagnosticsCPU.py,sha256=BecOKTz2GDjzjs9ycXYsyrSHi2UVgsM58RBuNE62vmU,14273
5
- m3Drop/diagnosticsGPU.py,sha256=m_r7mZ4s0h-YwJEriucrACNeDQxWPZHvd8RAmsXQYXE,19980
5
+ m3Drop/diagnosticsGPU.py,sha256=0tDHZHVS14qg46p1AZcdX8DOnGmbYJ7ha0FFfKtmENg,18891
6
6
  m3Drop/normalizationCPU.py,sha256=4ulCrDZZjxVFh2y0i4ayPkNCsZYaOP-Xq2Dnzu9WXtg,5697
7
7
  m3Drop/normalizationGPU.py,sha256=r5gvJFkabEfCfIsVdpJzWGqve_Iy57EYsEyiLfDo8Mo,8539
8
- m3drop-0.4.40.dist-info/licenses/LICENSE,sha256=44Iqpp8Fc10Xzd5T7cT9UhO31Qftk3gBiCjtpwilP_k,1074
9
- m3drop-0.4.40.dist-info/METADATA,sha256=rL09G9SvQ_JP_OEw-xrMNle-92XQFzn2-cHDyXkPpH4,5161
10
- m3drop-0.4.40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- m3drop-0.4.40.dist-info/top_level.txt,sha256=AEULFEFIgFtAwS-KBlIFoYXrqczX_rwqrEcdK46GIrA,7
12
- m3drop-0.4.40.dist-info/RECORD,,
8
+ m3drop-0.4.42.dist-info/licenses/LICENSE,sha256=44Iqpp8Fc10Xzd5T7cT9UhO31Qftk3gBiCjtpwilP_k,1074
9
+ m3drop-0.4.42.dist-info/METADATA,sha256=SLSv2kLZz9GJjzECBWqEOgQGzRhJOtRzYzdCr8WVO5U,5188
10
+ m3drop-0.4.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ m3drop-0.4.42.dist-info/top_level.txt,sha256=AEULFEFIgFtAwS-KBlIFoYXrqczX_rwqrEcdK46GIrA,7
12
+ m3drop-0.4.42.dist-info/RECORD,,