Hello everyone
i am facing a problem while run a command to call variant, i am using sorted.bam file (generated by picard-tools-1.119)
$SOFTWARE/samtools mpileup -d8000 -ugf $DATABASE/hg19.fa $DATA/1.sorted.bam |$SOFTWARE1/bcftools call -m |$SOFTWARE1/vcfutils.pl varFilter -Q 20 - > samtool.vcf
i got this error every time Note: Neither --ploidy nor --ploidy-file given, assuming all sites are diploid [mpileup] 1 samples in 1 input files
anyone can help me how to solve this issue ?
Thanks
Looks like a warning to me, does the command produce the expected output?
No it give a vcf file having 3k which having following info and then stopped
In other words, your real question is, "Why am I getting no called variants with samtools mpileup? I don't receive any error message." The answer to that is to first look at the alignments in IGV or something like that and see if you reasonably should be getting any.
Hi Devon Ryan
i think there is no problem with my sorted.bam because i used this file for GATKs to call SNPs
Hello everyone,
I'm calling variants for the first time myself and am generating a bcf file very much like Aamiralizai's, in which (in my understanding) no variants were called. I know I have callable SNPs, however, and so I suspect I am making a simple error in usage. Was there a solution to the original poster's question?
Here's what I did:
1) Downloaded a bam file using sra-toolkit sam-dump for the accession number ERR854867.
2) Manually download the reference genome fasta file (
reference.fasta
) against which the reads were aligned (N. gonorrhoeae FA 1090), which is here: https://www.ncbi.nlm.nih.gov/nuccore/59800473. I manually checked and found that the position (field #4) in the bam reads indeed matches which ASCII char in this fasta file the read aligns to. The reads are also have the same ID (SAM field #1) and position as those displayed in the NCBI's genome browser (https://www.ncbi.nlm.nih.gov/projects/sviewer/?id=NC_002946.2&srz=ERR854867).3) Change the name in the fasta header (
>NC_002946.2
to>gi|59800473|ref|NC_002946.2|
) because the bam file has the latter name in its@SQ
header, and bcftools will throw an error otherwise.4a) Run bcftools mpileup. I used --ploidy 1 because bacteria are haploid. This gives an empty VCF file like Aamiralizai's file.
4b) This also gives an empty BCF file.
4c) Using two bam files gives a BCF file containing a line for every 1 bp in the reference genome... I don't know if the BCF is correct.
And... I think I found the answer. I was using
bcftools view -h foo.bcf
instead ofbcftools view foo.bcf
. This led me to think my file was empty, but in reality bcftools was showing me only the headers. This behavior is different thansamtools view -h foo.bam
; in that software, the '-h' flag includes headers that would otherwise be hidden.