Running this kind of command gives seg fault:
bcftools mpileup -s sample1,sample2 -f genome.fasta sample1.bam sample2.bam
However this works (without -s
):
bcftools mpileup -f genome.fasta sample1.bam sample2.bam
bcftools 1.7
Using htslib 1.7-2
Any ideas why this could be?
Thanks,
Gregor
Thank you Pierre, silly me, updated to the latest version now.
There is no more seg fault, however I get this now:
[mpileup] failed to find a file header with usable read groups
And like you wrote, there is no flag @RG in the bam files. Can you help me out, what is the easies way to set this in the bam files? I suppose I can set each bam file with it's unique RG? Thanks
Adding Read Groups To Bam Files
Thanks for all the help, however I still get the same error after adding RG to bam files.
bcftools mpileup -s sample1,sample2 -f genome.fasta sample1.bam sample2.bam
If I do
samtools view -H sample1.bam | grep "@RG"
I get:@RG ID:sample1
, same for sample2. So my bam files have RG.Any ideas on why this still doesn't work? If I ommit the
-s sample1,sample2
everything works.Thanks, Gregor
and you should have
Thanks, and haha, this will take another over-night job to add this to all the bam files I have :-)
Can I ask, does bctools consider the @RG SN flag from bam files if present? If yes, does specifying the
-s sample1,sample2
override the info from the bam files? But then again, why it doesn't work with the-s
if bam files don't have the RG field. A little bit confusing for me, Thanksthe sample name is defined in RG/SN not RG/id, see the sam specification.
Thanks Pierre yes I understand that, however does the
bcftools -s
set the sample names for VCF output or just check if they match the ones defined in bam RG:SN? I just find it confusing, intuitively -s would probably set them, and if not, why doesn't bcftools just read them from the bam files? And why with -s the bam files would also need an RG:SN if -s would set them. Confusing to me.the option will only use the samples defined with
-s
. You could have only one bam with 1000 samples.-s "S1,S2"
would use only the samples S1 and S2.