single-cell-genetics / cellSNP

Pileup biallelic SNPs from single-cell and bulk RNA-seq data
Apache License 2.0
76 stars 11 forks source link

No SNPs called in more than 1 barcodes #8

Open saisomesh2594 opened 5 years ago

saisomesh2594 commented 5 years ago

Hello,

I am running cellSNP in mode 2 for my bam file with the following command:

cellSNP -s <my coordinate sorted bam file> \
-O <output directory> \
-b <barcode file - one barcode on each line> \
-p 10 \
--cellTAG=None \
--UMItag=UB \
--minMAF 0.1 \
--minCOUNT 100 \
--chrom=chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19,chr20,chr21,chr22,chrX,chrY

The barcode file I am providing is a test file with only 5 barcodes. But, however the output cellSNP.cells.vcf has SNPs piled up from all the chromosomes only for the 1st barcode in the file.

What do you think could be the reason for this ? Please see below a snapshot of my bam file: image

Any help would be appreciated.

Thanks, Somesh

huangyh09 commented 5 years ago

Hi Somesh,

From you bam file, it looks like that you should specify the --cellTAG=BC (not the default value CB, used in 10x data). If you put it None, it assume this is a bulk sample so you will only see the first cell. Let me know if it works or not. Yuanhua

saisomesh2594 commented 5 years ago

Hi Yuanhua,

Thank you for your reply. I did try with --cellTAG=BC , however, it failed to call SNPs on any of the barcodes. This is contrary to my previous issue where a SNP was called in at least one cell.

Somesh

huangyh09 commented 5 years ago

Hi Somesh,

It is a bit odd. Could you try the following diagnosis, see if you can get the same reads (for position 14447) as you showed above:

import pysam
import cellSNP
samFile = pysam.AlignmentFile(YourBamFile.bam, "rb") # use "rc" for cram or "r" for sam
_read1 = cellSNP.utils.pileup_utils.fetch_bases(samFile, "chr1", 14447, cell_tag="BC",
UMI_tag="UB", min_MAPQ=20, max_FLAG=255, min_LEN=30)

_read2 = cellSNP.utils.pileup_utils.fetch_bases(samFile, "chr1", 14447, cell_tag=None,
UMI_tag=None, min_MAPQ=20, max_FLAG=255, min_LEN=30)

print(_read1)
print(_read2)