faircloth-lab / phyluce

software for UCE (and general) phylogenomics
http://phyluce.readthedocs.org/
Other
76 stars 48 forks source link

phasing workflow failed - one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode! #302

Closed andreluizherpeto closed 1 year ago

andreluizherpeto commented 1 year ago
Dear Dr. Faircloth,

I'm running the phasing workflow in phyluce 1.7.2. using the command below.

phyluce_workflow --config phasing.conf \ --output phased-data \ --workflow phasing \ --cores 1

 The log file produced by phyluce informs that snakefile (or pilon) is killing the analysis because "one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!"  (see full message below).

[Mon Mar 27 14:12:39 2023] Finished job 86. 38 of 185 steps (21%) done Select jobs to execute...

[Mon Mar 27 14:12:39 2023] rule pilon_allele_1: input: /spades-assemblies/contigs/Plica_umbra_968128.contigs.fasta, bams/Plica_umbra_968128.1.bam, bams/Plica_umbra_968128.1.bam.bai output: fastas/Plica_umbra_968128.1.fasta jobid: 171 wildcards: sample=Plica_umbra_968128

[Mon Mar 27 14:38:37 2023] Error in rule pilon_allele_0: jobid: 153 output: fastas/Stenocercus_quinarius_SRR7240882.0.fasta shell: pilon --threads 1 --vcf --changes --fix snps,indels --minqual 10 --mindepth 5 --genome /spades-assemblies/contigs/Stenocercus_quinarius_SRR7240882.contigs.fasta --bam bams/Stenocercus_quinarius_SRR7240882.0.bam --outdir fastas --output Stenocercus_quinarius_SRR7240882.0 (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

[Tue Mar 28 20:04:52 2023] Finished job 145. 39 of 185 steps (21%) done [Tue Mar 28 20:04:59 2023] Finished job 168. 40 of 185 steps (22%) done [Wed Mar 29 06:05:05 2023] Error in rule pilon_allele_1: jobid: 171 output: fastas/Plica_umbra_968128.1.fasta shell: pilon --threads 1 --vcf --changes --fix snps,indels --minqual 10 --mindepth 5 --genome /spades-assemblies/contigs/Plica_umbra_968128.contigs.fasta --bam bams/Plica_umbra_968128.1.bam --outdir fastas --output Plica_umbra_968128.1 (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time. Exiting because a job execution failed. Look above for error message Complete log: phasing-results/.snakemake/log/2023-03-27T140923.109849.snakemake.log

  In order to find out what the real problem is, I separately ran pilon using the same command line used by phyluce (i.e., pilon --threads 1 --vcf --changes --fix snps,indels --minqual 10 --mindepth 5 --genome ...) and the exact same files I had previously fed to phyluce (i.e. the reads and the BAM file generated by phyluce during the mapping step).  As a result, pilon releases the following error message (no matter the sample being processed): "requirement failed: Eurolophosaurus_amathites_MTR11349.fxm.sorted.md.bam must be indexed BAM" (full message below). Apparently, during the mapping step that generated the BAM files, phyluce produced a non-indexed BAM file. Is that correct? If that is indeed the problem, do you have any suggestions on how to fix it? 

pilon --threads 1 --vcf --changes --fix snps,indels --minqual 10 --mindepth 5 --genome Eurolophosaurus_amathites_MTR11349.contigs.fasta --bam Eurolophosaurus_amathites_MTR11349.fxm.sorted.md.bam --outdir fastas --output Eurolophosaurus_amathites_MTR11349.1

Pilon version 1.24 Thu Jan 28 13:00:45 2021 -0500 --threads argument no longer supported; ignoring! Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Eurolophosaurus_amathites_MTR11349.fxm.sorted.md.bam must be indexed BAM at scala.Predef$.require(Predef.scala:338) at org.broadinstitute.pilon.BamFile.(BamFile.scala:58) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:131) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:172) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:181) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:190) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:160) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:135) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:240) at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:222) at org.broadinstitute.pilon.Pilon$.main(Pilon.scala:84) at org.broadinstitute.pilon.Pilon.main(Pilon.scala)

In advance, I thank you for your help. Best regards, André Carvalho.
lauratravail commented 2 months ago

Hi @andreluizherpeto, did you manage to fix this issue? I am having the same but cannot find what is the problem... Thx

andreluizherpeto commented 2 months ago

Hi @andreluizherpeto, did you manage to fix this issue? I am having the same but cannot find what is the problem... Thx

Hi @lauratravail, I was unable to fix this problem. Please, let me know if you have any success. Best luck!

brantfaircloth commented 2 months ago

It looks like the BAM is not being indexed (although that indexing is one of the steps of the workflow). Perhaps activate the phyluce environment (that you were using) and trying running (e.g. in the case above):

samtools index Eurolophosaurus_amathites_MTR11349.fxm.sorted.md.bam Eurolophosaurus_amathites_MTR11349.fxm.sorted.md.bam .bai

and see what happens.