snippy
snippy copied to clipboard
ploidy set to 2? And failing at bcftools consensus
Hey, I have 2 inquiries. I am running snippy to detect variance between multiple copies of the same part of a bacterial genome.
- I saw the log (attached) of snippy and noticed the following command is being executed for freebayes-parallel:
freebayes-parallel reference/ref.txt 35 -p 2 -P 0 -C 2 -F 0.05 --min-coverage 10 --min-repeat-entropy 1.0 -q 13 -m 60 --strict-vcf -f reference/ref.fa snps.bam > snps.raw.vcf
the key thing is the-p 2
since snippy is for haploid genomes shouldn't this be-p 1
or is-p 2
is being used intentionally and the pipeline has been modified according to that? - While running snippy, it is failing at bcftools consensus step (log and std error attached). For some reason, snippy is taking the specified
outdir
as an input for the--sample
flag.
Command used:
snippy --cpus 35 --ram 100 --outdir trial5_with_bam_BQRS_tmp_deleted_snippy_4.6 --ref ~/ext_project/NP_pathway.fasta --bam ~/ext_project/SNP_calculation/trial_2/NP_seq_aligned_sorted_markedDup_BQSR.bam
snps.log snippyerr.txt dependencies.txt
Thanks :smile:
I noticed you have the error about 0 variants being called in your snps.log:
Converted 0 SNPs to TAB format.
And there also seems to be some error output in snippyerr.txt showing from vt normalize
:
normalize v0.5
options: input VCF file -
[o] output VCF file -
[w] sorting window size 10000
[m] no fail on masked reference inconsistency false
[n] no fail on reference inconsistency false
[q] quiet false
[d] debug false
[r] reference FASTA file reference/ref.fa
Did you recently install/update snippy (in the last month), and could this possibly be related to Issue #410? I encountered something similar and possibly that fix might work for you!
Update: I just got a similar error when using a bam file as input. For me, this was caused because the name of the bam (SAMN02442721.bam
) did not match the RG tag inside the bam (SM:SRR1048905
) which in turn did not match the output directory (SAMN02442721
).
From snippy's documentation:
--rgid will set the Read Group (RG) ID (ID) and Sample (SM) in the BAM and VCF file. If not supplied, it will will use the --outdir folder name for both ID and SM
Two possible solutions that worked for me:
- Make the bam filename and its internal RG tag identical. In my case (
SAMN02442721.bam
becomesID:SAMN02442721
andSM:SAMN02442721
) with the toolsamtools addreplacerg
. - Figure out the RG tag of your input bam (ex.
SRR1048905
) and use that as the --rgid parameter with snippy (ex.--rgid SRR1048905
.
Hey @ktmeaton thanks a lot for your help. I tried the following 2 approaches:
- conda install -c bioconda/label/cf201901 vt==2015.11.10
- Naming my
bam
file same as the@RG
tag as well as using thergid
flag while runningsnippy
Unfortunately, none of them worked and I am getting the same error with VT andsnippy
is crashing at the same spot ofbcftools consensus
as before.
Hi,any updates on this?