raphael-group/STARCH

STARCH attempts to submit float value for multi-processing

wong-nw opened this issue · 2 comments

Hi all,

I'm trying to run STARCH directly from command line and keep encountering this error. This occurs when attempting to run with the included hg19 ordered gene file and the hg38 ordered gene file from UCSC browser, as well as direct inputs from the raw 10X SpaceRanger outputs and processed/filtered count tables from Seurat. Error tracing leads me to multiprocessing, and I'm not sure where to go from there.

Thanks,

-Nathan

`

python run_STARCH.py -i STARCH_input.csv -o STARCH_out -outdir STARCH_dir -p Visium -t 1 -c 3
...
INFO:root:zero percentage 0.7563686458768539
INFO:root:selected bin size: 58
INFO:root:preprocess 9221 7404 (9221, 7404)
INFO:root:done preprocessing...
INFO:root:getting spot network...
INFO:root:Using Visium platform layout.
INFO:root:initializing labels...
/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/scRNA4/lib/python3.9/site-packages/sklearn/cluster/_kmeans.py:870: FutureWarning: The default value of n_init will change from 10 to 'auto' in 1.4. Set the value of n_init explicitly to suppress the warning
warnings.warn(
INFO:root:getting params...
INFO:root:0.0
Traceback (most recent call last):
File "/vf/users/CCBR/projects/ccbr1226/spatialAnalysis/inferCNV/STARCH/run_STARCH.py", line 40, in
operator = STARCH(i,n_clusters=n_clusters,num_states=3,normal_spots=normal_spots,beta_spots = beta_spot,nthreads=nthreads,gene_mapping_file_name=gene_mapping_file_name, platform=args.platform)
File "/vf/users/CCBR/projects/ccbr1226/spatialAnalysis/inferCNV/STARCH/STARCH.py", line 141, in init
self.init_params(d/10,nthreads)
File "/vf/users/CCBR/projects/ccbr1226/spatialAnalysis/inferCNV/STARCH/STARCH.py", line 459, in init_params
pool = mp.Pool(nthreads)
File "/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/scRNA4/lib/python3.9/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/scRNA4/lib/python3.9/multiprocessing/pool.py", line 212, in init
self._repopulate_pool()
File "/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/scRNA4/lib/python3.9/multiprocessing/pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/data/CCBR_Pipeliner/db/PipeDB/Conda/envs/scRNA4/lib/python3.9/multiprocessing/pool.py", line 318, in _repopulate_pool_static
for i in range(processes - len(pool)):
TypeError: 'float' object cannot be interpreted as an integer
`

i have also met this problem on 10x data. have you solve it?

@bio-Pixel I went into the STARCH.py file and manually changed lines 459, 571, and 615 to explicitly cast nthreads as an int with something like this:

pool=mp.Pool(int(nthreads))

I haven't submitted a pull request for @Congm12 yet, but it might be worth looking into