single-cell-genetics / vireo

Demultiplexing pooled scRNA-seq data with or without genotype reference
https://vireoSNP.readthedocs.io
Apache License 2.0
71 stars 27 forks source link

TypeError: '>=' not supported between instances of 'NoneType' and 'int' #75

Open alexisweber opened 1 year ago

alexisweber commented 1 year ago

I generated a cellSNP vcf file from snRNA-Seq comprised of three different donors. I'd like to identify the barcodes belonging to one of the donors using its corresponding genotype. I recently tried to run vireo using the cellSNP vcf and the genotype vcf from one of the donors to identify which barcodes belonged to that donor. However, I received an error from the match_donor_VCF() function, defined in io_utils.py, that the match() function output mm_idx is a NoneType and can't be contrasted to an int class by >=.

The script I ran: CELL_DATA=/u/home/a/alexiswe/project-dhg/CellSNPRun/Ctrl0512CellSNPOut/total_chroms_cellsY.vcf.gz DONOR_GT_FILE=/u/home/a/alexiswe/project-dhg/111822GenotypePlinkables/PLINK_050123_0406_B07_N1644/N1644.vcf.gz OUT_DIR=/u/home/a/alexiswe/project-dhg/CtrlMultiomeVireoOut/Ctrl0512VireoOut /u/home/a/alexiswe/.local/bin/vireo -c $CELL_DATA -d $DONOR_GT_FILE -o $OUT_DIR -N $n_donor -t GT

The error I received: [vireo] Loading cell VCF file ... [vireo] Loading donor VCF file ... Traceback (most recent call last): File "/u/home/a/alexiswe/.local/bin/vireo", line 33, in <module> sys.exit(load_entry_point('vireoSNP==0.5.6', 'console_scripts', 'vireo')()) File "/u/home/a/alexiswe/.local/lib/python3.9/site-packages/vireoSNP/vireo.py", line 160, in main cell_dat, donor_vcf = match_donor_VCF(cell_dat, donor_vcf) File "/u/home/a/alexiswe/.local/lib/python3.9/site-packages/vireoSNP/utils/io_utils.py", line 20, in match_donor_VCF if np.sum(mm_idx == mm_idx) == 0 or np.sum(mm_idx >= 0) == 0: TypeError: '>=' not supported between instances of 'NoneType' and 'int'

huangyh09 commented 1 year ago

Hi,

Thanks for sharing the issue and sorry for the delay in getting back. After some diagnosis, it looks like an uncommon issue when the donor file uses “chr” and the cell file doesn’t, and the SNPs are only partially matched.

Here, I made a quick fix in the new release v0.5.8. Please upgrade and try it again, and see if it resolves the issue.

pip install -U vireoSNP

Yuanhua