snippy icon indicating copy to clipboard operation
snippy copied to clipboard

ploidy set to 2? And failing at bcftools consensus

Open Sidduppal opened this issue 3 years ago • 4 comments

Hey, I have 2 inquiries. I am running snippy to detect variance between multiple copies of the same part of a bacterial genome.

  1. 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?
  2. 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:

Sidduppal avatar Jul 20 '20 15:07 Sidduppal

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!

ktmeaton avatar Jul 25 '20 17:07 ktmeaton

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:

  1. Make the bam filename and its internal RG tag identical. In my case (SAMN02442721.bam becomes ID:SAMN02442721 and SM:SAMN02442721) with the tool samtools addreplacerg.
  2. Figure out the RG tag of your input bam (ex. SRR1048905) and use that as the --rgid parameter with snippy (ex. --rgid SRR1048905.

ktmeaton avatar Jul 28 '20 16:07 ktmeaton

Hey @ktmeaton thanks a lot for your help. I tried the following 2 approaches:

  1. conda install -c bioconda/label/cf201901 vt==2015.11.10
  2. Naming my bam file same as the @RG tag as well as using the rgid flag while running snippy Unfortunately, none of them worked and I am getting the same error with VT and snippy is crashing at the same spot of bcftools consensus as before.

Sidduppal avatar Jul 28 '20 23:07 Sidduppal

Hi,any updates on this?

yayahoho1 avatar Jul 21 '22 07:07 yayahoho1