Snippy issue on my GVL


I have been trying to use snippy with a single pair of reads and a reference sequence downloaded from genbank:
ubuntu@uobjune17:~$ snippy --outdir mysnps --ref EC958.chr2.fasta --pe1 1_1a_1.fastq.gz --pe2 1_1a_2.fastq.gz
However, I get the following error message- see below. I have tried the same command on my colleague’s GVL machine and it worked - so I suspect there may be an issue with my GVL. Can you help?

Ed Bevan

CLIMB site: Birmingham
Instance or volume name: uobjune17
Any error messages: Error running command, check mysnps/snps.log. This contains the following:
bwa index reference/ref.fa

[bwa_index] Pack FASTA… 0.06 sec
[bwa_index] Construct BWT for the packed sequence…
[bwa_index] 1.52 seconds elapse.
[bwa_index] Update BWT… 0.04 sec
[bwa_index] Pack forward-only FASTA… 0.04 sec
[bwa_index] Construct SA from BWT and Occ… 0.61 sec
[main] Version: 0.7.15-r1140
[main] CMD: bwa index reference/ref.fa
[main] Real time: 2.439 sec; CPU: 2.272 sec

mkdir reference/genomes && cp -f reference/ref.fa reference/genomes/ref.fa

mkdir reference/ref && bgzip -c reference/ref.gff > reference/ref/genes.gff.gz

(bwa mem -v 2 -M -R ‘@RG ID:snps SM:snps’ -t 8 reference/ref.fa /home/ubuntu/1_1a_1.fastq.gz /home/ubuntu/1_1a_2.fastq.gz | samtools view -@ 8 -F 3844 -q 60 -S -b -u -T reference/ref.fa - | samtools sort -O bam -o snps.bam -@ 8 -)

[main] Version: 0.7.15-r1140
[main] CMD: bwa mem -v 2 -M -R @RG ID:snps SM:snps -t 8 reference/ref.fa /home/ubuntu/1_1a_1.fastq.gz /home/ubuntu/1_1a_2.fastq.gz
[main] Real time: 0.007 sec; CPU: 0.004 sec

samtools index snps.bam

samtools depth -q 20 snps.bam | bgzip > snps.depth.gz

tabix -s 1 -b 2 -e 2 snps.depth.gz reference/ref.fa.fai 162341 > reference/ref.txt

freebayes-parallel reference/ref.txt 8 -p 1 -q 20 -m 60 --min-coverage 10 -V -f reference/ref.fa snps.bam > snps.raw.vcf

/home/linuxbrew/.linuxbrew/bin/freebayes-parallel: line 40: …/vcflib/scripts/vcffirstheader: No such file or directory
/home/linuxbrew/.linuxbrew/bin/freebayes-parallel: line 40: …/vcflib/bin/vcfstreamsort: No such file or directory
terminate called after throwing an instance of 'std::out_of_range’
what(): basic_string::substr
/home/linuxbrew/.linuxbrew/bin/freebayes-parallel: line 40: 13614 Exit 141 ( cat “$regionsfile” | parallel -k -j “$ncpus” “${command[@]}” --region {} )
13615 Exit 127 | …/vcflib/scripts/vcffirstheader
13617 Exit 127 | …/vcflib/bin/vcfstreamsort -w 1000
13619 Aborted (core dumped) | vcfuniq


EDIT: Better fix for this problem here

Hi Ed - I’m pretty sure that this is a problem with the way that freebayes-parallel package is installed is installed by Linuxbrew.

freebayes-parallel is just a Bash wrapper around GNU Parallel and some of the freebayes programs, so is relatively simple to change it to make it do what you want it to.

I suggest you run brew upgrade to pull in any package updates first, then:

  1. Use which to find the current location of the freebayes-parallel executable:
    which freebayes-parallel

  2. Edit the executable (in my case /home/linuxbrew/.linuxbrew/bin/freebayes-parallel) using nano and make the following changes on lines 39 and 40, making sure you save on your way out.

    | ../vcflib/bin/vcfstreamsort -w 1000 | vcfuniq # remove duplicates at region edges```
```) | vcffirstheader \
    | vcfstreamsort -w 1000 | vcfuniq # remove duplicates at region edges```

This isn't necessarily the best and most permanent way to solve this, but it should get you going with Nullarbor for the time being. 

Freebayes should get an update from the brew packagers at some point, and then you should just be able to run `brew upgrade freebayes`, and your patched freebayes-parallel will be replaced by the updated one.


Thanks Matt. So I’m in nano, I have made the suggested changes but when I go ^O to save, I get:
[ Error writing /home/linuxbrew/.linuxbrew/bin/freebayes-parallel: Permission ]
Should I change the filename? Not sure what is going on here. My first nano experience.



Strange one - if you’re using the “ubuntu” user, then you should have read and write permissions in that directory.

Could you please just check (with the whoami command) that you’re logged in to your instance as ubuntu? If you’re using the lubuntu desktop then there might be some confusion about which account you’re using…


Yes whoami confirms I am ubuntu. To clarify… in nano I made the changes, then ^O and press enter and I get the message
[ Error writing /home/linuxbrew/.linuxbrew/bin/freebayes-parallel: Permission ]
I can’t exit and save either


Okay - exit nano (press ctrl+x and don’t save the buffer when prompted) and do the same edits with sudo nano /home/linuxbrew/.linuxbrew/bin/freebayes-parallel. You should then be able to ctrl+x to save and quit.


Thanks Matt! Snippy seems to be working now :slight_smile:


The freebayes formula in the homebrew/science keg has now been updated and this problem fixed (thanks to Torsten!).

You can pull these changes into your install of freebayes by running:

brew upgrade freebayes