tseemann / snippy

:scissors: :zap: Rapid haploid variant calling and core genome alignment
GNU General Public License v2.0
474 stars 115 forks source link

Error in bwa step #56

Closed ADGM closed 8 years ago

ADGM commented 8 years ago

I can't get the bwa step to proceed. When it starts running the bwa mem command it returns an error ('Error running command, check snps.log'). It happens when I use fasta or gbk (prokka 1.12 output) as reference input.

[samfaipath] fail to read file ref.fa. [M::mem_pestat] skip orientation FF as there are not enough pairs [M::mem_pestat] analyzing insert size distribution for orientation FR... [M::mem_pestat](25, 50, 75) percentile: (465, 499, 533) [M::mem_pestat] low and high boundaries for computing mean and std.dev: (329, 669) [M::mem_pestat] mean and std.dev: (498.91, 49.88) [M::mem_pestat] low and high boundaries for proper pairs: (261, 737) [M::mem_pestat] skip orientation RF as there are not enough pairs [M::mem_pestat] skip orientation RR as there are not enough pairs

I tried searching for the error message ('skip orientation RF/RR...') but google hits tell me it's not even an error message at all. I wonder if anyone has encountered this before?

For other types of gbk reference (RefSeq or GenBank) I've tried to use it returns a different error early in the run ("[bwa_index] Pack FASTA... [bns_fasta2bntseq] Failed to allocate 0 bytes at bntseq.c line 303: Success").

I remember I've tried snippy about a month ago (same version, 2.9) I got it to work but only with a fasta reference. Now it's not working even with that anymore.

tseemann commented 8 years ago

It sounds like something has changed with your samtools installation, or your FASTA file is corrupt (or in Windows/Mac format and not Unix format).

What does samtools faidx your_reference.fasta say?

Does dos2unix your_reference.fasta or mac2unix your_reference.fasta resolve it?

Feel free to email me the file to check it.

ADGM commented 8 years ago

here: gi|384865886|ref|NC_017342.1| 2802675 90 70 71

tseemann commented 8 years ago

I get a similar result for TCH60:

gi|384865886|ref|NC_017342.1|   2802675 101     70      71

So that's not the issue.

What is in the snps.log file before that?

What version of samtools is being used?

[samfaipath] fail to read file ref.fa.
ADGM commented 8 years ago

samtools v 1.3

I'm just gonna paste whole error log:

samtools faidx reference/ref.fa

bwa index reference/ref.fa

[bwa_index] Pack FASTA... 0.02 sec [bwa_index] Construct BWT for the packed sequence... [bwa_index] 0.46 seconds elapse. [bwa_index] Update BWT... 0.02 sec [bwa_index] Pack forward-only FASTA... 0.02 sec [bwa_index] Construct SA from BWT and Occ... 0.20 sec [main] Version: 0.7.12-r1039 [main] CMD: bwa index reference/ref.fa [main] Real time: 0.816 sec; CPU: 0.730 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

snpEff build -c reference/snpeff.config -dataDir . -gff3 ref

WARNING: All frames are zero! This seems rather odd, please check that 'frame' information in your 'genes' file is accurate.

(bwa mem -v 2 -M -R '@RG ID:snps SM:snps' -t 8 reference/ref.fa /home/adgm/11_1.fastq /home/adgm/11_2.fastq | samtools view -@ 8 -F 3844 -q 60 -S -b -u -T ref.fa - | samtools sort -@ 8 - snps)

[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files Usage: samtools sort [options...] [in.bam] Options: -l INT Set compression level, from 0 (uncompressed) to 9 (best) -m INT Set maximum memory per thread; suffix K/M/G recognized [768M] -n Sort by read name -o FILE Write final output to FILE rather than standard output -T PREFIX Write temporary files to PREFIX.nnnn.bam -@, --threads INT Set number of sorting and compression threads [1] --input-fmt-option OPT[=VAL] Specify a single input file format option in the form of OPTION or OPTION=VALUE -O, --output-fmt FORMAT[,OPT[=VAL]]... Specify output format (SAM, BAM, CRAM) --output-fmt-option OPT[=VAL] Specify a single output file format option in the form of OPTION or OPTION=VALUE --reference FILE Reference sequence FASTA FILE [null] [samfaipath] fail to read file ref.fa. [M::mem_pestat] skip orientation FF as there are not enough pairs [M::mem_pestat] analyzing insert size distribution for orientation FR... [M::mem_pestat](25, 50, 75) percentile: (465, 499, 533) [M::mem_pestat] low and high boundaries for computing mean and std.dev: (329, 669) [M::mem_pestat] mean and std.dev: (498.91, 49.88) [M::mem_pestat] low and high boundaries for proper pairs: (261, 737) [M::mem_pestat] skip orientation RF as there are not enough pairs [M::mem_pestat] skip orientation RR as there are not enough pairs

tseemann commented 8 years ago

Ah! I think you got the 1.3 deprecation bug: https://github.com/tseemann/snippy/issues/45

You need to upgrade Snippy to support samtools 1.3 , which was fixed in v 3.0.

What does your snippy --version say?

ADGM commented 8 years ago

v 2.9. How do I do an upgrade, sorry? I tried git-cloning the other day it was still 2.9

tseemann commented 8 years ago

It's been at v3.0 for nearly 2 months now - not sure why things are not working for you.

Go into your snippy folder and type git pull - that should update it.

If not, git clone https://github.com/tseemann/snippy.git should give you the current version.

ADGM commented 8 years ago

he he so I think I haven't been successfully cloning all this time because a 'snippy' folder already exists in my linuxbrew Cellar directory. With snippy 3.0 I can now get it to work with a gbk reference (the prokka output in particular), which is what I needed to work in the first place bc I'm after the snpEff data. Thank you so much for all the help, seriously!!

tseemann commented 8 years ago

Glad you got it working.

I didn't realise you were using Brew - in that case you can force the latest Snippy with

brew uninstall snippy
brew install snippy --HEAD
kelvin-wcl commented 7 years ago

Hi, I am trying to install SNIPPY on linux without much luck.

I am using Brew for the installation:

brew tap homebrew/science brew tap tseemann/homebrew-bioinformatics-linux brew install snippy snippy --help

this are the results I get:

brew install snippy ==> Installing snippy from tseemann/bioinformatics-linux ==> Downloading https://github.com/tseemann/snippy/archive/v3.1.tar.gz Already downloaded: /home/ubuntu/.cache/Homebrew/snippy-3.1.tar.gz 🍺 /home/ubuntu/.linuxbrew/Cellar/snippy/3.1: 39 files, 69.9MB, built in 2 seconds ubuntu@kl-vm3:~$ snippy --version No command 'snippy' found, did you mean: Command 'snimpy' from package 'snimpy' (universe) Command 'snappy' from package 'snappy' (universe) snippy: command not found

I am not sure what I am dong wrong here as the command snippy is not recognised.

If you have come across this problem, could you please share with me the solution?

I am trying to create an alignment file (.aln) to be used with gubbins

Thank you, Kelvin

tseemann commented 7 years ago

@kelvin-wcl you don't seem to have install homebrew properly? you need to have the homebrew 'bin' folder as the first thing in your PATH.

what does brew doctor say.

kelvin-wcl commented 7 years ago

Hi Torsten,

I managed to get it work but the command only works in one directory. When I change to another directory, the command is not recognised. I can live with this issue for the time being.

I managed to run Snippy, and generate the csv file of the SNPs (*), then generate the alignment and use the .aln as input to Gubbins.

From Gubbins, I can generate the PDF file of the phylogenetic tree. There is also a csv file which contains a breakdown of the SNPs (in/out recombination region)

My query is: Is there a way of generating a csv file of the SNPS like from Snippy, which lists the SNPs after removal of recombination regions?

Thanks.

Kelvin

From: Torsten Seemann [mailto:notifications@github.com] Sent: Wednesday, 19 July 2017 10:27 AM To: tseemann/snippy snippy@noreply.github.com Cc: Kelvin Leong kelvin.leong@utas.edu.au; Mention mention@noreply.github.com Subject: Re: [tseemann/snippy] Error in bwa step (#56)

@kelvin-wclhttps://github.com/kelvin-wcl you don't seem to have install homebrew properly? you need to have the homebrew 'bin' folder as the first thing in your PATH.

what does brew doctor say.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/tseemann/snippy/issues/56#issuecomment-316236881, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXRRRTGI8zRen3sccPUYz6A7t8GLozz7ks5sPU1LgaJpZM4H-GW8.

University of Tasmania Electronic Communications Policy (December, 2014). This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

kelvin-wcl commented 7 years ago

Hi Torsten,

Are you able to address my queries below with respect to the SNP differences between isolates instead of just to the reference genome?

Thank you.

Regards,

Kelvin

From: Kelvin Leong Sent: Friday, 21 July 2017 2:53 PM To: 'tseemann/snippy' reply@reply.github.com Subject: RE: [tseemann/snippy] Error in bwa step (#56)

Hi Torsten,

I managed to get it work but the command only works in one directory. When I change to another directory, the command is not recognised. I can live with this issue for the time being.

I managed to run Snippy, and generate the csv file of the SNPs (*), then generate the alignment and use the .aln as input to Gubbins.

From Gubbins, I can generate the PDF file of the phylogenetic tree. There is also a csv file which contains a breakdown of the SNPs (in/out recombination region)

My query is: Is there a way of generating a csv file of the SNPS like from Snippy, which lists the SNPs after removal of recombination regions?

Thanks.

Kelvin

From: Torsten Seemann [mailto:notifications@github.com] Sent: Wednesday, 19 July 2017 10:27 AM To: tseemann/snippy snippy@noreply.github.com<mailto:snippy@noreply.github.com> Cc: Kelvin Leong kelvin.leong@utas.edu.au<mailto:kelvin.leong@utas.edu.au>; Mention mention@noreply.github.com<mailto:mention@noreply.github.com> Subject: Re: [tseemann/snippy] Error in bwa step (#56)

@kelvin-wclhttps://github.com/kelvin-wcl you don't seem to have install homebrew properly? you need to have the homebrew 'bin' folder as the first thing in your PATH.

what does brew doctor say.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/tseemann/snippy/issues/56#issuecomment-316236881, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXRRRTGI8zRen3sccPUYz6A7t8GLozz7ks5sPU1LgaJpZM4H-GW8.

University of Tasmania Electronic Communications Policy (December, 2014). This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.