single-cell-genetics / cellsnp-lite

Efficient genotyping bi-allelic SNPs on single cells
https://cellsnp-lite.readthedocs.io
Apache License 2.0
124 stars 11 forks source link

single cell RNA-seq cellsnp lite error mode 2b+ 1a #75

Open drlaurenwasson opened 1 year ago

drlaurenwasson commented 1 year ago

Hi, I am trying to demultiplex a single cell RNA-seq bam file with two sets of cells. We combined male and female cells into one library and are trying to demultiplex using SNPs. I was told to use cell-snplite and then use those results in vireo, but I need some help.

I first obtained the SNPs using mode 2b:

cellsnp-lite -s 20220811-B115-HC-HCB1225-CombinedHEF_20220906161842.sorted.bam -O HCB1225 -p 22 --minMAF 0.1 --minCOUNT 100 --cellTAG None --UMItag None --gzip

I then used those SNPs to genotype in 1a cellsnp-lite -s 20220811-B115-HC-HCB1225-CombinedHEF.sortedCBZ.bam -b 20220811-B115-HC-HCB1225-CombinedHEF_20220906161842-allcellbarcodes.txt -O HCB1225_1b -R HCB1225/cellSNP.base.vcf -p 20 --minMAF 0.1 --minCOUNT 20 --genotype --UMItag None

The bam files are different because I had to add the cell barcodes to the bam in a way cell-snp lite would understand (Added a CB:Z: tag). I provided a barcode list, and the VCF generated from the run before. I get the following warnings: W::vcf_parse] Contig '2' is not defined in the header. (Quick workaround: index the file with tabix.) (for each contig. I did then index the vcf using tabix but I still get that warning)

And then it runs for a while until the end where I get this error: cell snplite failed to merge vcf CELLS Run failed

I would appreciate any help you can provide

hxj5 commented 1 year ago

Hi, you may simply ignore the warnings about "[W::vcf_parse] Contig ...", which are produced by htslib and have little impact on the final results.

For the error of "merging the vcf CELLS", you may try using a new output directory (-O <new dir>) and re-run cellsnp-lite. Alternatively, you may remove the --genotype option, then the output would not include the vcf CELLS file but should still be recognized by vireo.