Skip to content

DErand errors out when -a=sgrna, -b=Negative-Control #3

@liboxun

Description

@liboxun

As described by the title. I got the following error when running DErand with -a = sgrna and -b=Negative-Control (non-targeting sgRNAs).

2025-06-05 11:34:45,760 - pySpade.main - INFO - pySpade version: 0.1.7
2025-06-05 11:34:45,761 - pySpade.main - INFO - Python version: 3.9
2025-06-05 11:34:45,761 - pySpade.main - INFO - Running DErand command ...
2025-06-05 11:34:45,763 - pySpade.DErand - INFO - 70 cpu for parallel computing.
2025-06-05 11:34:45,763 - pySpade.DErand - INFO - Reading transcriptome file.
2025-06-05 11:35:07,015 - pySpade.DErand - INFO - Finished transcriptome normalization.
2025-06-05 11:35:12,412 - pySpade.DErand - INFO - Finished processing sgRNA df.
2025-06-05 11:35:12,422 - pySpade.DErand - INFO - 544 sgRNAs remain to find background cells.
2025-06-05 11:35:18,882 - pySpade.DErand - INFO - 7566 cells as background for differential expression analysis.
2025-06-05 11:35:18,883 - pySpade.DErand - INFO - Start randomization Calculation.
2025-06-05 11:35:18,883 - pySpade.DErand - INFO - Finished 0 iterations.
Traceback (most recent call last):
File "/hpc/group/gersbachlab/boxun.li/Software/miniconda3/envs/py3_pySpade_0.1.6/bin/pySpade", line 8, in
sys.exit(main())
File "/hpc/group/gersbachlab/boxun.li/Software/miniconda3/envs/py3_pySpade_0.1.6/lib/python3.9/site-packages/pySpade/main.py", line 80, in main
_ = m.DE_random_cells(
File "/hpc/group/gersbachlab/boxun.li/Software/miniconda3/envs/py3_pySpade_0.1.6/lib/python3.9/site-packages/pySpade/DErand.py", line 131, in DE_random_cells
sgrna_idx = np.random.choice(np.setxor1d(np.arange(c), NC_idx), size=num_cell, replace=False, p=filter_weight_list) #number (select from idx)
File "mtrand.pyx", line 915, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken

It ran fine if I remove the -b=Negative-Control line (i.e., running default -b).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions